syzbot


KASAN: use-after-free Read in steam_input_open

Status: upstream: reported C repro on 2025/03/06 06:53
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+90e00c014235fc0be992@syzkaller.appspotmail.com
First crash: 245d, last: 14d
Fix commit to backport (bisect log) :
tree: upstream
commit 691ead124a0c35e56633dbb73e43711ff3db23ef
Author: Vicki Pfau <vi@endrift.com>
Date: Wed Dec 20 03:38:33 2023 +0000

  HID: hid-steam: Clean up locking

  
Bug presence (2)
Date Name Commit Repro Result
2025/03/23 linux-5.15.y (ToT) 0c935c049b5c C [report] KASAN: use-after-free Read in steam_input_open
2025/03/23 upstream (ToT) 586de92313fc C Didn't crash
Similar bugs (6)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in steam_input_open origin:lts-only 19 C done 5 228d 245d 0/3 upstream: reported C repro on 2025/03/06 15:18
android-54 KASAN: use-after-free Write in steam_input_open 24 C 29 183d 255d 0/2 upstream: reported C repro on 2025/02/24 11:20
upstream KASAN: slab-use-after-free Read in steam_input_open input usb 19 C done 5 243d 256d 28/29 fixed on 2025/06/10 16:19
android-5-15 KASAN: use-after-free Write in steam_input_open origin:lts 24 C 91 9h05m 424d 0/2 upstream: reported C repro on 2024/09/08 02:35
android-6-1 KASAN: use-after-free Write in steam_input_open origin:lts 24 C 79 2d11h 407d 0/2 upstream: reported C repro on 2024/09/25 04:26
android-5-10 KASAN: use-after-free Write in steam_input_open 24 C inconclusive 232 7d23h 429d 0/2 upstream: reported C repro on 2024/09/03 09:12
Last patch testing requests (10)
Created Duration User Patch Repo Result
2025/10/23 01:03 17m retest repro linux-5.15.y report log
2025/09/29 22:53 10m retest repro linux-5.15.y report log
2025/08/30 14:58 14m retest repro linux-5.15.y report log
2025/08/30 14:58 12m retest repro linux-5.15.y report log
2025/08/12 20:47 53m retest repro linux-5.15.y report log
2025/06/20 18:18 44m retest repro linux-5.15.y report log
2025/06/20 18:18 1h14m retest repro linux-5.15.y report log
2025/06/02 15:30 9m retest repro linux-5.15.y report log
2025/04/06 18:46 10m retest repro linux-5.15.y report log
2025/04/06 18:46 9m retest repro linux-5.15.y report log
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2025/07/03 11:59 9h53m fix candidate upstream OK (1) job log
2025/05/03 12:37 12h12m fix candidate upstream error job log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __mutex_lock_common+0x114/0x2390 kernel/locking/mutex.c:575
Read of size 8 at addr ffff88805811b4e8 by task udevd/4438

CPU: 0 PID: 4438 Comm: udevd Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 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
 __mutex_lock_common+0x114/0x2390 kernel/locking/mutex.c:575
 __mutex_lock kernel/locking/mutex.c:729 [inline]
 mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743
 steam_input_open+0x93/0x170 drivers/hid/hid-steam.c:297
 input_open_device+0x16c/0x2e0 drivers/input/input.c:640
 evdev_open_device drivers/input/evdev.c:400 [inline]
 evdev_open+0x4b0/0x5b0 drivers/input/evdev.c:487
 chrdev_open+0x597/0x670 fs/char_dev.c:414
 do_dentry_open+0x7ff/0xf80 fs/open.c:826
 do_open fs/namei.c:3608 [inline]
 path_openat+0x2682/0x2f30 fs/namei.c:3742
 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769
 do_sys_openat2+0x142/0x4a0 fs/open.c:1253
 do_sys_open fs/open.c:1269 [inline]
 __do_sys_openat fs/open.c:1285 [inline]
 __se_sys_openat fs/open.c:1280 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1280
 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:0x7efe122a1407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffdd01d0110 EFLAGS: 00000202 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007efe121b3880 RCX: 00007efe122a1407
RDX: 0000000000080000 RSI: 0000562f2d591a20 RDI: ffffffffffffff9c
RBP: 0000562f2d71a5b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000562efcbf00c8
R13: 0000562efcbf00ce R14: 00007ffdd01d0710 R15: 0000562efcbf6bcc
 </TASK>

Allocated by task 4209:
 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+0xb5/0xf0 mm/kasan/common.c:522
 alloc_dr drivers/base/devres.c:116 [inline]
 devm_kmalloc+0x77/0x280 drivers/base/devres.c:831
 devm_kzalloc include/linux/device.h:208 [inline]
 steam_probe+0x129/0xb40 drivers/hid/hid-steam.c:741
 hid_device_probe+0x271/0x360 drivers/hid/hid-core.c:2318
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x284/0xc80 drivers/base/dd.c:595
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
 __device_attach+0x29b/0x460 drivers/base/dd.c:979
 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
 device_add+0xa00/0xfb0 drivers/base/core.c:3412
 hid_add_device+0x389/0x530 drivers/hid/hid-core.c:2470
 usbhid_probe+0xb92/0xf40 drivers/hid/usbhid/hid-core.c:1427
 usb_probe_interface+0x5a0/0xaf0 drivers/usb/core/driver.c:396
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x284/0xc80 drivers/base/dd.c:595
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
 __device_attach+0x29b/0x460 drivers/base/dd.c:979
 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
 device_add+0xa00/0xfb0 drivers/base/core.c:3412
 usb_set_configuration+0x1991/0x1fd0 drivers/usb/core/message.c:2165
 usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238
 usb_probe_device+0x139/0x270 drivers/usb/core/driver.c:293
 call_driver_probe drivers/base/dd.c:-1 [inline]
 really_probe+0x284/0xc80 drivers/base/dd.c:595
 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755
 driver_probe_device+0x4f/0x420 drivers/base/dd.c:785
 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907
 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429
 __device_attach+0x29b/0x460 drivers/base/dd.c:979
 bus_probe_device+0xbc/0x1e0 drivers/base/bus.c:489
 device_add+0xa00/0xfb0 drivers/base/core.c:3412
 usb_new_device+0xd53/0x1640 drivers/usb/core/hub.c:2632
 hub_port_connect drivers/usb/core/hub.c:5497 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5637 [inline]
 port_event drivers/usb/core/hub.c:5799 [inline]
 hub_event+0x2dd9/0x5560 drivers/usb/core/hub.c:5881
 process_one_work+0x863/0x1000 kernel/workqueue.c:2310
 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Freed by task 4299:
 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+0xea/0x170 mm/slub.c:1736
 slab_free mm/slub.c:3504 [inline]
 kfree+0xef/0x2a0 mm/slub.c:4564
 release_nodes drivers/base/devres.c:501 [inline]
 devres_release_all+0x1a1/0x220 drivers/base/devres.c:530
 __device_release_driver drivers/base/dd.c:1231 [inline]
 device_release_driver_internal+0x4c3/0x750 drivers/base/dd.c:1262
 bus_remove_device+0x2e2/0x400 drivers/base/bus.c:531
 device_del+0x628/0xa70 drivers/base/core.c:3600
 hid_remove_device drivers/hid/hid-core.c:2519 [inline]
 hid_destroy_device+0x66/0x100 drivers/hid/hid-core.c:2538
 usbhid_disconnect+0x9b/0xc0 drivers/hid/usbhid/hid-core.c:1454
 usb_unbind_interface+0x1ee/0x860 drivers/usb/core/driver.c:458
 __device_release_driver drivers/base/dd.c:1229 [inline]
 device_release_driver_internal+0x4b4/0x750 drivers/base/dd.c:1262
 bus_remove_device+0x2e2/0x400 drivers/base/bus.c:531
 device_del+0x628/0xa70 drivers/base/core.c:3600
 usb_disable_device+0x3e2/0x890 drivers/usb/core/message.c:1414
 usb_disconnect+0x348/0x8a0 drivers/usb/core/hub.c:2287
 hub_port_connect drivers/usb/core/hub.c:5341 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5637 [inline]
 port_event drivers/usb/core/hub.c:5799 [inline]
 hub_event+0x1e9f/0x5560 drivers/usb/core/hub.c:5881
 process_one_work+0x863/0x1000 kernel/workqueue.c:2310
 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff88805811b400
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 232 bytes inside of
 512-byte region [ffff88805811b400, ffff88805811b600)
The buggy address belongs to the page:
page:ffffea0001604600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x58118
head:ffffea0001604600 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 0000000100000001 ffff888016841c80
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 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4351, ts 77730151249, free_ts 70560933113
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
 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+0x81e/0xdf0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 __kmalloc_node_track_caller+0x1fc/0x3a0 mm/slub.c:4963
 kmalloc_reserve net/core/skbuff.c:356 [inline]
 __alloc_skb+0x22c/0x750 net/core/skbuff.c:427
 alloc_skb include/linux/skbuff.h:1162 [inline]
 nlmsg_new include/net/netlink.h:953 [inline]
 inet6_ifa_notify net/ipv6/addrconf.c:5516 [inline]
 __ipv6_ifa_notify+0x1e5/0xda0 net/ipv6/addrconf.c:6172
 ipv6_ifa_notify net/ipv6/addrconf.c:6224 [inline]
 addrconf_dad_completed+0x179/0xca0 net/ipv6/addrconf.c:4236
 addrconf_dad_work+0xc70/0x1520 net/ipv6/addrconf.c:-1
 process_one_work+0x863/0x1000 kernel/workqueue.c:2310
 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457
 kthread+0x436/0x520 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
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+0x94/0x280 mm/page_alloc.c:3396
 __vunmap+0x8ab/0xa40 mm/vmalloc.c:2628
 kcov_put kernel/kcov.c:417 [inline]
 kcov_close+0x27/0x50 kernel/kcov.c:519
 __fput+0x234/0x930 fs/file_table.c:311
 task_work_run+0x125/0x1a0 kernel/task_work.c:188
 exit_task_work include/linux/task_work.h:33 [inline]
 do_exit+0x61e/0x20a0 kernel/exit.c:883
 do_group_exit+0x12e/0x300 kernel/exit.c:997
 get_signal+0x6ca/0x12c0 kernel/signal.c:2900
 arch_do_signal_or_restart+0xc1/0x1300 arch/x86/kernel/signal.c:867
 handle_signal_work kernel/entry/common.c:154 [inline]
 exit_to_user_mode_loop+0x9e/0x130 kernel/entry/common.c:178
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:214
 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Memory state around the buggy address:
 ffff88805811b380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88805811b400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88805811b480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                          ^
 ffff88805811b500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88805811b580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/09/15 16:46 linux-5.15.y 43bb85222e53 e2beed91 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/16 17:34 linux-5.15.y 0c935c049b5c e2826670 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/06 10:59 linux-5.15.y c16c81c81336 831e3629 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/06 10:26 linux-5.15.y c16c81c81336 831e3629 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/20 23:20 linux-5.15.y 0c935c049b5c 62330552 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/19 21:09 linux-5.15.y 0c935c049b5c e20d7b13 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/18 20:34 linux-5.15.y 0c935c049b5c 22a6c2b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/17 11:20 linux-5.15.y 0c935c049b5c 948c34e4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/16 05:26 linux-5.15.y 0c935c049b5c e2826670 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/10 21:00 linux-5.15.y c16c81c81336 16256247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/06 11:35 linux-5.15.y c16c81c81336 831e3629 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/06 06:55 linux-5.15.y c16c81c81336 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
2025/03/06 06:52 linux-5.15.y c16c81c81336 831e3629 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in steam_input_open
* Struck through repros no longer work on HEAD.