aboutsummaryrefslogtreecommitdiff
path: root/net/core/sock.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-10-28 13:40:24 -0700
committerMister Oyster <oysterized@gmail.com>2017-04-11 10:58:44 +0200
commitc953dabcd369f4a69f20a5321d932291946e577b (patch)
tree9c65cae75c4a3f892b3f1224db8d3f6f3c2662a4 /net/core/sock.c
parent2cab8a3ef0d1c2f936c8dc29b7847b7c5514ddce (diff)
net: clear sk_err_soft in sk_clone_lock()
commit e551c32d57c88923f99f8f010e89ca7ed0735e83 upstream. 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: Willy Tarreau <w@1wt.eu>
Diffstat (limited to 'net/core/sock.c')
-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 f42b90c46..e719f40da 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1519,6 +1519,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