mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+3e07a461b836821ff70e@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bluetooth?] WARNING in hci_recv_frame
Date: Wed, 20 Nov 2024 19:47:03 +0800	[thread overview]
Message-ID: <20241120114703.1293-1-hdanton@sina.com> (raw)
In-Reply-To: <673da95e.050a0220.363a1b.0009.GAE@google.com>

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;
 }
--

  reply	other threads:[~2024-11-20 11:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 12:10 syzbot
2024-11-20  9:18 ` syzbot
2024-11-20 11:47   ` Hillf Danton [this message]
2024-11-20 12:22     ` syzbot
2025-05-19 17:27 ` syzbot
     [not found] <20250520105016.2205-1-hdanton@sina.com>
2025-05-20 11:13 ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241120114703.1293-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+3e07a461b836821ff70e@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®