]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
Bluetooth: fix locking in hci_conn_request_evt() with HCI_PROTO_DEFER
authorPauli Virtanen <pav@iki.fi>
Sun, 29 Mar 2026 13:42:59 +0000 (16:42 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 13 Apr 2026 13:18:16 +0000 (09:18 -0400)
commit5c7209a341ff2ac338b2b0375c34a307b37c9ac2
tree16e8275f5743fb1ba730b2be858d07adf1dc2526
parent120941654f187674b3aac4d546c2a915965b3937
Bluetooth: fix locking in hci_conn_request_evt() with HCI_PROTO_DEFER

When protocol sets HCI_PROTO_DEFER, hci_conn_request_evt() calls
hci_connect_cfm(conn) without hdev->lock. Generally hci_connect_cfm()
assumes it is held, and if conn is deleted concurrently -> UAF.

Only SCO and ISO set HCI_PROTO_DEFER and only for defer setup listen,
and HCI_EV_CONN_REQUEST is not generated for ISO.  In the non-deferred
listening socket code paths, hci_connect_cfm(conn) is called with
hdev->lock held.

Fix by holding the lock.

Fixes: 70c464256310 ("Bluetooth: Refactor connection request handling")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_event.c