[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230309080739.3714610-1-zyytlz.wz@163.com>
Date: Thu, 9 Mar 2023 16:07:39 +0800
From: Zheng Wang <zyytlz.wz@....com>
To: marcel@...tmann.org
Cc: johan.hedberg@...il.com, luiz.dentz@...il.com,
linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
hackerzheng666@...il.com, 1395428693sheep@...il.com,
alex000young@...il.com, Zheng Wang <zyytlz.wz@....com>
Subject: [PATCH] Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work
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@....com>
---
drivers/bluetooth/btsdio.c | 1 +
1 file changed, 1 insertion(+)
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;
--
2.25.1
Powered by blists - more mailing lists