usb 1-1: USB disconnect, device number 2 ================================================================== BUG: KASAN: use-after-free in hdm_disconnect+0xf8/0x190 drivers/most/most_usb.c:1125 Read of size 8 at addr ffff0000cbadd978 by task kworker/1:14/4114 CPU: 1 PID: 4114 Comm: kworker/1:14 Not tainted 5.15.167-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: usb_hub_wq hub_event Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x174/0x1e4 mm/kasan/report.c:451 __asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309 hdm_disconnect+0xf8/0x190 drivers/most/most_usb.c:1125 usb_unbind_interface+0x1a4/0x758 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1229 [inline] device_release_driver_internal+0x464/0x6ac drivers/base/dd.c:1262 device_release_driver+0x28/0x38 drivers/base/dd.c:1285 bus_remove_device+0x298/0x38c drivers/base/bus.c:529 device_del+0x57c/0x9b4 drivers/base/core.c:3603 usb_disable_device+0x354/0x760 drivers/usb/core/message.c:1414 usb_disconnect+0x290/0x7e8 drivers/usb/core/hub.c:2248 hub_port_connect drivers/usb/core/hub.c:5299 [inline] hub_port_connect_change drivers/usb/core/hub.c:5595 [inline] port_event drivers/usb/core/hub.c:5741 [inline] hub_event+0x1718/0x46b8 drivers/usb/core/hub.c:5823 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Allocated by task 4101: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xbc/0xfc mm/kasan/common.c:513 __kasan_kmalloc+0x10/0x1c mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] kmem_cache_alloc_trace+0x27c/0x47c mm/slub.c:3247 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] hdm_probe+0xa4/0x1044 drivers/most/most_usb.c:959 usb_probe_interface+0x500/0x984 drivers/usb/core/driver.c:396 really_probe+0x26c/0xaec drivers/base/dd.c:595 __driver_probe_device+0x194/0x3b4 drivers/base/dd.c:755 driver_probe_device+0x78/0x34c drivers/base/dd.c:785 __device_attach_driver+0x28c/0x4d8 drivers/base/dd.c:907 bus_for_each_drv+0x158/0x1e0 drivers/base/bus.c:427 __device_attach+0x2f0/0x480 drivers/base/dd.c:979 device_initial_probe+0x24/0x34 drivers/base/dd.c:1028 bus_probe_device+0xbc/0x1c8 drivers/base/bus.c:487 device_add+0xae0/0xef4 drivers/base/core.c:3415 usb_set_configuration+0x15e0/0x1b60 drivers/usb/core/message.c:2165 usb_generic_driver_probe+0x8c/0x148 drivers/usb/core/generic.c:238 usb_probe_device+0x120/0x25c drivers/usb/core/driver.c:293 really_probe+0x26c/0xaec drivers/base/dd.c:595 __driver_probe_device+0x194/0x3b4 drivers/base/dd.c:755 driver_probe_device+0x78/0x34c drivers/base/dd.c:785 __device_attach_driver+0x28c/0x4d8 drivers/base/dd.c:907 bus_for_each_drv+0x158/0x1e0 drivers/base/bus.c:427 __device_attach+0x2f0/0x480 drivers/base/dd.c:979 device_initial_probe+0x24/0x34 drivers/base/dd.c:1028 bus_probe_device+0xbc/0x1c8 drivers/base/bus.c:487 device_add+0xae0/0xef4 drivers/base/core.c:3415 usb_new_device+0x900/0x145c drivers/usb/core/hub.c:2593 hub_port_connect drivers/usb/core/hub.c:5455 [inline] hub_port_connect_change drivers/usb/core/hub.c:5595 [inline] port_event drivers/usb/core/hub.c:5741 [inline] hub_event+0x236c/0x46b8 drivers/usb/core/hub.c:5823 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Freed by task 4114: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0x178/0x410 mm/slub.c:4559 release_mdev+0x20/0x30 drivers/most/most_usb.c:932 device_release+0x8c/0x1ac kobject_cleanup lib/kobject.c:713 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x2c4/0x438 lib/kobject.c:761 put_device drivers/base/core.c:3523 [inline] device_unregister+0x3c/0xcc drivers/base/core.c:3637 most_deregister_interface+0x3e0/0x42c drivers/most/core.c:1402 hdm_disconnect+0xe0/0x190 drivers/most/most_usb.c:1123 usb_unbind_interface+0x1a4/0x758 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1229 [inline] device_release_driver_internal+0x464/0x6ac drivers/base/dd.c:1262 device_release_driver+0x28/0x38 drivers/base/dd.c:1285 bus_remove_device+0x298/0x38c drivers/base/bus.c:529 device_del+0x57c/0x9b4 drivers/base/core.c:3603 usb_disable_device+0x354/0x760 drivers/usb/core/message.c:1414 usb_disconnect+0x290/0x7e8 drivers/usb/core/hub.c:2248 hub_port_connect drivers/usb/core/hub.c:5299 [inline] hub_port_connect_change drivers/usb/core/hub.c:5595 [inline] port_event drivers/usb/core/hub.c:5741 [inline] hub_event+0x1718/0x46b8 drivers/usb/core/hub.c:5823 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 The buggy address belongs to the object at ffff0000cbadc000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 6520 bytes inside of 8192-byte region [ffff0000cbadc000, ffff0000cbade000) The buggy address belongs to the page: page:00000000ccaa4ea8 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10bad8 head:00000000ccaa4ea8 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c0002c00 raw: 0000000000000000 0000000080020002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000cbadd800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cbadd880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000cbadd900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000cbadd980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000cbadda00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 1 PID: 4114 at lib/refcount.c:28 refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 Modules linked in: CPU: 1 PID: 4114 Comm: kworker/1:14 Tainted: G B 5.15.167-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Workqueue: usb_hub_wq hub_event pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 lr : refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 sp : ffff8000202f72f0 x29: ffff8000202f72f0 x28: ffff800016a0e140 x27: ffff0000cbba0000 x26: 1fffe00019517607 x25: dfff800000000000 x24: ffff0000ca8ba030 x23: 1fffe0001975b8bb x22: ffff0000ca8bb03c x21: 0000000000000003 x20: ffff0000ca8bb038 x19: ffff800016f0c000 x18: 1fffe00036835d8e x17: 1fffe00036835d8e x16: ffff800011ac23e0 x15: ffff800014b5ef40 x14: ffff0001b41aec80 x13: ffff0001b41aec7c x12: 0000000000000001 x11: 0000000000000000 x10: 0000000000000000 x9 : 40b944bd365bc800 x8 : 40b944bd365bc800 x7 : 0000000000000000 x6 : ffff80000826acb8 x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff80000a987d1c x2 : ffff0001b41aed10 x1 : 0000000100000000 x0 : 0000000000000026 Call trace: refcount_warn_saturate+0x1c8/0x20c lib/refcount.c:28 __refcount_sub_and_test include/linux/refcount.h:283 [inline] __refcount_dec_and_test include/linux/refcount.h:315 [inline] refcount_dec_and_test include/linux/refcount.h:333 [inline] kref_put include/linux/kref.h:64 [inline] kobject_put+0x1a8/0x438 lib/kobject.c:761 put_device+0x28/0x40 drivers/base/core.c:3523 hdm_disconnect+0x170/0x190 drivers/most/most_usb.c:1129 usb_unbind_interface+0x1a4/0x758 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1229 [inline] device_release_driver_internal+0x464/0x6ac drivers/base/dd.c:1262 device_release_driver+0x28/0x38 drivers/base/dd.c:1285 bus_remove_device+0x298/0x38c drivers/base/bus.c:529 device_del+0x57c/0x9b4 drivers/base/core.c:3603 usb_disable_device+0x354/0x760 drivers/usb/core/message.c:1414 usb_disconnect+0x290/0x7e8 drivers/usb/core/hub.c:2248 hub_port_connect drivers/usb/core/hub.c:5299 [inline] hub_port_connect_change drivers/usb/core/hub.c:5595 [inline] port_event drivers/usb/core/hub.c:5741 [inline] hub_event+0x1718/0x46b8 drivers/usb/core/hub.c:5823 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310 worker_thread+0x910/0x1034 kernel/workqueue.c:2457 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 irq event stamp: 73570 hardirqs last enabled at (73569): [] kasan_quarantine_put+0xdc/0x204 mm/kasan/quarantine.c:231 hardirqs last disabled at (73570): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (73570): [] _raw_spin_lock_irqsave+0xfc/0x14c kernel/locking/spinlock.c:162 softirqs last enabled at (73328): [] softirq_handle_end kernel/softirq.c:401 [inline] softirqs last enabled at (73328): [] handle_softirqs+0xb88/0xdbc kernel/softirq.c:586 softirqs last disabled at (73303): [] __do_softirq kernel/softirq.c:592 [inline] softirqs last disabled at (73303): [] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline] softirqs last disabled at (73303): [] invoke_softirq kernel/softirq.c:439 [inline] softirqs last disabled at (73303): [] __irq_exit_rcu+0x268/0x4d8 kernel/softirq.c:641 ---[ end trace c8433f9930f7a767 ]--- usb 1-1: new high-speed USB device number 3 using dummy_hcd usb 1-1: Using ep0 maxpacket: 32 usb 1-1: config 0 has an invalid interface number: 237 but max is 0 usb 1-1: config 0 has no interface number 0 usb 1-1: New USB device found, idVendor=0424, idProduct=cf19, bcdDevice=55.89 usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 1-1: Product: syz usb 1-1: Manufacturer: syz usb 1-1: SerialNumber: syz usb 1-1: config 0 descriptor??