Commit 541d5bf
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 f4b69c3 commit 541d5bf
1 file changed
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3284 | 3284 | | |
3285 | 3285 | | |
3286 | 3286 | | |
3287 | | - | |
3288 | | - | |
3289 | 3287 | | |
3290 | 3288 | | |
3291 | 3289 | | |
| |||
3319 | 3317 | | |
3320 | 3318 | | |
3321 | 3319 | | |
3322 | | - | |
3323 | 3320 | | |
3324 | 3321 | | |
3325 | 3322 | | |
| |||
0 commit comments