]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 10 Nov 2025 21:07:01 +0000 (16:07 -0500)
commit23d22f2f71768034d6ef86168213843fc49bf550
treeae260f21f88eb7b524d67fe51dc2f18b9a3d0306
parent55fb52ffdd62850d667ebed842815e072d3c9961
Bluetooth: btusb: reorder cleanup in btusb_disconnect to avoid UAF

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>
drivers/bluetooth/btusb.c