Commit 09b0cd12 authored by Cen Zhang's avatar Cen Zhang Committed by Luiz Augusto von Dentz
Browse files

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: 505ea2b2 ("Bluetooth: hci_sync: Add helper functions to manipulate cmd_sync queue")
Reported-by: default avatarCen Zhang <zzzccc427@163.com>
Signed-off-by: default avatarCen Zhang <zzzccc427@163.com>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent 1ab66581
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment