Commit 385b2d0
Bluetooth: fix locking in hci_conn_request_evt() with HCI_PROTO_DEFER
[ Upstream commit 5c7209a ]
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: 70c4642 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 3daa581 commit 385b2d0
1 file changed
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3309 | 3309 | | |
3310 | 3310 | | |
3311 | 3311 | | |
3312 | | - | |
3313 | | - | |
3314 | 3312 | | |
3315 | 3313 | | |
3316 | 3314 | | |
| |||
3344 | 3342 | | |
3345 | 3343 | | |
3346 | 3344 | | |
3347 | | - | |
3348 | 3345 | | |
3349 | 3346 | | |
3350 | 3347 | | |
| |||
0 commit comments