usb 5-1: USB disconnect, device number 4 ================================================================== BUG: KASAN: use-after-free in roccat_disconnect+0x236/0x240 drivers/hid/hid-roccat.c:382 Read of size 4 at addr ffff88807a072808 by task kworker/1:21/4327 CPU: 1 PID: 4327 Comm: kworker/1:21 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Workqueue: usb_hub_wq hub_event Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 roccat_disconnect+0x236/0x240 drivers/hid/hid-roccat.c:382 savu_remove_specials drivers/hid/hid-roccat-savu.c:107 [inline] savu_remove+0xe5/0x160 drivers/hid/hid-roccat-savu.c:147 hid_device_remove+0xba/0x1b0 drivers/hid/hid-core.c:2413 __device_release_driver drivers/base/dd.c:1247 [inline] device_release_driver_internal+0x44c/0x710 drivers/base/dd.c:1282 bus_remove_device+0x2dd/0x400 drivers/base/bus.c:531 device_del+0x63f/0xa80 drivers/base/core.c:3615 hid_remove_device drivers/hid/hid-core.c:2589 [inline] hid_destroy_device+0x66/0x100 drivers/hid/hid-core.c:2608 usbhid_disconnect+0x9b/0xc0 drivers/hid/usbhid/hid-core.c:1469 usb_unbind_interface+0x203/0x870 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1249 [inline] device_release_driver_internal+0x487/0x710 drivers/base/dd.c:1282 bus_remove_device+0x2dd/0x400 drivers/base/bus.c:531 device_del+0x63f/0xa80 drivers/base/core.c:3615 usb_disable_device+0x3e7/0x8a0 drivers/usb/core/message.c:1472 usb_disconnect+0x33c/0x8a0 drivers/usb/core/hub.c:2292 hub_port_connect drivers/usb/core/hub.c:5346 [inline] hub_port_connect_change drivers/usb/core/hub.c:5642 [inline] port_event drivers/usb/core/hub.c:5804 [inline] hub_event+0x1d64/0x5260 drivers/usb/core/hub.c:5886 process_one_work+0x867/0xff0 kernel/workqueue.c:2310 worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 3522: 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 mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xaf/0xe0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:607 [inline] kzalloc include/linux/slab.h:738 [inline] roccat_connect+0x59/0x490 drivers/hid/hid-roccat.c:315 savu_init_specials drivers/hid/hid-roccat-savu.c:81 [inline] savu_probe+0x1af/0x350 drivers/hid/hid-roccat-savu.c:131 __hid_device_probe drivers/hid/hid-core.c:2355 [inline] hid_device_probe+0x2cb/0x590 drivers/hid/hid-core.c:2394 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x276/0xc70 drivers/base/dd.c:595 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:775 driver_probe_device+0x4f/0x420 drivers/base/dd.c:805 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:927 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429 __device_attach+0x2a7/0x480 drivers/base/dd.c:999 bus_probe_device+0xba/0x1d0 drivers/base/bus.c:489 device_add+0xbcf/0x1050 drivers/base/core.c:3427 hid_add_device+0x361/0x500 drivers/hid/hid-core.c:2540 usbhid_probe+0xbc5/0xf50 drivers/hid/usbhid/hid-core.c:1442 usb_probe_interface+0x5be/0xae0 drivers/usb/core/driver.c:396 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x276/0xc70 drivers/base/dd.c:595 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:775 driver_probe_device+0x4f/0x420 drivers/base/dd.c:805 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:927 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429 __device_attach+0x2a7/0x480 drivers/base/dd.c:999 bus_probe_device+0xba/0x1d0 drivers/base/bus.c:489 device_add+0xbcf/0x1050 drivers/base/core.c:3427 usb_set_configuration+0x19d5/0x2030 drivers/usb/core/message.c:2223 usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238 usb_probe_device+0x126/0x250 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x276/0xc70 drivers/base/dd.c:595 __driver_probe_device+0x1f5/0x390 drivers/base/dd.c:775 driver_probe_device+0x4f/0x420 drivers/base/dd.c:805 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:927 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429 __device_attach+0x2a7/0x480 drivers/base/dd.c:999 bus_probe_device+0xba/0x1d0 drivers/base/bus.c:489 device_add+0xbcf/0x1050 drivers/base/core.c:3427 usb_new_device+0x9f6/0x15d0 drivers/usb/core/hub.c:2637 hub_port_connect drivers/usb/core/hub.c:5502 [inline] hub_port_connect_change drivers/usb/core/hub.c:5642 [inline] port_event drivers/usb/core/hub.c:5804 [inline] hub_event+0x2b8d/0x5260 drivers/usb/core/hub.c:5886 process_one_work+0x867/0xff0 kernel/workqueue.c:2310 worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457 kthread+0x42e/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Freed by task 4491: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1710 [inline] slab_free_freelist_hook+0xec/0x170 mm/slub.c:1736 slab_free mm/slub.c:3504 [inline] kfree+0xef/0x2a0 mm/slub.c:4564 roccat_release+0x2a6/0x370 drivers/hid/hid-roccat.c:238 __fput+0x212/0x8c0 fs/file_table.c:311 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217 __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88807a072800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 8 bytes inside of 1024-byte region [ffff88807a072800, ffff88807a072c00) The buggy address belongs to the page: page:ffffea0001e81c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7a070 head:ffffea0001e81c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 0000000800000001 ffff888017841dc0 raw: 0000000000000000 0000000000100010 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4350, ts 79712335145, free_ts 79624351955 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x24f6/0x2670 mm/page_alloc.c:4192 __alloc_pages+0x1ee/0x480 mm/page_alloc.c:5501 alloc_slab_page mm/slub.c:1780 [inline] allocate_slab mm/slub.c:1917 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1980 ___slab_alloc+0x807/0xdd0 mm/slub.c:3013 __slab_alloc mm/slub.c:3100 [inline] slab_alloc_node mm/slub.c:3191 [inline] __kmalloc_node+0x142/0x3a0 mm/slub.c:4456 kmalloc_node include/linux/slab.h:630 [inline] kzalloc_node include/linux/slab.h:749 [inline] qdisc_alloc+0x97/0xae0 net/sched/sch_generic.c:892 qdisc_create_dflt+0x5f/0x410 net/sched/sch_generic.c:954 attach_one_default_qdisc net/sched/sch_generic.c:1117 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2390 [inline] attach_default_qdiscs net/sched/sch_generic.c:1135 [inline] dev_activate+0x33d/0x1330 net/sched/sch_generic.c:1194 __dev_open+0x33b/0x430 net/core/dev.c:1559 __dev_change_flags+0x1e4/0x6a0 net/core/dev.c:8880 dev_change_flags+0x78/0x1a0 net/core/dev.c:8951 vlan_device_event+0x563/0x1fb0 net/8021q/vlan.c:496 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391 call_netdevice_notifiers_extack net/core/dev.c:2074 [inline] call_netdevice_notifiers net/core/dev.c:2088 [inline] __dev_notify_flags+0x194/0x300 net/core/dev.c:8918 dev_change_flags+0xda/0x1a0 net/core/dev.c:8956 do_setlink+0xca4/0x29d0 net/core/rtnetlink.c:2793 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x8f/0x2a0 mm/page_alloc.c:3396 free_slab mm/slub.c:2020 [inline] discard_slab mm/slub.c:2026 [inline] __unfreeze_partials+0x188/0x1e0 mm/slub.c:2512 put_cpu_partial+0x12d/0x190 mm/slub.c:2592 qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3225 [inline] slab_alloc mm/slub.c:3233 [inline] kmem_cache_alloc_trace+0x165/0x290 mm/slub.c:3250 kmalloc include/linux/slab.h:607 [inline] kzalloc include/linux/slab.h:738 [inline] ____ip_mc_inc_group+0x2b3/0xac0 net/ipv4/igmp.c:1456 __ip_mc_inc_group net/ipv4/igmp.c:1491 [inline] ip_mc_inc_group net/ipv4/igmp.c:1497 [inline] ip_mc_up+0x121/0x2f0 net/ipv4/igmp.c:1796 inetdev_event+0xdfe/0x1350 net/ipv4/devinet.c:1586 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391 call_netdevice_notifiers_extack net/core/dev.c:2074 [inline] call_netdevice_notifiers net/core/dev.c:2088 [inline] __dev_notify_flags+0x194/0x300 net/core/dev.c:8918 dev_change_flags+0xda/0x1a0 net/core/dev.c:8956 do_setlink+0xca4/0x29d0 net/core/rtnetlink.c:2793 Memory state around the buggy address: ffff88807a072700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807a072780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807a072800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807a072880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807a072900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================