]> git.baikalelectronics.ru Git - kernel.git/commit
qrtr: orphan socket in qrtr_release()
authorCong Wang <xiyou.wangcong@gmail.com>
Fri, 24 Jul 2020 16:45:51 +0000 (09:45 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 25 Jul 2020 00:29:52 +0000 (17:29 -0700)
commit06557008fda21294b05444f70e634381233a5aa9
treedefe494f1be7a5e5a29b3f660cb713dc25dd9073
parentd3a0119a05fff414591925dfef1678c775d1fbf2
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: syzbot+6720d64f31c081c2f708@syzkaller.appspotmail.com
Fixes: c19ece005718 ("net: qrtr: Expose tunneling endpoint to user space")
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/qrtr/qrtr.c