Lin Ma
eeec325c99
bluetooth: eliminate the potential race condition when removing the HCI controller
...
commit e2cb6b891ad2b8caa9131e3be70f45243df82a80 upstream.
There is a possible race condition vulnerability between issuing a HCI
command and removing the cont. Specifically, functions hci_req_sync()
and hci_dev_do_close() can race each other like below:
thread-A in hci_req_sync() | thread-B in hci_dev_do_close()
| hci_req_sync_lock(hdev);
test_bit(HCI_UP, &hdev->flags); |
... | test_and_clear_bit(HCI_UP, &hdev->flags)
hci_req_sync_lock(hdev); |
|
In this commit we alter the sequence in function hci_req_sync(). Hence,
the thread-A cannot issue th.
Signed-off-by: Lin Ma <[email protected] >
Cc: Marcel Holtmann <[email protected] >
Fixes: 7c6a329e44 ("[Bluetooth] Fix regression from using default link policy")
Signed-off-by: Greg Kroah-Hartman <[email protected] >
2021-05-14 09:44:10 +02:00
..
bnep
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234
2019-06-19 17:09:07 +02:00
cmtp
hidp
Bluetooth: hidp: Fix assumptions on the return value of hidp_send_message
2019-09-06 15:55:40 +02:00
rfcomm
Bluetooth: RFCOMM: fix ODEBUG bug in rfcomm_dev_ioctl
2020-04-13 10:48:13 +02:00
6lowpan.c
Bluetooth: add a mutex lock to avoid UAF in do_enale_set
2020-08-19 08:15:59 +02:00
a2mp.c
Bluetooth: drop HCI device reference before return
2021-03-04 10:26:14 +01:00
a2mp.h
af_bluetooth.c
net: use skb_queue_empty_lockless() in poll() handlers
2019-10-28 13:33:41 -07:00
amp.c
Bluetooth: Fix null pointer dereference in amp_read_loc_assoc_final_data
2021-03-07 12:20:45 +01:00
amp.h
ecdh_helper.c
ecdh_helper.h
Fix misc new gcc warnings
2021-05-11 14:04:16 +02:00
hci_conn.c
Bluetooth: Disconnect if E0 is used for Level 4
2020-10-17 10:11:22 +02:00
hci_core.c
Bluetooth: Put HCI device if inquiry procedure interrupts
2021-03-04 10:26:14 +01:00
hci_debugfs.c
Bluetooth: Add debug setting for changing minimum encryption key size
2019-08-17 13:54:40 +03:00
hci_debugfs.h
hci_event.c
Bluetooth: verify AMP hci_chan before amp_destroy
2021-05-14 09:44:10 +02:00
hci_request.c
bluetooth: eliminate the potential race condition when removing the HCI controller
2021-05-14 09:44:10 +02:00
hci_request.h
Bluetooth: Use controller sets when available
2019-07-06 15:38:18 +02:00
hci_sock.c
Bluetooth: Fix race condition in hci_release_sock()
2020-02-05 21:22:42 +00:00
hci_sysfs.c
Kconfig
bluetooth: switch to AES library
2019-07-26 14:58:12 +10:00
l2cap_core.c
Bluetooth: L2CAP: Fix calling sk_filter on non-socket based channel
2020-10-17 10:11:22 +02:00
l2cap_sock.c
Bluetooth: Only mark socket zapped after unlocking
2020-10-29 09:58:06 +01:00
leds.c
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
leds.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
2019-06-19 17:09:55 +02:00
lib.c
Makefile
mgmt.c
Bluetooth: MGMT: Fix not checking if BT_HS is enabled
2020-10-17 10:11:22 +02:00
mgmt_util.c
mgmt_util.h
sco.c
selftest.c
selftest.h
smp.c
bluetooth: switch to AES library
2019-07-26 14:58:12 +10:00
smp.h