Re: [PATCH] usbip: usbip_host: Fix null pointer dereference in rebind_store

Jeffin Philip <[email protected]> Thu, 6 Aug 2026 10:57:26 +0530
Newsgroups org.kernel.vger.linux-usb,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <[email protected]>
On 06 Aug 2026, 05:17 UTC, Jeffin Philip wrote:

>rebind_store calls do_rebind which dereferences udev without
>checking if it is NULL. If busid is registered using match_busid
>but the device is not present in the first place, it triggers a
>null pointer dereference when we attempt to rebind the device.
>Fix this by checking explicitly for udev first and returning
>-ENODEV if udev is NULL.

Reproduce the issue using:
echo "add 1-1" > /sys/bus/usb/drivers/usbip-host/match_busid
echo "1-1" > /sys/bus/usb/drivers/usbip-host/rebind

Thanks,
Jeffin