Commit 67b3d90
Bastien Nocera
Bluetooth: MGMT: Fix possible deadlocks
JIRA: https://issues.redhat.com/browse/RHEL-64476
CVE: CVE-2024-49951
commit a66dfaf
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: Thu Nov 21 11:09:22 2024 -0500
Bluetooth: MGMT: Fix possible deadlocks
This fixes possible deadlocks like the following caused by
hci_cmd_sync_dequeue causing the destroy function to run:
INFO: task kworker/u19:0:143 blocked for more than 120 seconds.
Tainted: G W O 6.8.0-2024-03-19-intel-next-iLS-24ww14 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u19:0 state:D stack:0 pid:143 tgid:143 ppid:2 flags:0x00004000
Workqueue: hci0 hci_cmd_sync_work [bluetooth]
Call Trace:
<TASK>
__schedule+0x374/0xaf0
schedule+0x3c/0xf0
schedule_preempt_disabled+0x1c/0x30
__mutex_lock.constprop.0+0x3ef/0x7a0
__mutex_lock_slowpath+0x13/0x20
mutex_lock+0x3c/0x50
mgmt_set_connectable_complete+0xa4/0x150 [bluetooth]
? kfree+0x211/0x2a0
hci_cmd_sync_dequeue+0xae/0x130 [bluetooth]
? __pfx_cmd_complete_rsp+0x10/0x10 [bluetooth]
cmd_complete_rsp+0x26/0x80 [bluetooth]
mgmt_pending_foreach+0x4d/0x70 [bluetooth]
__mgmt_power_off+0x8d/0x180 [bluetooth]
? _raw_spin_unlock_irq+0x23/0x40
hci_dev_close_sync+0x445/0x5b0 [bluetooth]
hci_set_powered_sync+0x149/0x250 [bluetooth]
set_powered_sync+0x24/0x60 [bluetooth]
hci_cmd_sync_work+0x90/0x150 [bluetooth]
process_one_work+0x13e/0x300
worker_thread+0x2f7/0x420
? __pfx_worker_thread+0x10/0x10
kthread+0x107/0x140
? __pfx_kthread+0x10/0x10
ret_from_fork+0x3d/0x60
? __pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1b/0x30
</TASK>
Tested-by: Kiran K <kiran.k@intel.com>
Fixes: f53e1c9 ("Bluetooth: MGMT: Fix possible crash on mgmt_index_removed")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Bastien Nocera <bnocera@redhat.com>1 parent 8d9f696 commit 67b3d90
1 file changed
+18
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1503 | 1503 | | |
1504 | 1504 | | |
1505 | 1505 | | |
1506 | | - | |
| 1506 | + | |
| 1507 | + | |
1507 | 1508 | | |
1508 | 1509 | | |
1509 | 1510 | | |
| |||
1677 | 1678 | | |
1678 | 1679 | | |
1679 | 1680 | | |
1680 | | - | |
| 1681 | + | |
| 1682 | + | |
1681 | 1683 | | |
1682 | 1684 | | |
1683 | 1685 | | |
| |||
1910 | 1912 | | |
1911 | 1913 | | |
1912 | 1914 | | |
1913 | | - | |
| 1915 | + | |
1914 | 1916 | | |
1915 | 1917 | | |
1916 | 1918 | | |
| |||
3756 | 3758 | | |
3757 | 3759 | | |
3758 | 3760 | | |
3759 | | - | |
| 3761 | + | |
| 3762 | + | |
3760 | 3763 | | |
3761 | 3764 | | |
3762 | 3765 | | |
| |||
3931 | 3934 | | |
3932 | 3935 | | |
3933 | 3936 | | |
3934 | | - | |
| 3937 | + | |
| 3938 | + | |
3935 | 3939 | | |
3936 | 3940 | | |
3937 | 3941 | | |
| |||
5822 | 5826 | | |
5823 | 5827 | | |
5824 | 5828 | | |
| 5829 | + | |
| 5830 | + | |
| 5831 | + | |
| 5832 | + | |
| 5833 | + | |
5825 | 5834 | | |
5826 | 5835 | | |
5827 | 5836 | | |
5828 | 5837 | | |
5829 | 5838 | | |
5830 | | - | |
5831 | | - | |
5832 | 5839 | | |
5833 | 5840 | | |
5834 | 5841 | | |
| |||
6061 | 6068 | | |
6062 | 6069 | | |
6063 | 6070 | | |
6064 | | - | |
| 6071 | + | |
| 6072 | + | |
6065 | 6073 | | |
6066 | 6074 | | |
6067 | 6075 | | |
| |||
8020 | 8028 | | |
8021 | 8029 | | |
8022 | 8030 | | |
8023 | | - | |
| 8031 | + | |
| 8032 | + | |
8024 | 8033 | | |
8025 | 8034 | | |
8026 | 8035 | | |
| |||
0 commit comments