usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 usb 1-1: config 0 descriptor?? usb 1-1: USB disconnect, device number 5 ================================================================== BUG: KASAN: slab-use-after-free in hdm_disconnect+0x1fc/0x220 drivers/most/most_usb.c:1125 Read of size 8 at addr ff6000001b6358a0 by task kworker/1:2/900 CPU: 1 UID: 0 PID: 900 Comm: kworker/1:2 Not tainted 6.12.0-rc6-syzkaller-g57f7c7dc78cd #0 Hardware name: riscv-virtio,qemu (DT) Workqueue: usb_hub_wq hub_event Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:130 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:136 [] __dump_stack lib/dump_stack.c:94 [inline] [] dump_stack_lvl+0x122/0x196 lib/dump_stack.c:120 [] print_address_description mm/kasan/report.c:377 [inline] [] print_report+0x290/0x5a0 mm/kasan/report.c:488 [] kasan_report+0xec/0x118 mm/kasan/report.c:601 [] __asan_report_load8_noabort+0x12/0x1a mm/kasan/report_generic.c:381 [] hdm_disconnect+0x1fc/0x220 drivers/most/most_usb.c:1125 [] usb_unbind_interface+0x1b4/0x86c drivers/usb/core/driver.c:461 [] device_remove drivers/base/dd.c:569 [inline] [] device_remove+0x11a/0x15c drivers/base/dd.c:561 [] __device_release_driver drivers/base/dd.c:1273 [inline] [] device_release_driver_internal+0x3f0/0x572 drivers/base/dd.c:1296 [] device_release_driver+0x1e/0x28 drivers/base/dd.c:1319 [] bus_remove_device+0x1f4/0x3d2 drivers/base/bus.c:576 [] device_del+0x324/0x898 drivers/base/core.c:3861 [] usb_disable_device+0x2fa/0x6f8 drivers/usb/core/message.c:1418 [] usb_disconnect+0x28e/0x8a2 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+0x1976/0x48a4 drivers/usb/core/hub.c:5903 [] process_one_work+0x956/0x1dae kernel/workqueue.c:3229 [] process_scheduled_works kernel/workqueue.c:3310 [inline] [] worker_thread+0x5be/0xdc6 kernel/workqueue.c:3391 [] kthread+0x28c/0x3a6 kernel/kthread.c:389 [] ret_from_fork+0xe/0x18 arch/riscv/kernel/entry.S:326 Allocated by task 900: stack_trace_save+0xa0/0xd2 kernel/stacktrace.c:122 kasan_save_stack+0x3e/0x6a mm/kasan/common.c:47 kasan_save_track+0x16/0x28 mm/kasan/common.c:68 kasan_save_alloc_info+0x30/0x3e mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xa0/0xa6 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __kmalloc_cache_noprof+0x1f4/0x318 mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] hdm_probe+0xb2/0x17c4 drivers/most/most_usb.c:959 usb_probe_interface+0x2d6/0x8c4 drivers/usb/core/driver.c:399 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x232/0x9be drivers/base/dd.c:658 __driver_probe_device+0x1d4/0x3f2 drivers/base/dd.c:800 driver_probe_device+0x60/0x1ce drivers/base/dd.c:830 __device_attach_driver+0x1e2/0x2fc drivers/base/dd.c:958 bus_for_each_drv+0x142/0x1da drivers/base/bus.c:459 __device_attach+0x1c4/0x462 drivers/base/dd.c:1030 device_initial_probe+0x1c/0x26 drivers/base/dd.c:1079 bus_probe_device+0x15c/0x192 drivers/base/bus.c:534 device_add+0x10d8/0x181a drivers/base/core.c:3672 usb_set_configuration+0xf08/0x19dc drivers/usb/core/message.c:2210 usb_generic_driver_probe+0xae/0x128 drivers/usb/core/generic.c:254 usb_probe_device+0xd6/0x360 drivers/usb/core/driver.c:294 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x232/0x9be drivers/base/dd.c:658 __driver_probe_device+0x1d4/0x3f2 drivers/base/dd.c:800 driver_probe_device+0x60/0x1ce drivers/base/dd.c:830 __device_attach_driver+0x1e2/0x2fc drivers/base/dd.c:958 bus_for_each_drv+0x142/0x1da drivers/base/bus.c:459 __device_attach+0x1c4/0x462 drivers/base/dd.c:1030 device_initial_probe+0x1c/0x26 drivers/base/dd.c:1079 bus_probe_device+0x15c/0x192 drivers/base/bus.c:534 device_add+0x10d8/0x181a drivers/base/core.c:3672 usb_new_device+0x960/0x1762 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+0x2718/0x48a4 drivers/usb/core/hub.c:5903 process_one_work+0x956/0x1dae kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x5be/0xdc6 kernel/workqueue.c:3391 kthread+0x28c/0x3a6 kernel/kthread.c:389 ret_from_fork+0xe/0x18 arch/riscv/kernel/entry.S:326 Freed by task 900: stack_trace_save+0xa0/0xd2 kernel/stacktrace.c:122 kasan_save_stack+0x3e/0x6a mm/kasan/common.c:47 kasan_save_track+0x16/0x28 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x5a mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x4e/0x68 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kfree+0x13c/0x4ce mm/slub.c:4727 release_mdev+0x1e/0x28 drivers/most/most_usb.c:932 device_release+0x90/0x21c drivers/base/core.c:2574 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x238/0x4f0 lib/kobject.c:737 put_device drivers/base/core.c:3780 [inline] device_unregister+0x3c/0xe0 drivers/base/core.c:3903 most_deregister_interface+0x344/0x4be drivers/most/core.c:1402 hdm_disconnect+0xee/0x220 drivers/most/most_usb.c:1123 usb_unbind_interface+0x1b4/0x86c drivers/usb/core/driver.c:461 device_remove drivers/base/dd.c:569 [inline] device_remove+0x11a/0x15c drivers/base/dd.c:561 __device_release_driver drivers/base/dd.c:1273 [inline] device_release_driver_internal+0x3f0/0x572 drivers/base/dd.c:1296 device_release_driver+0x1e/0x28 drivers/base/dd.c:1319 bus_remove_device+0x1f4/0x3d2 drivers/base/bus.c:576 device_del+0x324/0x898 drivers/base/core.c:3861 usb_disable_device+0x2fa/0x6f8 drivers/usb/core/message.c:1418 usb_disconnect+0x28e/0x8a2 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+0x1976/0x48a4 drivers/usb/core/hub.c:5903 process_one_work+0x956/0x1dae kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x5be/0xdc6 kernel/workqueue.c:3391 kthread+0x28c/0x3a6 kernel/kthread.c:389 ret_from_fork+0xe/0x18 arch/riscv/kernel/entry.S:326 The buggy address belongs to the object at ff6000001b634000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 6304 bytes inside of freed 8192-byte region [ff6000001b634000, ff6000001b636000) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x9b630 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xffe000000000040(head|node=0|zone=0|lastcpupid=0x7ff) page_type: f5(slab) raw: 0ffe000000000040 ff60000011002280 0000000000000000 0000000000000001 raw: 0000000000000000 0000000080020002 00000001f5000000 0000000000000000 head: 0ffe000000000040 ff60000011002280 0000000000000000 0000000000000001 head: 0000000000000000 0000000080020002 00000001f5000000 0000000000000000 head: 0ffe000000000003 ff1c0000006d8c01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 3156, tgid 3156 (syz-executor), ts 513497249100, free_ts 512469949000 __set_page_owner+0xa2/0x70c mm/page_owner.c:320 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xec/0x1e4 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0xdaa/0x295a mm/page_alloc.c:3457 __alloc_pages_noprof+0x1e2/0x1e96 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0xf8/0x48a mm/mempolicy.c:2265 alloc_pages_noprof+0x174/0x2f0 mm/mempolicy.c:2345 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2b6/0x40c mm/slub.c:2631 ___slab_alloc+0xaca/0x114c mm/slub.c:3818 __slab_alloc.constprop.0+0x60/0xb2 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __kmalloc_cache_noprof+0x28c/0x318 mm/slub.c:4290 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] macvlan_port_create drivers/net/macvlan.c:1245 [inline] macvlan_common_newlink+0x3e8/0x187a drivers/net/macvlan.c:1480 macvtap_newlink drivers/net/macvtap.c:108 [inline] macvtap_newlink+0x1a8/0x268 drivers/net/macvtap.c:80 rtnl_newlink_create net/core/rtnetlink.c:3539 [inline] __rtnl_newlink+0xfe2/0x1738 net/core/rtnetlink.c:3759 rtnl_newlink+0x6c/0xa2 net/core/rtnetlink.c:3772 rtnetlink_rcv_msg+0x428/0xdbe net/core/rtnetlink.c:6675 netlink_rcv_skb+0x216/0x3dc net/netlink/af_netlink.c:2551 page last free pid 3156 tgid 3156 stack trace: __reset_page_owner+0x8c/0x400 mm/page_owner.c:297 reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_page+0x592/0xf08 mm/page_alloc.c:2638 __free_pages+0x13c/0x1bc mm/page_alloc.c:4820 __free_slab+0xd0/0x176 mm/slub.c:2648 free_slab+0x38/0x1ae mm/slub.c:2671 discard_slab mm/slub.c:2677 [inline] __put_partials+0x174/0x1de mm/slub.c:3145 put_cpu_partial+0x17e/0x298 mm/slub.c:3220 __slab_free+0x112/0x3f6 mm/slub.c:4449 do_slab_free mm/slub.c:4531 [inline] ___cache_free+0x1a6/0x1e0 mm/slub.c:4637 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x76/0x16c mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x158/0x1ba mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x5c/0x82 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:247 [inline] slab_post_alloc_hook mm/slub.c:4085 [inline] slab_alloc_node mm/slub.c:4134 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_node_track_caller_noprof+0x230/0x520 mm/slub.c:4283 kmemdup_noprof+0x30/0x64 mm/util.c:133 __devinet_sysctl_register+0xc8/0x2e6 net/ipv4/devinet.c:2598 devinet_sysctl_register net/ipv4/devinet.c:2650 [inline] devinet_sysctl_register+0x176/0x206 net/ipv4/devinet.c:2640 Memory state around the buggy address: ff6000001b635780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ff6000001b635800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ff6000001b635880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ff6000001b635900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ff6000001b635980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================