usb 1-1: Product: syz usb 1-1: Manufacturer: syz usb 1-1: SerialNumber: syz usb 1-1: USB disconnect, device number 84 ================================================================== BUG: KASAN: slab-use-after-free in hdm_disconnect+0x5c/0xa0 drivers/most/most_usb.c:1123 Read at addr f2f000002a0fdb60 by task kworker/1:2/14765 Pointer tag: [f2], memory tag: [fe] CPU: 1 UID: 0 PID: 14765 Comm: kworker/1:2 Not tainted 6.12.0-syzkaller-11716-gd8b78066f4c9 #0 Hardware name: linux,dummy-virt (DT) Workqueue: usb_hub_wq hub_event Call trace: show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:484 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x78/0x90 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x108/0x618 mm/kasan/report.c:489 kasan_report+0x88/0xac mm/kasan/report.c:602 report_tag_fault arch/arm64/mm/fault.c:332 [inline] do_tag_recovery arch/arm64/mm/fault.c:344 [inline] __do_kernel_fault+0x170/0x1c8 arch/arm64/mm/fault.c:386 do_bad_area arch/arm64/mm/fault.c:486 [inline] do_tag_check_fault+0x78/0x8c arch/arm64/mm/fault.c:843 do_mem_abort+0x44/0x94 arch/arm64/mm/fault.c:919 el1_abort+0x40/0x60 arch/arm64/kernel/entry-common.c:432 el1h_64_sync_handler+0xa4/0x120 arch/arm64/kernel/entry-common.c:510 el1h_64_sync+0x6c/0x70 arch/arm64/kernel/entry.S:595 hdm_disconnect+0x5c/0xa0 drivers/most/most_usb.c:1123 (P) hdm_disconnect+0x5c/0xa0 drivers/most/most_usb.c:1123 (L) usb_unbind_interface+0x78/0x28c drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:569 [inline] device_remove+0x70/0x80 drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1273 [inline] device_release_driver_internal+0x1d4/0x230 drivers/base/dd.c:1296 device_release_driver+0x18/0x24 drivers/base/dd.c:1319 bus_remove_device+0xcc/0x10c drivers/base/bus.c:576 device_del+0x150/0x388 drivers/base/core.c:3854 usb_disable_device+0xd8/0x1b0 drivers/usb/core/message.c:1418 usb_disconnect+0xd8/0x2bc drivers/usb/core/hub.c:2304 hub_port_connect drivers/usb/core/hub.c:5361 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x98c/0x1558 drivers/usb/core/hub.c:5903 process_one_work+0x15c/0x29c kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x24c/0x354 kernel/workqueue.c:3391 kthread+0x114/0x118 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Allocated by task 14765: kasan_save_stack+0x3c/0x64 mm/kasan/common.c:47 save_stack_info+0x40/0x158 mm/kasan/tags.c:106 kasan_save_alloc_info+0x14/0x20 mm/kasan/tags.c:142 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] poison_kmalloc_redzone mm/kasan/common.c:350 [inline] __kasan_kmalloc+0xb4/0xb8 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x174/0x390 mm/slub.c:4314 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] hdm_probe+0x3c/0x498 drivers/most/most_usb.c:959 usb_probe_interface+0x130/0x314 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0xbc/0x298 drivers/base/dd.c:658 __driver_probe_device+0x78/0x12c drivers/base/dd.c:800 driver_probe_device+0x3c/0x10c drivers/base/dd.c:830 __device_attach_driver+0xb8/0xf8 drivers/base/dd.c:958 bus_for_each_drv+0x84/0xe0 drivers/base/bus.c:459 __device_attach+0x9c/0x188 drivers/base/dd.c:1030 device_initial_probe+0x14/0x20 drivers/base/dd.c:1079 bus_probe_device+0xac/0xb0 drivers/base/bus.c:534 device_add+0x5cc/0x78c drivers/base/core.c:3665 usb_set_configuration+0x4f0/0x8d8 drivers/usb/core/message.c:2210 usb_generic_driver_probe+0x60/0x88 drivers/usb/core/generic.c:254 usb_probe_device+0x3c/0x118 drivers/usb/core/driver.c:291 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0xbc/0x298 drivers/base/dd.c:658 __driver_probe_device+0x78/0x12c drivers/base/dd.c:800 driver_probe_device+0x3c/0x10c drivers/base/dd.c:830 __device_attach_driver+0xb8/0xf8 drivers/base/dd.c:958 bus_for_each_drv+0x84/0xe0 drivers/base/bus.c:459 __device_attach+0x9c/0x188 drivers/base/dd.c:1030 device_initial_probe+0x14/0x20 drivers/base/dd.c:1079 bus_probe_device+0xac/0xb0 drivers/base/bus.c:534 device_add+0x5cc/0x78c drivers/base/core.c:3665 usb_new_device+0x27c/0x64c drivers/usb/core/hub.c:2651 hub_port_connect drivers/usb/core/hub.c:5521 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0xe20/0x1558 drivers/usb/core/hub.c:5903 process_one_work+0x15c/0x29c kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x24c/0x354 kernel/workqueue.c:3391 kthread+0x114/0x118 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Freed by task 14765: kasan_save_stack+0x3c/0x64 mm/kasan/common.c:47 save_stack_info+0x40/0x158 mm/kasan/tags.c:106 kasan_save_free_info+0x18/0x24 mm/kasan/tags.c:147 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x74/0x8c mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2338 [inline] slab_free mm/slub.c:4598 [inline] kfree+0xfc/0x30c mm/slub.c:4746 release_mdev+0x10/0x1c drivers/most/most_usb.c:932 device_release+0x34/0x90 drivers/base/core.c:2567 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0xa4/0x114 lib/kobject.c:737 put_device drivers/base/core.c:3773 [inline] device_unregister+0x24/0x34 drivers/base/core.c:3896 most_deregister_interface+0xf8/0x108 drivers/most/core.c:1402 hdm_disconnect+0x5c/0xa0 drivers/most/most_usb.c:1123 usb_unbind_interface+0x78/0x28c drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:569 [inline] device_remove+0x70/0x80 drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1273 [inline] device_release_driver_internal+0x1d4/0x230 drivers/base/dd.c:1296 device_release_driver+0x18/0x24 drivers/base/dd.c:1319 bus_remove_device+0xcc/0x10c drivers/base/bus.c:576 device_del+0x150/0x388 drivers/base/core.c:3854 usb_disable_device+0xd8/0x1b0 drivers/usb/core/message.c:1418 usb_disconnect+0xd8/0x2bc drivers/usb/core/hub.c:2304 hub_port_connect drivers/usb/core/hub.c:5361 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x98c/0x1558 drivers/usb/core/hub.c:5903 process_one_work+0x15c/0x29c kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x24c/0x354 kernel/workqueue.c:3391 kthread+0x114/0x118 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 The buggy address belongs to the object at fff000002a0fd000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 2912 bytes inside of 4096-byte region [fff000002a0fd000, fff000002a0fe000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xf9f000002a0fc000 pfn:0x6a0f8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x1ffc00000000040(head|node=0|zone=0|lastcpupid=0x7ff|kasantag=0x0) page_type: f5(slab) raw: 01ffc00000000040 f4f0000003001c00 ffffc1ffc013ee00 dead000000000002 raw: f9f000002a0fc000 0000000080080004 00000001f5000000 0000000000000000 head: 01ffc00000000040 f4f0000003001c00 ffffc1ffc013ee00 dead000000000002 head: f9f000002a0fc000 0000000080080004 00000001f5000000 0000000000000000 head: 01ffc00000000003 ffffc1ffc0a83e01 ffffffffffffffff 0000000000000000 head: f7f0000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: fff000002a0fd900: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fff000002a0fda00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe >fff000002a0fdb00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ^ fff000002a0fdc00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fff000002a0fdd00: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ================================================================== ------------[ cut here ]------------ kobject: '(null)' (00000000be0f6e22): is not initialized, yet kobject_put() is being called. WARNING: CPU: 1 PID: 14765 at lib/kobject.c:734 kobject_put+0xe0/0x114 lib/kobject.c:734 Modules linked in: CPU: 1 UID: 0 PID: 14765 Comm: kworker/1:2 Tainted: G B 6.12.0-syzkaller-11716-gd8b78066f4c9 #0 Tainted: [B]=BAD_PAGE Hardware name: linux,dummy-virt (DT) Workqueue: usb_hub_wq hub_event pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : kobject_put+0xe0/0x114 lib/kobject.c:734 lr : kobject_put+0xe0/0x114 lib/kobject.c:734 sp : ffff8000883f39a0 x29: ffff8000883f39a0 x28: 0000000000000000 x27: f6f0000044602000 x26: f1f0000008c70000 x25: f1f0000008c700a8 x24: ffff80008297d3e0 x23: 0000000000000000 x22: f6f00000446020d0 x21: f2f000002a0fdb68 x20: f6f0000044602050 x19: f2f000002a0fd000 x18: 0000000000000001 x17: 00000000000003a6 x16: 0000000000000003 x15: 0000000000000000 x14: 00000000000003e8 x13: 0000000000000000 x12: 000000000000001d x11: 00000185f07f9850 x10: ee1b791a8a994e11 x9 : 53cb777e2803f009 x8 : f7f00000066fa418 x7 : fff000007f8ed780 x6 : fff07ffffd18c000 x5 : ffff8000827833f0 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : f7f00000066f9240 Call trace: kobject_put+0xe0/0x114 lib/kobject.c:734 (P) kobject_put+0xe0/0x114 lib/kobject.c:734 (L) put_device+0x14/0x24 drivers/base/core.c:3773 hdm_disconnect+0x8c/0xa0 drivers/most/most_usb.c:1130 usb_unbind_interface+0x78/0x28c drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:569 [inline] device_remove+0x70/0x80 drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1273 [inline] device_release_driver_internal+0x1d4/0x230 drivers/base/dd.c:1296 device_release_driver+0x18/0x24 drivers/base/dd.c:1319 bus_remove_device+0xcc/0x10c drivers/base/bus.c:576 device_del+0x150/0x388 drivers/base/core.c:3854 usb_disable_device+0xd8/0x1b0 drivers/usb/core/message.c:1418 usb_disconnect+0xd8/0x2bc drivers/usb/core/hub.c:2304 hub_port_connect drivers/usb/core/hub.c:5361 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x98c/0x1558 drivers/usb/core/hub.c:5903 process_one_work+0x15c/0x29c kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x24c/0x354 kernel/workqueue.c:3391 kthread+0x114/0x118 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 ---[ end trace 0000000000000000 ]--- ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 1 PID: 14765 at lib/refcount.c:28 refcount_warn_saturate+0xf4/0x144 lib/refcount.c:28 Modules linked in: CPU: 1 UID: 0 PID: 14765 Comm: kworker/1:2 Tainted: G B W 6.12.0-syzkaller-11716-gd8b78066f4c9 #0 Tainted: [B]=BAD_PAGE, [W]=WARN Hardware name: linux,dummy-virt (DT) Workqueue: usb_hub_wq hub_event pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : refcount_warn_saturate+0xf4/0x144 lib/refcount.c:28 lr : refcount_warn_saturate+0xf4/0x144 lib/refcount.c:28 sp : ffff8000883f3990 x29: ffff8000883f3990 x28: 0000000000000000 x27: f6f0000044602000 x26: f1f0000008c70000 x25: f1f0000008c700a8 x24: ffff80008297d3e0 x23: 0000000000000000 x22: f6f00000446020d0 x21: f2f000002a0fdb68 x20: f6f0000044602050 x19: f2f000002a0fd000 x18: ffffffffffffffff x17: 00000000000003a6 x16: 0000000000000003 x15: ffff8000883f33d0 x14: ffff8000883f3548 x13: ffff8000827ae740 x12: 000000000000273c x11: 0000000000000d14 x10: ffff80008285e740 x9 : ffff8000827ae740 x8 : 00000000ffffdfff x7 : ffff80008285e740 x6 : 80000000ffffe000 x5 : 0000000000017ff4 x4 : 0000000000000000 x3 : 0000000000000000 x2 : 0000000000000000 x1 : 0000000000000000 x0 : f7f00000066f9240 Call trace: refcount_warn_saturate+0xf4/0x144 lib/refcount.c:28 (P) refcount_warn_saturate+0xf4/0x144 lib/refcount.c:28 (L) __refcount_sub_and_test include/linux/refcount.h:275 [inline] __refcount_dec_and_test include/linux/refcount.h:307 [inline] refcount_dec_and_test include/linux/refcount.h:325 [inline] kref_put include/linux/kref.h:64 [inline] kobject_put+0x110/0x114 lib/kobject.c:737 put_device+0x14/0x24 drivers/base/core.c:3773 hdm_disconnect+0x8c/0xa0 drivers/most/most_usb.c:1130 usb_unbind_interface+0x78/0x28c drivers/usb/core/driver.c:458 device_remove drivers/base/dd.c:569 [inline] device_remove+0x70/0x80 drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1273 [inline] device_release_driver_internal+0x1d4/0x230 drivers/base/dd.c:1296 device_release_driver+0x18/0x24 drivers/base/dd.c:1319 bus_remove_device+0xcc/0x10c drivers/base/bus.c:576 device_del+0x150/0x388 drivers/base/core.c:3854 usb_disable_device+0xd8/0x1b0 drivers/usb/core/message.c:1418 usb_disconnect+0xd8/0x2bc drivers/usb/core/hub.c:2304 hub_port_connect drivers/usb/core/hub.c:5361 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x98c/0x1558 drivers/usb/core/hub.c:5903 process_one_work+0x15c/0x29c kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x24c/0x354 kernel/workqueue.c:3391 kthread+0x114/0x118 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 ---[ end trace 0000000000000000 ]--- usb 1-1: new high-speed USB device number 85 using dummy_hcd