usb 1-1: SerialNumber: syz usb 1-1: config 0 descriptor?? usb 1-1: USB disconnect, device number 47 ================================================================== BUG: KASAN: slab-use-after-free in hdm_disconnect+0x1bc/0x1e0 drivers/most/most_usb.c:1125 Read of size 8 at addr ffff0000136e98b0 by task kworker/0:2/968 CPU: 0 UID: 0 PID: 968 Comm: kworker/0:2 Not tainted syzkaller #0 PREEMPT Hardware name: linux,dummy-virt (DT) Workqueue: usb_hub_wq hub_event Call trace: show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:499 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xa4/0xf4 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xf4/0x5a0 mm/kasan/report.c:482 kasan_report+0xc8/0x108 mm/kasan/report.c:595 __asan_report_load8_noabort+0x20/0x2c mm/kasan/report_generic.c:381 hdm_disconnect+0x1bc/0x1e0 drivers/most/most_usb.c:1125 usb_unbind_interface+0x168/0x71c drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:571 [inline] device_remove+0x100/0x14c drivers/base/dd.c:563 __device_release_driver drivers/base/dd.c:1274 [inline] device_release_driver_internal+0x310/0x47c drivers/base/dd.c:1297 device_release_driver+0x18/0x24 drivers/base/dd.c:1320 bus_remove_device+0x1a4/0x348 drivers/base/bus.c:579 device_del+0x2d0/0x7b4 drivers/base/core.c:3878 usb_disable_device+0x240/0x5ac drivers/usb/core/message.c:1418 usb_disconnect+0x22c/0x7ec drivers/usb/core/hub.c:2344 hub_port_connect drivers/usb/core/hub.c:5406 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5870 [inline] hub_event+0x10a4/0x365c drivers/usb/core/hub.c:5952 process_one_work+0x7cc/0x18d4 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x734/0xb84 kernel/workqueue.c:3427 kthread+0x348/0x5fc kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Allocated by task 968: kasan_save_stack+0x3c/0x64 mm/kasan/common.c:56 kasan_save_track+0x20/0x3c mm/kasan/common.c:77 kasan_save_alloc_info+0x40/0x54 mm/kasan/generic.c:573 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0xb8/0xbc mm/kasan/common.c:417 kasan_kmalloc include/linux/kasan.h:262 [inline] __kmalloc_cache_noprof+0x2b8/0x6f8 mm/slub.c:5724 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] hdm_probe+0x94/0x13a0 drivers/most/most_usb.c:959 usb_probe_interface+0x230/0x8e4 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:581 [inline] really_probe+0x180/0x7d8 drivers/base/dd.c:659 __driver_probe_device+0x15c/0x364 drivers/base/dd.c:801 driver_probe_device+0x5c/0x16c drivers/base/dd.c:831 __device_attach_driver+0x16c/0x270 drivers/base/dd.c:959 bus_for_each_drv+0x104/0x18c drivers/base/bus.c:462 __device_attach+0x168/0x35c drivers/base/dd.c:1031 device_initial_probe+0x14/0x20 drivers/base/dd.c:1080 bus_probe_device+0x124/0x15c drivers/base/bus.c:537 device_add+0xc30/0x12cc drivers/base/core.c:3689 usb_set_configuration+0xbb8/0x15b8 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:250 usb_probe_device+0xa4/0x2f4 drivers/usb/core/driver.c:291 call_driver_probe drivers/base/dd.c:581 [inline] really_probe+0x180/0x7d8 drivers/base/dd.c:659 __driver_probe_device+0x15c/0x364 drivers/base/dd.c:801 driver_probe_device+0x5c/0x16c drivers/base/dd.c:831 __device_attach_driver+0x16c/0x270 drivers/base/dd.c:959 bus_for_each_drv+0x104/0x18c drivers/base/bus.c:462 __device_attach+0x168/0x35c drivers/base/dd.c:1031 device_initial_probe+0x14/0x20 drivers/base/dd.c:1080 bus_probe_device+0x124/0x15c drivers/base/bus.c:537 device_add+0xc30/0x12cc drivers/base/core.c:3689 usb_new_device+0x778/0x16cc drivers/usb/core/hub.c:2694 hub_port_connect drivers/usb/core/hub.c:5566 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5870 [inline] hub_event+0x1d70/0x365c drivers/usb/core/hub.c:5952 process_one_work+0x7cc/0x18d4 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x734/0xb84 kernel/workqueue.c:3427 kthread+0x348/0x5fc kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 Freed by task 968: kasan_save_stack+0x3c/0x64 mm/kasan/common.c:56 kasan_save_track+0x20/0x3c mm/kasan/common.c:77 __kasan_save_free_info+0x4c/0x74 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x60/0x8c mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2514 [inline] slab_free mm/slub.c:6566 [inline] kfree+0x2c4/0x6b0 mm/slub.c:6773 release_mdev+0x10/0x1c drivers/most/most_usb.c:932 device_release+0x80/0x1e8 drivers/base/core.c:2561 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x17c/0x430 lib/kobject.c:737 put_device drivers/base/core.c:3797 [inline] device_unregister+0x2c/0xbc drivers/base/core.c:3920 most_deregister_interface+0x2d8/0x46c drivers/most/core.c:1402 hdm_disconnect+0xcc/0x1e0 drivers/most/most_usb.c:1123 usb_unbind_interface+0x168/0x71c drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:571 [inline] device_remove+0x100/0x14c drivers/base/dd.c:563 __device_release_driver drivers/base/dd.c:1274 [inline] device_release_driver_internal+0x310/0x47c drivers/base/dd.c:1297 device_release_driver+0x18/0x24 drivers/base/dd.c:1320 bus_remove_device+0x1a4/0x348 drivers/base/bus.c:579 device_del+0x2d0/0x7b4 drivers/base/core.c:3878 usb_disable_device+0x240/0x5ac drivers/usb/core/message.c:1418 usb_disconnect+0x22c/0x7ec drivers/usb/core/hub.c:2344 hub_port_connect drivers/usb/core/hub.c:5406 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5870 [inline] hub_event+0x10a4/0x365c drivers/usb/core/hub.c:5952 process_one_work+0x7cc/0x18d4 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x734/0xb84 kernel/workqueue.c:3427 kthread+0x348/0x5fc kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 The buggy address belongs to the object at ffff0000136e8000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 6320 bytes inside of freed 8192-byte region [ffff0000136e8000, ffff0000136ea000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x536e8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x1ffc00000000040(head|node=0|zone=0|lastcpupid=0x7ff) page_type: f5(slab) raw: 01ffc00000000040 ffff00000dc02280 0000000000000000 0000000000000001 raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 01ffc00000000040 ffff00000dc02280 0000000000000000 0000000000000001 head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 01ffc00000000003 fffffdffc04dba01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000136e9780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000136e9800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000136e9880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000136e9900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000136e9980: 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: 0 PID: 968 at lib/refcount.c:28 refcount_warn_saturate+0x138/0x19c lib/refcount.c:28 Modules linked in: CPU: 0 UID: 0 PID: 968 Comm: kworker/0:2 Tainted: G B syzkaller #0 PREEMPT Tainted: [B]=BAD_PAGE Hardware name: linux,dummy-virt (DT) Workqueue: usb_hub_wq hub_event pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0x138/0x19c lib/refcount.c:28 lr : refcount_warn_saturate+0x138/0x19c lib/refcount.c:28 sp : ffff80008e9073a0 x29: ffff80008e9073a0 x28: ffff000016dad000 x27: ffff000016dad0d8 x26: ffff600002db5a1b x25: ffff80008872f660 x24: ffff000016dad0e0 x23: ffff000014b01038 x22: 0000000000000004 x21: 1fffe00002960207 x20: ffff000014b01038 x19: 0000000000000003 x18: 0000000000000000 x17: ffff7fffe2f82000 x16: 00000000f1f1f1f1 x15: 00000000f3f3f3f3 x14: ffff700011d20e5c x13: 0000000000000001 x12: ffff700011d20dc9 x11: 1ffff00011d20dc8 x10: ffff700011d20dc8 x9 : dfff800000000000 x8 : ffff0000150b9e80 x7 : ffff80008e906f70 x6 : ffff80008034a7e8 x5 : 0000000000000000 x4 : 1fffe00002a173d1 x3 : dfff800000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000150b9e80 Call trace: refcount_warn_saturate+0x138/0x19c lib/refcount.c:28 (P) __refcount_sub_and_test include/linux/refcount.h:400 [inline] __refcount_dec_and_test include/linux/refcount.h:432 [inline] refcount_dec_and_test include/linux/refcount.h:450 [inline] kref_put include/linux/kref.h:64 [inline] kobject_put+0x29c/0x430 lib/kobject.c:737 put_device+0x14/0x24 drivers/base/core.c:3797 hdm_disconnect+0x168/0x1e0 drivers/most/most_usb.c:1129 usb_unbind_interface+0x168/0x71c drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:571 [inline] device_remove+0x100/0x14c drivers/base/dd.c:563 __device_release_driver drivers/base/dd.c:1274 [inline] device_release_driver_internal+0x310/0x47c drivers/base/dd.c:1297 device_release_driver+0x18/0x24 drivers/base/dd.c:1320 bus_remove_device+0x1a4/0x348 drivers/base/bus.c:579 device_del+0x2d0/0x7b4 drivers/base/core.c:3878 usb_disable_device+0x240/0x5ac drivers/usb/core/message.c:1418 usb_disconnect+0x22c/0x7ec drivers/usb/core/hub.c:2344 hub_port_connect drivers/usb/core/hub.c:5406 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5870 [inline] hub_event+0x10a4/0x365c drivers/usb/core/hub.c:5952 process_one_work+0x7cc/0x18d4 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x734/0xb84 kernel/workqueue.c:3427 kthread+0x348/0x5fc kernel/kthread.c:463 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:860 irq event stamp: 131595 hardirqs last enabled at (131595): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1558 [inline] hardirqs last enabled at (131595): [] finish_lock_switch kernel/sched/core.c:5073 [inline] hardirqs last enabled at (131595): [] finish_task_switch.isra.0+0x1a8/0x854 kernel/sched/core.c:5191 hardirqs last disabled at (131594): [] __schedule+0x2e8/0x3180 kernel/sched/core.c:6813 softirqs last enabled at (131382): [] softirq_handle_end kernel/softirq.c:468 [inline] softirqs last enabled at (131382): [] handle_softirqs+0x88c/0xdb4 kernel/softirq.c:650 softirqs last disabled at (131363): [] __do_softirq+0x14/0x20 kernel/softirq.c:656 ---[ end trace 0000000000000000 ]---