Skip to content

Commit a735bb1

Browse files
committed
Bluetooth: hci_sync: Fix queuing commands when HCI_UNREGISTER is set
jira VULN-50082 jira VULN-50081 cve CVE-2022-49136 commit-author Luiz Augusto von Dentz <luiz.von.dentz@intel.com> commit 0b94f26 hci_cmd_sync_queue shall return an error if HCI_UNREGISTER flag has been set as that means hci_unregister_dev has been called so it will likely cause a uaf after the timeout as the hdev will be freed. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> (cherry picked from commit 0b94f26) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 694d1e0 commit a735bb1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/bluetooth/hci_sync.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ int hci_cmd_sync_queue(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
379379
{
380380
struct hci_cmd_sync_work_entry *entry;
381381

382+
if (hci_dev_test_flag(hdev, HCI_UNREGISTER))
383+
return -ENODEV;
384+
382385
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
383386
if (!entry)
384387
return -ENOMEM;

0 commit comments

Comments
 (0)