summaryrefslogtreecommitdiff
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorZheng Wang <zyytlz.wz@163.com>2023-03-09 16:07:39 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-30 12:51:23 +0200
commitc59c65a14e8f7d738429648833f3bb3f9df0513f (patch)
tree83f85c1be74c561692d80a27f9492b8eb5c008d4 /drivers/bluetooth
parent81a27397cd2a99b36afa9f812261efa5f3cae951 (diff)
Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work
[ Upstream commit 1e9ac114c4428fdb7ff4635b45d4f46017e8916f ] In btsdio_probe, &data->work was bound with btsdio_work.In btsdio_send_frame, it was started by schedule_work. If we call btsdio_remove with an unfinished job, there may be a race condition and cause UAF bug on hdev. Fixes: ddbaf13e3609 ("[Bluetooth] Add generic driver for Bluetooth SDIO devices") Signed-off-by: Zheng Wang <zyytlz.wz@163.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/btsdio.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
index 795be33f2892..02893600db39 100644
--- a/drivers/bluetooth/btsdio.c
+++ b/drivers/bluetooth/btsdio.c
@@ -354,6 +354,7 @@ static void btsdio_remove(struct sdio_func *func)
BT_DBG("func %p", func);
+ cancel_work_sync(&data->work);
if (!data)
return;