summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-10-28 23:40:24 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-21 12:11:34 +0300
commitac22a3ba07964d39e8c2cf2abda7c610d861eefe (patch)
tree0d4ab50fd5ac65bf1c78a6887d289f9baccbcdf4 /net
parent5b078dc6fb6487d05bfca078f5c3806523bc5712 (diff)
downloadlinux-ac22a3ba07964d39e8c2cf2abda7c610d861eefe.tar.xz
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-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 fd7b41edf1ce..6b8d2246bbe9 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1563,6 +1563,7 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority)
RCU_INIT_POINTER(newsk->sk_reuseport_cb, NULL);
newsk->sk_err = 0;
+ newsk->sk_err_soft = 0;
newsk->sk_priority = 0;
newsk->sk_incoming_cpu = raw_smp_processor_id();
atomic64_set(&newsk->sk_cookie, 0);