Thread (2 messages) 2 messages, 2 authors, 2021-10-12

Re: [PATCH] Bluetooth: hci_sock: purge socket queues in the destruct() callback

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2021-10-12 15:38:56
Also in: linux-bluetooth, lkml, netdev

Hi Nguyen,
The receive path may take the socket right before hci_sock_release(),
but it may enqueue the packets to the socket queues after the call to
skb_queue_purge(), therefore the socket can be destroyed without clear
its queues completely.

Moving these skb_queue_purge() to the hci_sock_destruct() will fix this
issue, because nothing is referencing the socket at this point.

Signed-off-by: Nguyen Dinh Phi <redacted>
Reported-by: syzbot+4c4ffd1e1094dae61035@syzkaller.appspotmail.com
---
net/bluetooth/hci_sock.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
patch has been applied to bluetooth-next tree.

Regards

Marcel

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help