Skip to content

Commit af9f691

Browse files
congwangdavem330
authored andcommitted
qrtr: orphan socket in qrtr_release()
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: 28fb4e5 ("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]>
1 parent 657237f commit af9f691

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/qrtr/qrtr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,6 +1180,7 @@ static int qrtr_release(struct socket *sock)
11801180
sk->sk_state_change(sk);
11811181

11821182
sock_set_flag(sk, SOCK_DEAD);
1183+
sock_orphan(sk);
11831184
sock->sk = NULL;
11841185

11851186
if (!sock_flag(sk, SOCK_ZAPPED))

0 commit comments

Comments
 (0)