summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2016-10-28 13:40:24 -0700
committerJiri Slaby <jslaby@suse.cz>2016-11-28 22:22:33 +0100
commit11c4d5f9c7f85b14665b7f3ebfeb3cb319f5cb1e (patch)
tree1eee04bdc64005a829d147b59881cd5cb29bace5
parent90523418b2fecb64ad68e0c5f0e3381bdb020671 (diff)
downloadlwn-11c4d5f9c7f85b14665b7f3ebfeb3cb319f5cb1e.tar.gz
lwn-11c4d5f9c7f85b14665b7f3ebfeb3cb319f5cb1e.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: Jiri Slaby <jslaby@suse.cz>
-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 516b45c82093..73c6093e136a 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1537,6 +1537,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