Commit 9c09e405 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[NETROM]: Fix use after free in socket close.

netrom would oops if one did:
modprobe netrom
ifconfig -a

because the code in destroy was freeing the socket then release_sock was
called.
parent 206ef42f
......@@ -516,6 +516,7 @@ static int nr_release(struct socket *sock)
if (sk == NULL) return 0;
sock_hold(sk);
lock_sock(sk);
nr = nr_sk(sk);
......@@ -551,6 +552,7 @@ static int nr_release(struct socket *sock)
sock->sk = NULL;
release_sock(sk);
sock_put(sk);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment