aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-05-01 22:02:47 -0400
committerZiyan <jaraidaniel@gmail.com>2016-01-05 18:20:37 +0100
commit2cfb35e5936ef93b8bfc09a72042ccbd4df34743 (patch)
treeb823bd534add0e8685983ad0df07583cfc16e991 /net
parentfc9f868e5682355315f4a32ad927cde846e056ab (diff)
downloadkernel_samsung_tuna-2cfb35e5936ef93b8bfc09a72042ccbd4df34743.zip
kernel_samsung_tuna-2cfb35e5936ef93b8bfc09a72042ccbd4df34743.tar.gz
kernel_samsung_tuna-2cfb35e5936ef93b8bfc09a72042ccbd4df34743.tar.bz2
ipv4: Missing sk_nulls_node_init() in ping_unhash().
If we don't do that, then the poison value is left in the ->pprev backlink. This can cause crashes if we do a disconnect, followed by a connect(). Change-Id: I13536e10c0b67bf9830af91f7ed3c4f3653d11cb Tested-by: Linus Torvalds <torvalds@linux-foundation.org> Reported-by: Wen Xu <hotdog3645@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/ping.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 3f820c3..c6cff9a 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -153,6 +153,7 @@ void ping_unhash(struct sock *sk)
if (sk_hashed(sk)) {
write_lock_bh(&ping_table.lock);
hlist_nulls_del(&sk->sk_nulls_node);
+ sk_nulls_node_init(&sk->sk_nulls_node);
sock_put(sk);
isk->inet_num = isk->inet_sport = 0;
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);