usb 4-1: USB disconnect, device number 4 ================================================================== BUG: KASAN: use-after-free in roccat_disconnect+0x22d/0x240 drivers/hid/hid-roccat.c:382 Read of size 4 at addr ffff888119248008 by task kworker/0:1/15 CPU: 0 PID: 15 Comm: kworker/0:1 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026 Workqueue: usb_hub_wq hub_event Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x1a7/0x208 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x100/0x140 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 roccat_disconnect+0x22d/0x240 drivers/hid/hid-roccat.c:382 savu_remove_specials drivers/hid/hid-roccat-savu.c:107 [inline] savu_remove+0xec/0x170 drivers/hid/hid-roccat-savu.c:147 hid_device_remove+0xba/0x170 drivers/hid/hid-core.c:2392 __device_release_driver drivers/base/dd.c:-1 [inline] device_release_driver_internal+0x531/0x7c0 drivers/base/dd.c:1221 device_release_driver+0x19/0x20 drivers/base/dd.c:1244 bus_remove_device+0x2df/0x340 drivers/base/bus.c:535 device_del+0x62e/0xe60 drivers/base/core.c:3453 hid_remove_device drivers/hid/hid-core.c:2563 [inline] hid_destroy_device+0x6a/0x110 drivers/hid/hid-core.c:2582 usbhid_disconnect+0x9f/0xc0 drivers/hid/usbhid/hid-core.c:1463 usb_unbind_interface+0x212/0x8a0 drivers/usb/core/driver.c:459 __device_release_driver drivers/base/dd.c:-1 [inline] device_release_driver_internal+0x531/0x7c0 drivers/base/dd.c:1221 device_release_driver+0x19/0x20 drivers/base/dd.c:1244 bus_remove_device+0x2df/0x340 drivers/base/bus.c:535 device_del+0x62e/0xe60 drivers/base/core.c:3453 usb_disable_device+0x3a8/0x750 drivers/usb/core/message.c:1470 usb_disconnect+0x32d/0x870 drivers/usb/core/hub.c:2315 hub_port_connect drivers/usb/core/hub.c:5343 [inline] hub_port_connect_change drivers/usb/core/hub.c:5644 [inline] port_event drivers/usb/core/hub.c:5810 [inline] hub_event+0x19c2/0x4220 drivers/usb/core/hub.c:5892 process_one_work+0x6fd/0xbc0 kernel/workqueue.c:2301 worker_thread+0xa8e/0x13c0 kernel/workqueue.c:2447 kthread+0x324/0x3b0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 306: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc mm/kasan/common.c:509 [inline] __kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x179/0x2e0 mm/slub.c:2979 kmalloc include/linux/slab.h:555 [inline] kzalloc include/linux/slab.h:667 [inline] roccat_connect+0x5c/0x4b0 drivers/hid/hid-roccat.c:315 savu_init_specials drivers/hid/hid-roccat-savu.c:81 [inline] savu_probe+0x1ba/0x360 drivers/hid/hid-roccat-savu.c:131 hid_device_probe+0x28d/0x390 drivers/hid/hid-core.c:2363 really_probe+0x373/0xa60 drivers/base/dd.c:558 driver_probe_device+0xe1/0x190 drivers/base/dd.c:752 __device_attach_driver+0x282/0x3f0 drivers/base/dd.c:863 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:433 __device_attach+0x2a8/0x410 drivers/base/dd.c:932 device_initial_probe+0x1a/0x20 drivers/base/dd.c:981 bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:493 device_add+0x8ce/0xc00 drivers/base/core.c:3273 hid_add_device+0x349/0x4b0 drivers/hid/hid-core.c:2515 usbhid_probe+0xb93/0xf30 drivers/hid/usbhid/hid-core.c:1436 usb_probe_interface+0x60f/0xb20 drivers/usb/core/driver.c:397 really_probe+0x3bf/0xa60 drivers/base/dd.c:562 driver_probe_device+0xe1/0x190 drivers/base/dd.c:752 __device_attach_driver+0x282/0x3f0 drivers/base/dd.c:863 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:433 __device_attach+0x2a8/0x410 drivers/base/dd.c:932 device_initial_probe+0x1a/0x20 drivers/base/dd.c:981 bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:493 device_add+0x8ce/0xc00 drivers/base/core.c:3273 usb_set_configuration+0x1a76/0x1fe0 drivers/usb/core/message.c:2219 usb_generic_driver_probe+0x91/0x150 drivers/usb/core/generic.c:238 usb_probe_device+0x143/0x250 drivers/usb/core/driver.c:294 really_probe+0x3bf/0xa60 drivers/base/dd.c:562 driver_probe_device+0xe1/0x190 drivers/base/dd.c:752 __device_attach_driver+0x282/0x3f0 drivers/base/dd.c:863 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:433 __device_attach+0x2a8/0x410 drivers/base/dd.c:932 device_initial_probe+0x1a/0x20 drivers/base/dd.c:981 bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:493 device_add+0x8ce/0xc00 drivers/base/core.c:3273 usb_new_device+0x9ba/0x1460 drivers/usb/core/hub.c:2659 hub_port_connect drivers/usb/core/hub.c:5504 [inline] hub_port_connect_change drivers/usb/core/hub.c:5644 [inline] port_event drivers/usb/core/hub.c:5810 [inline] hub_event+0x2790/0x4220 drivers/usb/core/hub.c:5892 process_one_work+0x6fd/0xbc0 kernel/workqueue.c:2301 worker_thread+0xa8e/0x13c0 kernel/workqueue.c:2447 kthread+0x324/0x3b0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Freed by task 665: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1600 [inline] slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1626 slab_free mm/slub.c:3208 [inline] kfree+0xc0/0x270 mm/slub.c:4196 roccat_free_device+0x27b/0x280 drivers/hid/hid-roccat.c:79 roccat_release+0x2ae/0x370 drivers/hid/hid-roccat.c:238 __fput+0x2dc/0x730 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x127/0x190 kernel/task_work.c:189 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xcb/0xe0 kernel/entry/common.c:175 exit_to_user_mode_prepare+0x76/0xa0 kernel/entry/common.c:202 syscall_exit_to_user_mode+0x1d/0x40 kernel/entry/common.c:277 do_syscall_64+0x3d/0x40 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff888119248000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 8 bytes inside of 512-byte region [ffff888119248000, ffff888119248200) The buggy address belongs to the page: page:ffffea0004649200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x119248 head:ffffea0004649200 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 ffffea000463d600 0000000200000002 ffff888100043080 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 104, ts 4305427268, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x176/0x190 mm/page_alloc.c:2462 get_page_from_freelist+0x225f/0x23f0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x29a/0x640 mm/page_alloc.c:5384 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1813 [inline] new_slab+0x84/0x3f0 mm/slub.c:1874 new_slab_objects mm/slub.c:2632 [inline] ___slab_alloc+0x2f8/0x4c0 mm/slub.c:2796 __slab_alloc+0x63/0xa0 mm/slub.c:2836 slab_alloc_node mm/slub.c:2918 [inline] slab_alloc mm/slub.c:2960 [inline] __kmalloc_track_caller+0x1e4/0x310 mm/slub.c:4541 __kmalloc_reserve net/core/skbuff.c:144 [inline] __alloc_skb+0xdc/0x520 net/core/skbuff.c:212 alloc_skb include/linux/skbuff.h:1126 [inline] alloc_skb_with_frags+0xa3/0x560 net/core/skbuff.c:6058 sock_alloc_send_pskb+0x87f/0x9a0 net/core/sock.c:2392 unix_dgram_sendmsg+0x6f3/0x18f0 net/unix/af_unix.c:1725 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] sock_write_iter+0x2a6/0x3a0 net/socket.c:1019 call_write_iter include/linux/fs.h:2072 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0x770/0xd70 fs/read_write.c:605 ksys_write+0x14a/0x260 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 page_owner free stack trace missing Memory state around the buggy address: ffff888119247f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888119247f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888119248000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888119248080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888119248100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================