linux/drivers/usb/misc
Aleksandr Nogikh 00e2071f6d usb: usbtest: disable dynamic ID support
The usbtest driver relies on the driver_info field of struct usb_device_id
to point to a valid struct usbtest_info descriptor. This structure contains
essential test configurations, such as endpoint addresses and test modes,
which are required during probe.

When a user dynamically adds a new device ID via the sysfs new_id
interface without specifying a reference device, the USB core initializes
driver_info to 0 (NULL). When a matching device is subsequently probed,
usbtest_probe() unconditionally casts driver_info to a struct usbtest_info
pointer and dereferences it, leading to a NULL pointer dereference crash:

  Oops: general protection fault, probably for non-canonical address
  0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
  KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
  RIP: 0010:usbtest_probe+0x3b9/0x1280 drivers/usb/misc/usbtest.c:2822

Because usbtest strictly requires pre-defined usbtest_info descriptors
to function, dynamic ID binding via sysfs is fundamentally unsupported
for this driver.

Fix this by setting .no_dynamic_id = 1 on usbtest_driver. This instructs
the USB core to skip creating the new_id and remove_id sysfs interfaces
for usbtest, preventing invalid dynamic ID entries from being created.

Cc: stable@vger.kernel.org
Reported-by: syzbot+7e1e5911f9eac50bedc7@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7e1e5911f9eac50bedc7
Signed-off-by: Aleksandr Nogikh <nogikh@google.com>
Tested-by: syzbot@syzkaller.appspotmail.com
Link: https://patch.msgid.link/20260806152651.2370795-1-nogikh@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-08-14 10:49:12 +09:00
..
sisusbvga Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
adutux.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
apple-mfi-fastcharge.c USB: apple-mfi-fastcharge: drop redundant device reference 2026-03-18 15:51:44 +01:00
appledisplay.c usb: misc: appledisplay: use HID includes 2026-03-30 16:47:26 +02:00
brcmstb-usb-pinmap.c usb: misc: brcmstb-usb-pinmap: fix module autoloading 2024-08-25 13:45:56 +02:00
chaoskey.c USB: chaoskey: Fix slab-use-after-free in chaoskey_release() 2026-07-08 16:29:16 +02:00
cypress_cy7c63.c usb: misc: cypress_cy7c63: check result of IO 2026-07-17 12:29:37 +02:00
cytherm.c USB: cytherm: drop redundant device reference 2026-03-11 15:14:35 +01:00
ehset.c usb: misc: ehset: fix wrong if condition 2023-07-27 10:37:30 +02:00
emi26.c
emi62.c
ezusb.c usb: misc: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:24 +02:00
idmouse.c USB: idmouse: fix use-after-free on disconnect race 2026-06-25 15:14:52 +01:00
iowarrior.c USB: iowarrior: fix use-after-free on disconnect race 2026-06-25 15:14:48 +01:00
isight_firmware.c usb: misc: add missing MODULE_DESCRIPTION() macros 2024-06-20 19:18:24 +02:00
Kconfig USB: qcom: Unify user-visible "Qualcomm" name 2026-04-27 10:18:01 -06:00
ldusb.c USB: ldusb: fix use-after-free on disconnect race 2026-06-25 15:14:57 +01:00
legousbtower.c USB: legousbtower: fix use-after-free on disconnect race 2026-06-25 15:15:03 +01:00
lvstest.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Makefile usb: misc: Add Intel USBIO bridge driver 2025-09-12 14:05:09 +02:00
onboard_usb_dev_pdevs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
onboard_usb_dev.c usb: misc: onboard_usb_hub: Add Genesys Logic GL3590 hub support 2026-04-27 05:14:17 -06:00
onboard_usb_dev.h usb: misc: onboard_usb_hub: Add Genesys Logic GL3590 hub support 2026-04-27 05:14:17 -06:00
qcom_eud.c usb: misc: qcom_eud: Access EUD_MODE_MANAGER2 through secure calls 2025-08-13 17:13:45 +02:00
trancevibrator.c USB: trancevibrator: drop redundant device reference 2026-03-11 15:14:35 +01:00
usb-ljca.c Merge 7.2-rc3 into usb-next 2026-07-13 07:09:28 +02:00
usb251xb.c usb: misc: Use named initializers for struct i2c_device_id 2026-05-21 16:52:34 +02:00
usb3503.c usb: misc: Use named initializers for struct i2c_device_id 2026-05-21 16:52:34 +02:00
usb4604.c usb: misc: Use named initializers for struct i2c_device_id 2026-05-21 16:52:34 +02:00
usbio.c usb: misc: usbio: check ibuf_len against rxbuf_len in bulk msg 2026-08-03 17:23:54 +02:00
usblcd.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
usbsevseg.c USB: usbsevseg: drop redundant device reference 2026-03-11 15:14:35 +01:00
usbtest.c usb: usbtest: disable dynamic ID support 2026-08-14 10:49:12 +09:00
uss720.c USB: misc: uss720: Fix leak in get_1284_register 2026-07-17 12:33:48 +02:00
yurex.c usb: yurex: fix race in probe 2026-02-23 20:25:07 +01:00