KASAN: use-after-free Write in roccat_open

Status: upstream: reported C repro on 2026/10/18 00:30
Reported-by: syzbot+d937bc6b79540cc9c29e@syzkaller.appspotmail.com
First crash: 3d17h, last: 3d17h
▶ ▼ Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 KASAN: use-after-free Write in roccat_open 22 syz, C 1 1d04h 49d 0/2 upstream: reported C repro on 2026/09/02 07:33
upstream KASAN: slab-use-after-free Read in roccat_open prio:high input usb 19 syz, C 2 33d 55d 0/29 upstream: reported C 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 atomic_long_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1667 [inline]
BUG: KASAN: use-after-free in __mutex_trylock_fast kernel/locking/mutex.c:169 [inline]
BUG: KASAN: use-after-free in mutex_lock+0x8e/0x1c0 kernel/locking/mutex.c:288
Write of size 8 at addr ffff8881152a2c48 by task syz.4.39/446

CPU: 0 PID: 446 Comm: syz.4.39 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/16/2026
Call Trace:
 <TASK>
 __dump_stack+0x21/0x30 lib/dump_stack.c:88
 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:427 [inline]
 kasan_report+0x10f/0x150 mm/kasan/report.c:444
 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]
 atomic_long_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1667 [inline]
 __mutex_trylock_fast kernel/locking/mutex.c:169 [inline]
 mutex_lock+0x8e/0x1c0 kernel/locking/mutex.c:288
 roccat_open+0xec/0x5a0 drivers/hid/hid-roccat.c:178
 chrdev_open+0x585/0x5f0 fs/char_dev.c:414
 do_dentry_open+0x82a/0x1010 fs/open.c:828
 vfs_open+0x73/0x80 fs/open.c:960
 do_open fs/namei.c:3616 [inline]
 path_openat+0x26e6/0x2f80 fs/namei.c:3750
 do_filp_open+0x1df/0x400 fs/namei.c:3777
 do_sys_openat2+0x15e/0x7f0 fs/open.c:1236
 do_sys_open fs/open.c:1252 [inline]
 __do_sys_openat fs/open.c:1268 [inline]
 __se_sys_openat fs/open.c:1263 [inline]
 __x64_sys_openat+0x136/0x160 fs/open.c:1263
 x64_sys_call+0x219/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f68b6b78559
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:00007ffff0e72fd8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f68b6dfffa0 RCX: 00007f68b6b78559
RDX: 0000000000000002 RSI: 0000200000000100 RDI: ffffffffffffff9c
RBP: 00007f68b6c0fab8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f68b6dfffac R14: 00007f68b6dfffa0 R15: 00007f68b6dfffa0
 </TASK>

Allocated by task 401:
 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:433 [inline]
 ____kasan_kmalloc mm/kasan/common.c:512 [inline]
 __kasan_kmalloc+0xd4/0x100 mm/kasan/common.c:521
 kasan_kmalloc include/linux/kasan.h:227 [inline]
 kmem_cache_alloc_trace+0x119/0x270 mm/slub.c:3274
 kmalloc include/linux/slab.h:619 [inline]
 kzalloc include/linux/slab.h:750 [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
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x27d/0x970 drivers/base/dd.c:595
 __driver_probe_device+0x193/0x270 drivers/base/dd.c:755
 driver_probe_device+0x54/0x3e0 drivers/base/dd.c:785
 __device_attach_driver+0x2a6/0x460 drivers/base/dd.c:907
 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429
 __device_attach+0x2b0/0x420 drivers/base/dd.c:979
 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1028
 bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:489
 device_add+0xaef/0xe90 drivers/base/core.c:3422
 hid_add_device+0x349/0x4b0 drivers/hid/hid-core.c:2513
 usbhid_probe+0xb93/0xf30 drivers/hid/usbhid/hid-core.c:1442
 usb_probe_interface+0x60f/0xb20 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x27d/0x970 drivers/base/dd.c:595
 __driver_probe_device+0x193/0x270 drivers/base/dd.c:755
 driver_probe_device+0x54/0x3e0 drivers/base/dd.c:785
 __device_attach_driver+0x2a6/0x460 drivers/base/dd.c:907
 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429
 __device_attach+0x2b0/0x420 drivers/base/dd.c:979
 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1028
 bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:489
 device_add+0xaef/0xe90 drivers/base/core.c:3422
 usb_set_configuration+0x1a01/0x1f70 drivers/usb/core/message.c:2223
 usb_generic_driver_probe+0x91/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x143/0x250 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x27d/0x970 drivers/base/dd.c:595
 __driver_probe_device+0x193/0x270 drivers/base/dd.c:755
 driver_probe_device+0x54/0x3e0 drivers/base/dd.c:785
 __device_attach_driver+0x2a6/0x460 drivers/base/dd.c:907
 bus_for_each_drv+0x184/0x210 drivers/base/bus.c:429
 __device_attach+0x2b0/0x420 drivers/base/dd.c:979
 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1028
 bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:489
 device_add+0xaef/0xe90 drivers/base/core.c:3422
 usb_new_device+0xa1f/0x1720 drivers/usb/core/hub.c:2643
 hub_port_connect drivers/usb/core/hub.c:5560 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5700 [inline]
 port_event drivers/usb/core/hub.c:5866 [inline]
 hub_event+0x291b/0x43f0 drivers/usb/core/hub.c:5948
 process_one_work+0x6c8/0xbb0 kernel/workqueue.c:2328
 worker_thread+0xaa0/0x1250 kernel/workqueue.c:2475
 kthread+0x3f5/0x4f0 kernel/kthread.c:337
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Freed by task 447:
 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:365
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373
 kasan_slab_free include/linux/kasan.h:193 [inline]
 slab_free_hook mm/slub.c:1728 [inline]
 slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754
 slab_free mm/slub.c:3526 [inline]
 kfree+0xc4/0x270 mm/slub.c:4588
 roccat_free_device+0x27b/0x280 drivers/hid/hid-roccat.c:79
 roccat_release+0x2ae/0x370 drivers/hid/hid-roccat.c:238
 __fput+0x22b/0x900 fs/file_table.c:311
 ____fput+0x15/0x20 fs/file_table.c:339
 task_work_run+0x127/0x190 kernel/task_work.c:188
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0xd0/0xe0 kernel/entry/common.c:184
 exit_to_user_mode_prepare+0x87/0xd0 kernel/entry/common.c:217
 __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline]
 syscall_exit_to_user_mode+0x1a/0x30 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 ffff8881152a2c00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 72 bytes inside of
 512-byte region [ffff8881152a2c00, ffff8881152a2e00)
The buggy address belongs to the page:
page:ffffea000454a800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1152a0
head:ffffea000454a800 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100042f00
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 109, ts 5870336079, free_ts 0
 set_page_owner include/linux/page_owner.h:33 [inline]
 post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2607
 prep_new_page+0x1c/0x110 mm/page_alloc.c:2613
 get_page_from_freelist+0x2c3a/0x2cd0 mm/page_alloc.c:4487
 __alloc_pages+0x1a2/0x460 mm/page_alloc.c:5824
 alloc_slab_page mm/slub.c:-1 [inline]
 allocate_slab mm/slub.c:1937 [inline]
 new_slab+0xa0/0x4d0 mm/slub.c:2000
 ___slab_alloc+0x3ac/0x840 mm/slub.c:3033
 __slab_alloc+0x49/0x90 mm/slub.c:3120
 slab_alloc_node mm/slub.c:3211 [inline]
 slab_alloc mm/slub.c:3255 [inline]
 __kmalloc_track_caller+0x169/0x2c0 mm/slub.c:4954
 kmalloc_reserve net/core/skbuff.c:357 [inline]
 __alloc_skb+0x210/0x730 net/core/skbuff.c:428
 alloc_skb include/linux/skbuff.h:1183 [inline]
 alloc_skb_with_frags+0xa8/0x620 net/core/skbuff.c:6223
 sock_alloc_send_pskb+0x87f/0x9a0 net/core/sock.c:2541
 unix_dgram_sendmsg+0x6f3/0x19b0 net/unix/af_unix.c:1816
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 sock_write_iter+0x2a6/0x3a0 net/socket.c:1080
 call_write_iter include/linux/fs.h:2218 [inline]
 new_sync_write fs/read_write.c:507 [inline]
 vfs_write+0x831/0xfd0 fs/read_write.c:594
 ksys_write+0x14a/0x260 fs/read_write.c:647
 __do_sys_write fs/read_write.c:659 [inline]
 __se_sys_write fs/read_write.c:656 [inline]
 __x64_sys_write+0x7b/0x90 fs/read_write.c:656
page_owner free stack trace missing

Memory state around the buggy address:
 ffff8881152a2b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8881152a2b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8881152a2c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                              ^
 ffff8881152a2c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8881152a2d00: 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/10/18 00:29 android13-5.15-lts ff23d765b06f 432c0077 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-android-5-15 KASAN: use-after-free Write in roccat_open
* Struck through repros no longer work on HEAD.