Skip to content

Commit 1e9ac11

Browse files
bluesheep1337Vudentz
authored andcommitted
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: ddbaf13 ("[Bluetooth] Add generic driver for Bluetooth SDIO devices") Signed-off-by: Zheng Wang <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 9aa9d94 commit 1e9ac11

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/bluetooth/btsdio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ static void btsdio_remove(struct sdio_func *func)
354354

355355
BT_DBG("func %p", func);
356356

357+
cancel_work_sync(&data->work);
357358
if (!data)
358359
return;
359360

0 commit comments

Comments
 (0)