Re: [syzbot] [usb?] general protection fault in status_show

From: Hillf Danton
Date: Thu Jan 23 2025 - 06:32:10 EST


On Thu, 16 Jan 2025 22:14:23 -0800
> syzbot found the following issue on:
>
> HEAD commit: be548645527a Merge tag 'for-linus' of git://git.kernel.org..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12d51cb0580000

#syz test

--- x/drivers/usb/usbip/vhci_sysfs.c
+++ y/drivers/usb/usbip/vhci_sysfs.c
@@ -76,6 +76,8 @@ static ssize_t status_show_vhci(int pdev
}

hcd = platform_get_drvdata(pdev);
+ if (!usb_hcd_is_primary_hcd(hcd))
+ return 0;
vhci_hcd = hcd_to_vhci_hcd(hcd);
vhci = vhci_hcd->vhci;

--