]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: btusb: reorder cleanup in btusb_disconnect to avoid UAF
authorRaphael Pinsonneault-Thibeault <rpthibeault@gmail.com>
Wed, 5 Nov 2025 19:28:41 +0000 (14:28 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Dec 2025 11:45:16 +0000 (12:45 +0100)
commit297dbf87989e09af98f81f2bcb938041785557e8
tree86ea979231b4f450c2e5dd08f5e805c80653c88b
parente78b093badf96398165304ccaa7c1b03cd812b58
Bluetooth: btusb: reorder cleanup in btusb_disconnect to avoid UAF

[ Upstream commit 23d22f2f71768034d6ef86168213843fc49bf550 ]

There is a KASAN: slab-use-after-free read in btusb_disconnect().
Calling "usb_driver_release_interface(&btusb_driver, data->intf)" will
free the btusb data associated with the interface. The same data is
then used later in the function, hence the UAF.

Fix by moving the accesses to btusb data to before the data is free'd.

Reported-by: syzbot+2fc81b50a4f8263a159b@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2fc81b50a4f8263a159b
Tested-by: syzbot+2fc81b50a4f8263a159b@syzkaller.appspotmail.com
Fixes: fd913ef7ce619 ("Bluetooth: btusb: Add out-of-band wakeup support")
Signed-off-by: Raphael Pinsonneault-Thibeault <rpthibeault@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/bluetooth/btusb.c