]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: hci_sync: fix race in hci_cmd_sync_dequeue_once
authorCen Zhang <zzzccc427@163.com>
Mon, 29 Sep 2025 05:30:17 +0000 (05:30 +0000)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 24 Oct 2025 14:20:15 +0000 (10:20 -0400)
commit09b0cd1297b4dbfe736aeaa0ceeab2265f47f772
tree5b11afe1ca5cc08cbdb03979683bb9b57e80566b
parent1ab665817448c31f4758dce43c455bd4c5e460aa
Bluetooth: hci_sync: fix race in hci_cmd_sync_dequeue_once

hci_cmd_sync_dequeue_once() does lookup and then cancel
the entry under two separate lock sections. Meanwhile,
hci_cmd_sync_work() can also delete the same entry,
leading to double list_del() and "UAF".

Fix this by holding cmd_sync_work_lock across both
lookup and cancel, so that the entry cannot be removed
concurrently.

Fixes: 505ea2b29592 ("Bluetooth: hci_sync: Add helper functions to manipulate cmd_sync queue")
Reported-by: Cen Zhang <zzzccc427@163.com>
Signed-off-by: Cen Zhang <zzzccc427@163.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_sync.c