KASAN: use-after-free Write in roccat_open

Status: upstream: reported C repro on 2026/09/02 07:33
Reported-by: syzbot+b59e7ddb8cdb7270bb91@syzkaller.appspotmail.com
First crash: 3h16m, last: 3h16m
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in roccat_open input usb prio:high 19 syz 1 10d 6d04h 0/29 upstream: reported syz repro on 2026/08/27 06:31

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
BUG: KASAN: use-after-free in atomic64_try_cmpxchg_acquire include/asm-generic/atomic-instrumented.h:1515 [inline]
BUG: KASAN: use-after-free in atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:443 [inline]
BUG: KASAN: use-after-free in __mutex_trylock_fast kernel/locking/mutex.c:173 [inline]
BUG: KASAN: use-after-free in mutex_lock+0x85/0xf0 kernel/locking/mutex.c:298
Write of size 8 at addr ffff88811d72f448 by task syz.5.45/507

CPU: 1 PID: 507 Comm: syz.5.45 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
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
 check_region_inline mm/kasan/generic.c:-1 [inline]
 kasan_check_range+0x249/0x2a0 mm/kasan/generic.c:189
 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37
 instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
 atomic64_try_cmpxchg_acquire include/asm-generic/atomic-instrumented.h:1515 [inline]
 atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:443 [inline]
 __mutex_trylock_fast kernel/locking/mutex.c:173 [inline]
 mutex_lock+0x85/0xf0 kernel/locking/mutex.c:298
 roccat_open+0xec/0x5a0 drivers/hid/hid-roccat.c:169
 chrdev_open+0x585/0x5f0 fs/char_dev.c:414
 do_dentry_open+0x7a5/0x10a0 fs/open.c:819
 vfs_open+0x73/0x80 fs/open.c:944
 do_open fs/namei.c:3441 [inline]
 path_openat+0x26c3/0x3040 fs/namei.c:3559
 do_filp_open+0x1df/0x400 fs/namei.c:3586
 do_sys_openat2+0x19f/0x750 fs/open.c:1219
 do_sys_open fs/open.c:1235 [inline]
 __do_sys_openat fs/open.c:1251 [inline]
 __se_sys_openat fs/open.c:1246 [inline]
 __x64_sys_openat+0x136/0x160 fs/open.c:1246
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fed2e401159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe8a956468 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fed2e688fa0 RCX: 00007fed2e401159
RDX: 0000000000000002 RSI: 0000200000000100 RDI: ffffffffffffff9c
RBP: 00007fed2e498024 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fed2e688fac R14: 00007fed2e688fa0 R15: 00007fed2e688fa0

Allocated by task 393:
 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:306
 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:2356
 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:2508
 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:2654
 hub_port_connect drivers/usb/core/hub.c:5499 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5639 [inline]
 port_event drivers/usb/core/hub.c:5805 [inline]
 hub_event+0x2790/0x4220 drivers/usb/core/hub.c:5887
 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 508:
 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_release+0x2ae/0x370 drivers/hid/hid-roccat.c:229
 __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:172
 exit_to_user_mode_prepare+0x76/0xa0 kernel/entry/common.c:199
 syscall_exit_to_user_mode+0x1d/0x40 kernel/entry/common.c:274
 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 ffff88811d72f400
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 72 bytes inside of
 512-byte region [ffff88811d72f400, ffff88811d72f600)
The buggy address belongs to the page:
page:ffffea000475cb00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11d72c
head:ffffea000475cb00 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 0000000000000000 0000000100000001 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 133, ts 16669476136, free_ts 16633489003
 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]
 netlink_alloc_large_skb net/netlink/af_netlink.c:1178 [inline]
 netlink_sendmsg+0x693/0xb70 net/netlink/af_netlink.c:1894
 sock_sendmsg_nosec net/socket.c:652 [inline]
 __sock_sendmsg net/socket.c:664 [inline]
 ____sys_sendmsg+0x5be/0x8f0 net/socket.c:2377
 ___sys_sendmsg+0x236/0x2e0 net/socket.c:2431
 __sys_sendmsg net/socket.c:2460 [inline]
 __do_sys_sendmsg net/socket.c:2469 [inline]
 __se_sys_sendmsg net/socket.c:2467 [inline]
 __x64_sys_sendmsg+0x201/0x2d0 net/socket.c:2467
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:28 [inline]
 free_pages_prepare mm/page_alloc.c:1349 [inline]
 free_pcp_prepare mm/page_alloc.c:1421 [inline]
 free_unref_page_prepare+0x2b7/0x2d0 mm/page_alloc.c:3336
 free_unref_page+0x7f/0x190 mm/page_alloc.c:3391
 __put_single_page mm/swap.c:104 [inline]
 __put_page+0xae/0xe0 mm/swap.c:135
 put_page include/linux/mm.h:1268 [inline]
 anon_pipe_buf_release+0x165/0x1f0 fs/pipe.c:137
 pipe_buf_release include/linux/pipe_fs_i.h:219 [inline]
 pipe_read+0x563/0x1050 fs/pipe.c:323
 call_read_iter include/linux/fs.h:2066 [inline]
 new_sync_read fs/read_write.c:415 [inline]
 vfs_read+0x62a/0xa50 fs/read_write.c:496
 ksys_read+0x14a/0x260 fs/read_write.c:634
 __do_sys_read fs/read_write.c:644 [inline]
 __se_sys_read fs/read_write.c:642 [inline]
 __x64_sys_read+0x7b/0x90 fs/read_write.c:642
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Memory state around the buggy address:
 ffff88811d72f300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88811d72f380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88811d72f400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                              ^
 ffff88811d72f480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88811d72f500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/09/02 07:33 android13-5.10-lts 4185c27befd4 587f6b29 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Write in roccat_open
* Struck through repros no longer work on HEAD.