summaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-10-28 13:40:24 -0700
committerBen Hutchings <ben@decadent.org.uk>2017-03-16 02:27:19 +0000
commit4ecc76bd3f1b45cd31b4c88bdd8d77bf998a471e (patch)
tree90dab8233ad551fb81237c6741798daa58f987d4 /net/core
parentb931800fd94f65282ff3071e009d1304e262a6d7 (diff)
downloadlinux-stable-4ecc76bd3f1b45cd31b4c88bdd8d77bf998a471e.tar.gz
linux-stable-4ecc76bd3f1b45cd31b4c88bdd8d77bf998a471e.tar.bz2
linux-stable-4ecc76bd3f1b45cd31b4c88bdd8d77bf998a471e.zip
net: clear sk_err_soft in sk_clone_lock()
[ Upstream commit e551c32d57c88923f99f8f010e89ca7ed0735e83 ] At accept() time, it is possible the parent has a non zero sk_err_soft, leftover from a prior error. Make sure we do not leave this value in the child, as it makes future getsockopt(SO_ERROR) calls quite unreliable. Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/sock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 3ac3a80dbead..af856f01cc8f 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1560,6 +1560,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
}
newsk->sk_err = 0;
+ newsk->sk_err_soft = 0;
newsk->sk_priority = 0;
/*
* Before updating sk_refcnt, we must commit prior changes to memory