Re: [syzbot] [bluetooth?] [usb?] memory leak in __hci_cmd_sync_sk

Edward Adam Davis
2025-11-18T02:53:04Z

#syz test

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 6e76798ec786..553cfc4f7886 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -177,8 +177,11 @@ struct sk_buff *__hci_cmd_sync_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
hdev->req_status != HCI_REQ_PEND,
timeout);

- if (err == -ERESTARTSYS)
+ if (err == -ERESTARTSYS) {
+ flush_work(&hdev->cmd_work);
+ skb_queue_purge(&req.cmd_q);
return ERR_PTR(-EINTR);
+ }

switch (hdev->req_status) {