vhci_hcd: stop threads
vhci_hcd: release socket
==================================================================
BUG: KASAN: use-after-free in vdev_to_vhci_hcd drivers/usb/usbip/vhci.h:171 [inline]
BUG: KASAN: use-after-free in vhci_cleanup_unlink_list+0x44d/0x460 drivers/usb/usbip/vhci_hcd.c:981
Read of size 4 at addr ffff888145be8418 by task kworker/u4:9/4496
CPU: 0 PID: 4496 Comm: kworker/u4:9 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Workqueue: usbip_event event_handler
Call Trace:
dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:420
kasan_report+0x10b/0x140 mm/kasan/report.c:524
vdev_to_vhci_hcd drivers/usb/usbip/vhci.h:171 [inline]
vhci_cleanup_unlink_list+0x44d/0x460 drivers/usb/usbip/vhci_hcd.c:981
vhci_device_unlink_cleanup drivers/usb/usbip/vhci_hcd.c:1024 [inline]
vhci_shutdown_connection+0x2a0/0x580 drivers/usb/usbip/vhci_hcd.c:1064
event_handler+0x299/0x460 drivers/usb/usbip/usbip_event.c:79
process_one_work+0x8ab/0x1160 kernel/workqueue.c:2292
worker_thread+0xaf5/0x12a0 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Allocated by task 1:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
____kasan_kmalloc mm/kasan/common.c:375 [inline]
__kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:384
kasan_kmalloc include/linux/kasan.h:211 [inline]
__do_kmalloc_node mm/slab_common.c:936 [inline]
__kmalloc+0xb3/0x240 mm/slab_common.c:949
kmalloc include/linux/slab.h:568 [inline]
kzalloc include/linux/slab.h:699 [inline]
__usb_create_hcd+0x5f/0x830 drivers/usb/core/hcd.c:2581
vhci_hcd_probe+0xff/0x370 drivers/usb/usbip/vhci_hcd.c:1376
platform_probe+0x137/0x1c0 drivers/base/platform.c:1400
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x24a/0xb40 drivers/base/dd.c:638
__driver_probe_device+0x1f5/0x390 drivers/base/dd.c:804
driver_probe_device+0x4f/0x420 drivers/base/dd.c:834
__device_attach_driver+0x2c6/0x510 drivers/base/dd.c:962
bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429
__device_attach+0x2a7/0x480 drivers/base/dd.c:1034
bus_probe_device+0xba/0x1d0 drivers/base/bus.c:489
device_add+0xbcf/0x1050 drivers/base/core.c:3712
platform_device_add+0x4bf/0x830 drivers/base/platform.c:717
vhci_hcd_init+0x3c7/0x4f1 drivers/usb/usbip/vhci_hcd.c:1571
do_one_initcall+0x257/0x800 init/main.c:1309
do_initcall_level+0x13d/0x1ed init/main.c:1382
do_initcalls+0x4b/0x8a init/main.c:1398
kernel_init_freeable+0x401/0x5ab init/main.c:1637
kernel_init+0x19/0x1b0 init/main.c:1525
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Freed by task 4508:
kasan_save_stack mm/kasan/common.c:46 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:53
kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1f0 mm/kasan/common.c:237
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1729 [inline]
slab_free_freelist_hook+0x133/0x1b0 mm/slub.c:1755
slab_free mm/slub.c:3687 [inline]
__kmem_cache_free+0xb6/0x200 mm/slub.c:3700
vhci_hcd_remove+0xe0/0x100 drivers/usb/usbip/vhci_hcd.c:1434
platform_remove+0x92/0xe0 drivers/base/platform.c:1422
device_remove drivers/base/dd.c:547 [inline]
__device_release_driver drivers/base/dd.c:1279 [inline]
device_release_driver_internal+0x47d/0x7c0 drivers/base/dd.c:1305
unbind_store+0x2e2/0x300 drivers/base/bus.c:193
kernfs_fop_write_iter+0x3a0/0x520 fs/kernfs/file.c:352
call_write_iter include/linux/fs.h:2265 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x482/0x9a0 fs/read_write.c:584
ksys_write+0x14d/0x260 fs/read_write.c:637
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
The buggy address belongs to the object at ffff888145be8000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 1048 bytes inside of
8192-byte region [ffff888145be8000, ffff888145bea000)
The buggy address belongs to the physical page:
page:ffffea000516fa00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x145be8
head:ffffea000516fa00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x57ff00000010200(slab|head|node=1|zone=2|lastcpupid=0x7ff)
raw: 057ff00000010200 0000000000000000 dead000000000122 ffff888017442280
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, tgid 1 (swapper/0), ts 13718794636, free_ts 0
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2560
prep_new_page mm/page_alloc.c:2567 [inline]
get_page_from_freelist+0x206b/0x2180 mm/page_alloc.c:4358
__alloc_pages+0x1ec/0x4f0 mm/page_alloc.c:5658
alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2115
alloc_slab_page+0x5d/0x180 mm/slub.c:1799
allocate_slab mm/slub.c:1944 [inline]
new_slab+0x87/0x2d0 mm/slub.c:1997
___slab_alloc+0xbc5/0x1240 mm/slub.c:3154
__slab_alloc mm/slub.c:3240 [inline]
slab_alloc_node mm/slub.c:3325 [inline]
__kmem_cache_alloc_node+0x126/0x270 mm/slub.c:3398
__do_kmalloc_node mm/slab_common.c:935 [inline]
__kmalloc+0xa3/0x240 mm/slab_common.c:949
kmalloc include/linux/slab.h:568 [inline]
kzalloc include/linux/slab.h:699 [inline]
__usb_create_hcd+0x5f/0x830 drivers/usb/core/hcd.c:2581
vhci_hcd_probe+0xff/0x370 drivers/usb/usbip/vhci_hcd.c:1376
platform_probe+0x137/0x1c0 drivers/base/platform.c:1400
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x24a/0xb40 drivers/base/dd.c:638
__driver_probe_device+0x1f5/0x390 drivers/base/dd.c:804
driver_probe_device+0x4f/0x420 drivers/base/dd.c:834
__device_attach_driver+0x2c6/0x510 drivers/base/dd.c:962
page_owner free stack trace missing
Memory state around the buggy address:
ffff888145be8300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888145be8380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888145be8400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888145be8480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888145be8500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
check_panic_on_warn+0x80/0xa0 kernel/panic.c:235
end_report+0x66/0x110 mm/kasan/report.c:200
kasan_report+0x118/0x140 mm/kasan/report.c:526
vdev_to_vhci_hcd drivers/usb/usbip/vhci.h:171 [inline]
vhci_cleanup_unlink_list+0x44d/0x460 drivers/usb/usbip/vhci_hcd.c:981
vhci_device_unlink_cleanup drivers/usb/usbip/vhci_hcd.c:1024 [inline]
vhci_shutdown_connection+0x2a0/0x580 drivers/usb/usbip/vhci_hcd.c:1064
event_handler+0x299/0x460 drivers/usb/usbip/usbip_event.c:79
process_one_work+0x8ab/0x1160 kernel/workqueue.c:2292
worker_thread+0xaf5/0x12a0 kernel/workqueue.c:2439
kthread+0x29d/0x330 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
Kernel Offset: disabled
Rebooting in 86400 seconds..