Re: [syzbot] [usb?] KASAN: slab-out-of-bounds Read in mon_copy_to_buff

Alan Stern
2025-07-09T17:53:02Z

Test patch to see the contents of the report descriptor.

Alan Stern

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ d7b8f8e20813

Index: usb-devel/drivers/hid/usbhid/hid-core.c
===================================================================
--- usb-devel.orig/drivers/hid/usbhid/hid-core.c
+++ usb-devel/drivers/hid/usbhid/hid-core.c
@@ -1043,6 +1043,10 @@ static int usbhid_parse(struct hid_devic
goto err;
}

+ dev_info(&intf->dev, "Report descriptor:\n");
+ print_hex_dump(KERN_INFO, " * ", DUMP_PREFIX_NONE, 16, 1,
+ rdesc, rsize, false);
+
ret = hid_parse_report(hid, rdesc, rsize);
kfree(rdesc);
if (ret) {