]> git.dujemihanovic.xyz Git - linux.git/commit
Bluetooth: MGMT: Fix possible crash on mgmt_index_removed
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 12 Sep 2024 16:34:42 +0000 (12:34 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 27 Sep 2024 14:52:18 +0000 (10:52 -0400)
commitf53e1c9c726d83092167f2226f32bd3b73f26c21
tree9209e979d84089ba1751cb3e3e6996b6973db5b5
parentd505d3593b52b6c43507f119572409087416ba28
Bluetooth: MGMT: Fix possible crash on mgmt_index_removed

If mgmt_index_removed is called while there are commands queued on
cmd_sync it could lead to crashes like the bellow trace:

0x0000053D: __list_del_entry_valid_or_report+0x98/0xdc
0x0000053D: mgmt_pending_remove+0x18/0x58 [bluetooth]
0x0000053E: mgmt_remove_adv_monitor_complete+0x80/0x108 [bluetooth]
0x0000053E: hci_cmd_sync_work+0xbc/0x164 [bluetooth]

So while handling mgmt_index_removed this attempts to dequeue
commands passed as user_data to cmd_sync.

Fixes: 7cf5c2978f23 ("Bluetooth: hci_sync: Refactor remove Adv Monitor")
Reported-by: jiaymao <quic_jiaymao@quicinc.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/mgmt.c