Skip to content

Commit a134f08

Browse files
committed
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(). Tested-by: Linus Torvalds <[email protected]> Reported-by: Wen Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e813bb2 commit a134f08

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv4/ping.c

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ void ping_unhash(struct sock *sk)
158158
if (sk_hashed(sk)) {
159159
write_lock_bh(&ping_table.lock);
160160
hlist_nulls_del(&sk->sk_nulls_node);
161+
sk_nulls_node_init(&sk->sk_nulls_node);
161162
sock_put(sk);
162163
isk->inet_num = 0;
163164
isk->inet_sport = 0;

0 commit comments

Comments
 (0)