]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: btsdio: fix use after free bug in btsdio_remove due to unfinished work
authorZheng Wang <zyytlz.wz@163.com>
Thu, 9 Mar 2023 08:07:39 +0000 (16:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Apr 2023 09:16:38 +0000 (11:16 +0200)
commit8cc600746c7d188bb3995221f8c175b7d750af7f
tree65f9f53de3dd674556de9162a8af6b3183b427f5
parente063d149952e4b6632efb7289ef073008663078c
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: d129a62d7d1d ("[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>
drivers/bluetooth/btsdio.c