vhci_hcd: invalid port number 108 vhci_hcd: invalid port number 0 ================================================================== BUG: KASAN: slab-out-of-bounds in vhci_hub_control+0x1b6d/0x1be0 drivers/usb/usbip/vhci_hcd.c:441 Read of size 4 at addr ffff8801cd4737bc by task syz-executor3/12466 CPU: 0 PID: 12466 Comm: syz-executor3 Not tainted 4.19.0-rc8+ #65 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 vhci_hub_control+0x1b6d/0x1be0 drivers/usb/usbip/vhci_hcd.c:441 rh_call_control drivers/usb/core/hcd.c:679 [inline] rh_urb_enqueue drivers/usb/core/hcd.c:838 [inline] usb_hcd_submit_urb+0x17bb/0x20a0 drivers/usb/core/hcd.c:1651 usb_submit_urb+0x893/0x14e0 drivers/usb/core/urb.c:570 usb_start_wait_urb+0x13d/0x370 drivers/usb/core/message.c:57 usb_internal_control_msg drivers/usb/core/message.c:101 [inline] usb_control_msg+0x332/0x4e0 drivers/usb/core/message.c:152 proc_control+0x99b/0xef0 drivers/usb/core/devio.c:1106 usbdev_do_ioctl+0x1eb8/0x3b50 drivers/usb/core/devio.c:2412 usbdev_ioctl+0x25/0x30 drivers/usb/core/devio.c:2569 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0x1de/0x1720 fs/ioctl.c:685 ksys_ioctl+0xa9/0xd0 fs/ioctl.c:702 __do_sys_ioctl fs/ioctl.c:709 [inline] __se_sys_ioctl fs/ioctl.c:707 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:707 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457569 Code: fd b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9d20552c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457569 RDX: 0000000020000000 RSI: 00000000c0185500 RDI: 0000000000000003 RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9d205536d4 R13: 00000000004bf6ac R14: 00000000004cf598 R15: 00000000ffffffff Allocated by task 1: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:490 kmem_cache_alloc+0x12e/0x730 mm/slab.c:3554 kmem_cache_zalloc include/linux/slab.h:697 [inline] __kernfs_new_node+0x127/0x8d0 fs/kernfs/dir.c:634 kernfs_new_node+0x95/0x120 fs/kernfs/dir.c:695 __kernfs_create_file+0x5a/0x340 fs/kernfs/file.c:992 sysfs_add_file_mode_ns+0x222/0x530 fs/sysfs/file.c:306 sysfs_create_file_ns+0x1a3/0x270 fs/sysfs/file.c:331 sysfs_create_file include/linux/sysfs.h:513 [inline] device_create_file+0xf4/0x1e0 drivers/base/core.c:1381 device_add+0x416/0x17b0 drivers/base/core.c:1889 device_register+0x1d/0x20 drivers/base/core.c:1998 usb_hub_create_port_device+0x3a4/0xe00 drivers/usb/core/port.c:539 hub_configure drivers/usb/core/hub.c:1592 [inline] hub_probe+0x1e47/0x3080 drivers/usb/core/hub.c:1815 usb_probe_interface+0x3dd/0xb10 drivers/usb/core/driver.c:361 really_probe+0x5be/0x850 drivers/base/dd.c:500 driver_probe_device+0x108/0x210 drivers/base/dd.c:662 __device_attach_driver+0x25a/0x2d0 drivers/base/dd.c:758 bus_for_each_drv+0x16b/0x1f0 drivers/base/bus.c:461 __device_attach+0x2a1/0x430 drivers/base/dd.c:815 device_initial_probe+0x1a/0x20 drivers/base/dd.c:862 bus_probe_device+0x1fb/0x2a0 drivers/base/bus.c:521 device_add+0x93e/0x17b0 drivers/base/core.c:1927 usb_set_configuration+0xed0/0x19d0 drivers/usb/core/message.c:2015 generic_probe+0xb6/0x110 drivers/usb/core/generic.c:174 usb_probe_device+0xaf/0x110 drivers/usb/core/driver.c:266 really_probe+0x5be/0x850 drivers/base/dd.c:500 driver_probe_device+0x108/0x210 drivers/base/dd.c:662 __device_attach_driver+0x25a/0x2d0 drivers/base/dd.c:758 bus_for_each_drv+0x16b/0x1f0 drivers/base/bus.c:461 __device_attach+0x2a1/0x430 drivers/base/dd.c:815 device_initial_probe+0x1a/0x20 drivers/base/dd.c:862 bus_probe_device+0x1fb/0x2a0 drivers/base/bus.c:521 device_add+0x93e/0x17b0 drivers/base/core.c:1927 usb_new_device+0x9ec/0x1a40 drivers/usb/core/hub.c:2485 register_root_hub drivers/usb/core/hcd.c:1105 [inline] usb_add_hcd+0xb1f/0x1910 drivers/usb/core/hcd.c:2882 vhci_hcd_probe+0x174/0x240 drivers/usb/usbip/vhci_hcd.c:1330 platform_drv_probe+0x96/0x160 drivers/base/platform.c:579 really_probe+0x5be/0x850 drivers/base/dd.c:500 driver_probe_device+0x108/0x210 drivers/base/dd.c:662 __device_attach_driver+0x25a/0x2d0 drivers/base/dd.c:758 bus_for_each_drv+0x16b/0x1f0 drivers/base/bus.c:461 __device_attach+0x2a1/0x430 drivers/base/dd.c:815 device_initial_probe+0x1a/0x20 drivers/base/dd.c:862 bus_probe_device+0x1fb/0x2a0 drivers/base/bus.c:521 device_add+0x93e/0x17b0 drivers/base/core.c:1927 platform_device_add+0x36e/0x6f0 drivers/base/platform.c:417 vhci_hcd_init+0x386/0x4e0 drivers/usb/usbip/vhci_hcd.c:1500 do_one_initcall+0x145/0x957 init/main.c:885 do_initcall_level init/main.c:953 [inline] do_initcalls init/main.c:961 [inline] do_basic_setup init/main.c:979 [inline] kernel_init_freeable+0x4bb/0x5ae init/main.c:1144 kernel_init+0x11/0x1b2 init/main.c:1063 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8801cd473700 which belongs to the cache kernfs_node_cache of size 160 The buggy address is located 28 bytes to the right of 160-byte region [ffff8801cd473700, ffff8801cd4737a0) The buggy address belongs to the page: page:ffffea0007351cc0 count:1 mapcount:0 mapping:ffff8801da972480 index:0xffff8801cd473fee flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea0007351c88 ffffea0007351d88 ffff8801da972480 raw: ffff8801cd473fee ffff8801cd473000 0000000100000012 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801cd473680: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8801cd473700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8801cd473780: 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 ^ ffff8801cd473800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801cd473880: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ==================================================================