usb: slab-use-after-free Read in hdm_disconnect
PATCH 1/1 usb: slab-use-after-free Read in hdm_disconnect
#syz test
All references on the device were lost when deregistering the interface. To make sure the device is not released before freeing all the memory we add get_device to increase the ref count by one.
Reported-by [email protected]
Signed-off-by Camila Alvarez <[email protected]>
--- drivers/most/most_usb.c | 1 + 1 file changed, 1 insertion(+)
drivers/most/most_usb.c +1 -0
@@ -1120,6 +1120,7 @@ static void hdm_disconnect(struct usb_interface *interface)if (mdev->dci)device_unregister (&mdev->dci->dev); +get_device (&mdev->dev);most_deregister_interface (&mdev->iface);kfree (mdev->busy_urbs);
Signature · 1 line
2.34.1
Re: [syzbot] [usb?] KASAN: slab-use-after-free Read in hdm_disconnect
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Hello,
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Reported-by [email protected]
Tested-by [email protected]
Tested on:
commit: 1722389b Merge tag 'net-6.11-rc1' of git://git.kernel... git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing console output: https://syzkaller.appspot.com/x/log.txt?x=163ffdb1980000 kernel config: https://syzkaller.appspot.com/x/.config?x=e3044dca4d5f6dbe dashboard link: https://syzkaller.appspot.com/bug?extid=916742d5d24f6c254761 compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40 patch: https://syzkaller.appspot.com/x/patch.diff?x=1057af03980000
Note: testing is done by a robot and is best-effort only.