vhci_hcd: invalid port number 158 ================================================================== BUG: KASAN: slab-out-of-bounds in vhci_hub_control+0x1b88/0x1bf0 drivers/usb/usbip/vhci_hcd.c:441 Read of size 4 at addr ffff8801ce6288fc by task syz-executor4/10109 CPU: 1 PID: 10109 Comm: syz-executor4 Not tainted 4.19.0-rc1+ #217 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+0x1c9/0x2b4 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x30d mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 vhci_hub_control+0x1b88/0x1bf0 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+0x184a/0x2160 drivers/usb/core/hcd.c:1651 usb_submit_urb+0x895/0x14d0 drivers/usb/core/urb.c:570 usb_start_wait_urb+0x140/0x360 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+0x1eb4/0x3b30 drivers/usb/core/devio.c:2394 usbdev_ioctl+0x25/0x30 drivers/usb/core/devio.c:2551 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:0x457099 Code: fd b4 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 b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f803d01cc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f803d01d6d4 RCX: 0000000000457099 RDX: 0000000020000140 RSI: 00000000c0185500 RDI: 0000000000000004 RBP: 00000000009300a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000004ce8f0 R14: 00000000004c4e0b R15: 0000000000000000 Allocated by task 4688: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 __do_kmalloc mm/slab.c:3718 [inline] __kmalloc_track_caller+0x14a/0x720 mm/slab.c:3733 kmemdup+0x24/0x50 mm/util.c:118 kmemdup include/linux/string.h:418 [inline] neigh_parms_alloc+0xea/0x6b0 net/core/neighbour.c:1492 inetdev_init+0x1ad/0x590 net/ipv4/devinet.c:254 inetdev_event+0xf45/0x1370 net/ipv4/devinet.c:1468 notifier_call_chain+0x180/0x390 kernel/notifier.c:93 __raw_notifier_call_chain kernel/notifier.c:394 [inline] raw_notifier_call_chain+0x2d/0x40 kernel/notifier.c:401 call_netdevice_notifiers_info+0x3f/0x90 net/core/dev.c:1734 call_netdevice_notifiers net/core/dev.c:1752 [inline] register_netdevice+0xb9d/0x1100 net/core/dev.c:8509 register_netdev+0x30/0x50 net/core/dev.c:8595 ip6_tnl_init_net+0x6b3/0xa70 net/ipv6/ip6_tunnel.c:2237 ops_init+0x101/0x560 net/core/net_namespace.c:129 setup_net+0x3d9/0x980 net/core/net_namespace.c:314 copy_net_ns+0x2b8/0x4d0 net/core/net_namespace.c:437 create_new_namespaces+0x6ad/0x900 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xc3/0x1f0 kernel/nsproxy.c:206 ksys_unshare+0x723/0xfb0 kernel/fork.c:2490 __do_sys_unshare kernel/fork.c:2558 [inline] __se_sys_unshare kernel/fork.c:2556 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2556 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 1: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xd9/0x210 mm/slab.c:3813 urb_destroy drivers/usb/core/urb.c:26 [inline] kref_put include/linux/kref.h:70 [inline] usb_free_urb.part.8+0x88/0xd0 drivers/usb/core/urb.c:96 usb_free_urb+0x1f/0x30 drivers/usb/core/urb.c:95 usb_start_wait_urb+0x250/0x360 drivers/usb/core/message.c:79 usb_internal_control_msg drivers/usb/core/message.c:101 [inline] usb_control_msg+0x332/0x4e0 drivers/usb/core/message.c:152 set_port_feature+0x6e/0x90 drivers/usb/core/hub.c:425 hub_power_on+0xc9/0x230 drivers/usb/core/hub.c:885 hub_activate+0x119f/0x1990 drivers/usb/core/hub.c:1040 hub_configure drivers/usb/core/hub.c:1624 [inline] hub_probe+0x20dc/0x3090 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+0xede/0x19f0 drivers/usb/core/message.c:2004 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+0x8ac/0x12b0 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+0xfb/0x240 drivers/usb/usbip/vhci_hcd.c:1316 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+0x127/0x838 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/0x1b3 init/main.c:1063 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:413 The buggy address belongs to the object at ffff8801ce628800 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 60 bytes to the right of 192-byte region [ffff8801ce628800, ffff8801ce6288c0) The buggy address belongs to the page: page:ffffea0007398a00 count:1 mapcount:0 mapping:ffff8801dac00040 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea0007394008 ffffea0007398e48 ffff8801dac00040 raw: 0000000000000000 ffff8801ce628000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ce628780: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801ce628800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8801ce628880: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8801ce628900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801ce628980: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================