mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
Bluetooth: hci_sync: Fix queuing commands when HCI_UNREGISTER is set
[ Upstream commit 0b94f2651f
]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8978748a14
commit
1c69ef84a8
1 changed files with 3 additions and 0 deletions
|
@ -379,6 +379,9 @@ int hci_cmd_sync_queue(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
|
||||||
{
|
{
|
||||||
struct hci_cmd_sync_work_entry *entry;
|
struct hci_cmd_sync_work_entry *entry;
|
||||||
|
|
||||||
|
if (hci_dev_test_flag(hdev, HCI_UNREGISTER))
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
|
entry = kmalloc(sizeof(*entry), GFP_KERNEL);
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue