mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
qrtr: orphan socket in qrtr_release()
[ Upstream commit af9f691f0f5bdd1ade65a7b84927639882d7c3e5 ]
We have to detach sock from socket in qrtr_release(),
otherwise skb->sk may still reference to this socket
when the skb is released in tun->queue, particularly
sk->sk_wq still points to &sock->wq, which leads to
a UAF.
Reported-and-tested-by: [email protected]
Fixes: 28fb4e59a4 ("net: qrtr: Expose tunneling endpoint to user space")
Cc: Bjorn Andersson <[email protected]>
Cc: Eric Dumazet <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
2bf797a869
commit
b7d3d6df72
1 changed files with 1 additions and 0 deletions
|
|
@ -1004,6 +1004,7 @@ static int qrtr_release(struct socket *sock)
|
|||
sk->sk_state_change(sk);
|
||||
|
||||
sock_set_flag(sk, SOCK_DEAD);
|
||||
sock_orphan(sk);
|
||||
sock->sk = NULL;
|
||||
|
||||
if (!sock_flag(sk, SOCK_ZAPPED))
|
||||
|
|
|
|||
Loading…
Reference in a new issue