)]}'
{
  "commit": "19b4e5701712f74d005cc66a36374559e8dfd281",
  "tree": "54849b64d99d596757ea2a958c74af078ef7178f",
  "parents": [
    "56ed6b127a27c418dc2daa3fd076539d8fe69c4c"
  ],
  "author": {
    "name": "Akhil Arul",
    "email": "akhilarul324@gmail.com",
    "time": "Fri Oct 23 21:46:09 2026 +0530"
  },
  "committer": {
    "name": "Luiz Augusto von Dentz",
    "email": "luiz.von.dentz@intel.com",
    "time": "Mon Nov 02 17:09:01 2026 -0500"
  },
  "message": "Bluetooth: hci_core: Fix queuing rx_work while workqueue is drained\n\nhci_recv_frame() drops a frame unless HCI_UP or HCI_INIT is set, but the\ncheck is not synchronized with hci_dev_close_sync().  A driver can pass\nthe check, then close clears HCI_UP, flushes rx_work and starts\ndrain_workqueue(), and the late queue_work() of rx_work hits the\ndraining workqueue:\n\n  workqueue: cannot queue hci_rx_work on wq hci0\n  WARNING: kernel/workqueue.c:2352 at __queue_work+0x2c0/0x780\n  Call Trace:\n   queue_work_on+0xb2/0xc0\n   hci_recv_frame+0x18f/0x330\n   vhci_write+0x174/0x240\n   vfs_write+0x271/0x680\n   ksys_write+0x7c/0x110\n\nSkipping the queue_work() while HCI_CMD_DRAIN_WORKQUEUE is set, as done\nfor tx_work, does not work for rx_work: the flag covers the whole close,\nand events still have to be received in that window, for the commands\nsent by hdev-\u003eshutdown() and for the reset done with\nHCI_QUIRK_RESET_ON_CLOSE.\n\nRun hci_recv_frame() under rcu_read_lock() and wait with\nsynchronize_rcu() once HCI_UP has been cleared, so that every caller\nwhich still saw HCI_UP has queued its work before the workqueue is\ndrained, and later callers drop the frame.\n\nHCI_INIT does not reopen that window.  Apart from the\nHCI_QUIRK_RESET_ON_CLOSE reset, which runs after drain_workqueue() has\nreturned, it is only set by hci_dev_init_sync() during open, and open\nand close are serialized by hci_req_sync_lock.  So once the grace period\nhas ended, nothing can pass the check and queue rx_work until the drain\nis over.\n\nTested in qemu with the syzbot C reproducer, one run per boot: the\nwarning showed up on 12 of 30 boots before and on none of 42 boots after.\nBringing a vhci controller up and down 50 times behaves the same with\nand without this change.\n\nFixes: 76727c02c1e1 (\"Bluetooth: Call drain_workqueue() before resetting state\")\nReported-by: syzbot+2344fb8002f3ef5b1712@syzkaller.appspotmail.com\nCloses: https://syzkaller.appspot.com/bug?extid\u003d2344fb8002f3ef5b1712\nSigned-off-by: Akhil Arul \u003cakhilarul324@gmail.com\u003e\nSigned-off-by: Luiz Augusto von Dentz \u003cluiz.von.dentz@intel.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e53cbaef819ccdae20f6257d13d99110c8788e6f",
      "old_mode": 33188,
      "old_path": "net/bluetooth/hci_core.c",
      "new_id": "55fc64db495ac6e2e55487df85398538dfb033e9",
      "new_mode": 33188,
      "new_path": "net/bluetooth/hci_core.c"
    },
    {
      "type": "modify",
      "old_id": "c9e80b957455186f40b1cfedd87184384bb49388",
      "old_mode": 33188,
      "old_path": "net/bluetooth/hci_sync.c",
      "new_id": "93dfe2e9bb0e068cc4ccf311cabd735461494ea4",
      "new_mode": 33188,
      "new_path": "net/bluetooth/hci_sync.c"
    }
  ]
}
