[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241120114703.1293-1-hdanton@sina.com>
Date: Wed, 20 Nov 2024 19:47:03 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+3e07a461b836821ff70e@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [bluetooth?] WARNING in hci_recv_frame
On Wed, 20 Nov 2024 01:18:22 -0800
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: a5c93bfec0be Merge tag 'x86-mm-2024-11-18' of git://git.ke..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12694ae8580000
#syz test upstream master
--- x/net/bluetooth/hci_core.c
+++ y/net/bluetooth/hci_core.c
@@ -2901,12 +2901,18 @@ int hci_recv_frame(struct hci_dev *hdev,
{
u8 dev_pkt_type;
- if (!hdev || (!test_bit(HCI_UP, &hdev->flags)
- && !test_bit(HCI_INIT, &hdev->flags))) {
+ if (!hdev || !test_bit(HCI_UP, &hdev->flags)) {
+out:
kfree_skb(skb);
return -ENXIO;
}
+ hci_req_sync_lock(hdev);
+ if (!test_bit(HCI_UP, &hdev->flags)) {
+ hci_req_sync_unlock(hdev);
+ goto out;
+ }
+
/* Check if the driver agree with packet type classification */
dev_pkt_type = hci_dev_classify_pkt_type(hdev, skb);
if (hci_skb_pkt_type(skb) != dev_pkt_type) {
@@ -2933,6 +2939,7 @@ int hci_recv_frame(struct hci_dev *hdev,
break;
default:
kfree_skb(skb);
+ hci_req_sync_unlock(hdev);
return -EINVAL;
}
@@ -2944,6 +2951,7 @@ int hci_recv_frame(struct hci_dev *hdev,
skb_queue_tail(&hdev->rx_q, skb);
queue_work(hdev->workqueue, &hdev->rx_work);
+ hci_req_sync_unlock(hdev);
return 0;
}
--
Powered by blists - more mailing lists