漏洞标题
蓝牙:hci_core: 在hci_unregister_dev()之后取消所有工作
漏洞描述信息
在Linux内核中,已修复以下漏洞:
蓝牙:hci_core:在hci_unregister_dev()后取消所有工作
syzbot报告称,由于在hci_error_reset()中调用hci_dev_put(),在hci_release_dev()中调用hci_error_reset()可能会导致在destroy_workqueue()处死锁。这是因为hci_error_reset()从hdev->req_workqueue调用,而destroy_workqueue()需要清除hdev->req_workqueue。
我们需要确保在调用hci_release_dev()时,hdev->{rx_work,cmd_work,tx_work}在hdev->workqueue中排队和hdev->{power_on,error_reset}在hdev->req_workqueue中排队的工作项不再运行:
destroy_workqueue(hdev->workqueue);
destroy_workqueue(hdev->req_workqueue);
需要在调用hci_release_dev()时,一旦hdev->list从hci_dev_list中移除,就对这些工作项目调用cancel_work_sync()。
在hci_unregister_dev()中尽快调用cancel_work_sync(),以确保hdev->list从hci_dev_list中移除时,这些工作项已停止运行。
CVSS信息
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
漏洞类别
加锁机制不恰当
漏洞标题
Bluetooth: hci_core: cancel all works upon hci_unregister_dev()
漏洞描述信息
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_core: cancel all works upon hci_unregister_dev()
syzbot is reporting that calling hci_release_dev() from hci_error_reset()
due to hci_dev_put() from hci_error_reset() can cause deadlock at
destroy_workqueue(), for hci_error_reset() is called from
hdev->req_workqueue which destroy_workqueue() needs to flush.
We need to make sure that hdev->{rx_work,cmd_work,tx_work} which are
queued into hdev->workqueue and hdev->{power_on,error_reset} which are
queued into hdev->req_workqueue are no longer running by the moment
destroy_workqueue(hdev->workqueue);
destroy_workqueue(hdev->req_workqueue);
are called from hci_release_dev().
Call cancel_work_sync() on these work items from hci_unregister_dev()
as soon as hdev->list is removed from hci_dev_list.
CVSS信息
N/A
漏洞类别
N/A
漏洞标题
Linux kernel 安全漏洞
漏洞描述信息
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于在hci_unregister_dev函数期间,未取消所有工作,导致在销毁工作队列时可能发生死锁。
CVSS信息
N/A
漏洞类别
其他