syzbot


KASAN: use-after-free Read in steam_input_open

Status: upstream: reported C repro on 2025/03/06 15:18
Reported-by: syzbot+541ce19a7f6f4e686cbc@syzkaller.appspotmail.com
First crash: 5d20h, last: 3h30m
Bug presence (1)
Date Name Commit Repro Result
2025/03/06 upstream (ToT) f315296c92fd C Failed due to an error; will retry later
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in steam_input_open C 6 1d14h 6d04h 0/3 upstream: reported C repro on 2025/03/06 06:53
android-54 KASAN: use-after-free Write in steam_input_open C 22 10h46m 16d 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 C done 5 4d11h 17d 22/28 upstream: reported C repro on 2025/02/22 17:01
android-5-15 KASAN: use-after-free Write in steam_input_open origin:lts C 42 9h06m 185d 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 C 32 10h01m 168d 0/2 upstream: reported C repro on 2024/09/25 04:26
android-5-10 KASAN: use-after-free Write in steam_input_open C inconclusive 10 3d12h 190d 0/2 upstream: reported C repro on 2024/09/03 09:12

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __mutex_lock_common kernel/locking/mutex.c:582 [inline]
BUG: KASAN: use-after-free in __mutex_lock+0xfa/0xd80 kernel/locking/mutex.c:747
Read of size 8 at addr ffff88807812bce8 by task udevd/4275

CPU: 0 PID: 4275 Comm: udevd Not tainted 6.1.129-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:427
 kasan_report+0x136/0x160 mm/kasan/report.c:531
 __mutex_lock_common kernel/locking/mutex.c:582 [inline]
 __mutex_lock+0xfa/0xd80 kernel/locking/mutex.c:747
 steam_input_open+0x93/0x1b0 drivers/hid/hid-steam.c:297
 input_open_device+0x188/0x2d0 drivers/input/input.c:650
 evdev_open_device drivers/input/evdev.c:400 [inline]
 evdev_open+0x3ed/0x600 drivers/input/evdev.c:487
 chrdev_open+0x54a/0x630 fs/char_dev.c:414
 do_dentry_open+0x7f9/0x10f0 fs/open.c:882
 do_open fs/namei.c:3626 [inline]
 path_openat+0x2644/0x2e60 fs/namei.c:3783
 do_filp_open+0x230/0x480 fs/namei.c:3810
 do_sys_openat2+0x13b/0x4f0 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1345
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f3008d169a4
Code: 24 20 48 8d 44 24 30 48 89 44 24 28 64 8b 04 25 18 00 00 00 85 c0 75 2c 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 76 60 48 8b 15 55 a4 0d 00 f7 d8 64 89 02 48 83
RSP: 002b:00007ffd9b190da0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f3008d169a4
RDX: 0000000000080000 RSI: 000055c8498cf5c0 RDI: 00000000ffffff9c
RBP: 000055c8498cf5c0 R08: 000055c8498ee7d8 R09: 00007f3008df1b10
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080000
R13: 00007ffd9b190f68 R14: 0000000000000000 R15: 000055c8260d9ed5
 </TASK>

Allocated by task 1581:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383
 kasan_kmalloc include/linux/kasan.h:211 [inline]
 __do_kmalloc_node mm/slab_common.c:936 [inline]
 __kmalloc_node_track_caller+0xb1/0x220 mm/slab_common.c:956
 alloc_dr drivers/base/devres.c:116 [inline]
 devm_kmalloc+0x7c/0x2b0 drivers/base/devres.c:826
 devm_kzalloc include/linux/device.h:210 [inline]
 steam_probe+0x12e/0xc10 drivers/hid/hid-steam.c:741
 hid_device_probe+0x298/0x3a0 drivers/hid/hid-core.c:2632
 really_probe+0x2ab/0xcb0 drivers/base/dd.c:639
 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785
 driver_probe_device+0x50/0x420 drivers/base/dd.c:815
 __device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:429
 __device_attach+0x359/0x570 drivers/base/dd.c:1015
 bus_probe_device+0xba/0x1e0 drivers/base/bus.c:489
 device_add+0xb48/0xfd0 drivers/base/core.c:3696
 hid_add_device+0x3a5/0x510 drivers/hid/hid-core.c:2784
 usbhid_probe+0xc09/0xfc0 drivers/hid/usbhid/hid-core.c:1424
 usb_probe_interface+0x5c0/0xaf0 drivers/usb/core/driver.c:396
 really_probe+0x2ab/0xcb0 drivers/base/dd.c:639
 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785
 driver_probe_device+0x50/0x420 drivers/base/dd.c:815
 __device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:429
 __device_attach+0x359/0x570 drivers/base/dd.c:1015
 bus_probe_device+0xba/0x1e0 drivers/base/bus.c:489
 device_add+0xb48/0xfd0 drivers/base/core.c:3696
 usb_set_configuration+0x19dd/0x2020 drivers/usb/core/message.c:2165
 usb_generic_driver_probe+0x84/0x140 drivers/usb/core/generic.c:238
 usb_probe_device+0x130/0x260 drivers/usb/core/driver.c:293
 really_probe+0x2ab/0xcb0 drivers/base/dd.c:639
 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:785
 driver_probe_device+0x50/0x420 drivers/base/dd.c:815
 __device_attach_driver+0x2cf/0x510 drivers/base/dd.c:943
 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:429
 __device_attach+0x359/0x570 drivers/base/dd.c:1015
 bus_probe_device+0xba/0x1e0 drivers/base/bus.c:489
 device_add+0xb48/0xfd0 drivers/base/core.c:3696
 usb_new_device+0xbdd/0x1900 drivers/usb/core/hub.c:2631
 hub_port_connect drivers/usb/core/hub.c:5489 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5629 [inline]
 port_event drivers/usb/core/hub.c:5785 [inline]
 hub_event+0x2efe/0x5730 drivers/usb/core/hub.c:5867
 process_one_work+0x917/0x1260 kernel/workqueue.c:2292
 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Freed by task 22:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1724 [inline]
 slab_free_freelist_hook mm/slub.c:1750 [inline]
 slab_free mm/slub.c:3661 [inline]
 __kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674
 release_nodes drivers/base/devres.c:503 [inline]
 devres_release_all+0x1c1/0x240 drivers/base/devres.c:532
 device_unbind_cleanup drivers/base/dd.c:530 [inline]
 __device_release_driver drivers/base/dd.c:1265 [inline]
 device_release_driver_internal+0x5bf/0x880 drivers/base/dd.c:1286
 bus_remove_device+0x2e5/0x400 drivers/base/bus.c:531
 device_del+0x6e2/0xbd0 drivers/base/core.c:3884
 hid_remove_device drivers/hid/hid-core.c:2833 [inline]
 hid_destroy_device+0x64/0x100 drivers/hid/hid-core.c:2852
 usbhid_disconnect+0x9a/0xc0 drivers/hid/usbhid/hid-core.c:1451
 usb_unbind_interface+0x1cd/0x840 drivers/usb/core/driver.c:458
 device_remove drivers/base/dd.c:550 [inline]
 __device_release_driver drivers/base/dd.c:1260 [inline]
 device_release_driver_internal+0x59e/0x880 drivers/base/dd.c:1286
 bus_remove_device+0x2e5/0x400 drivers/base/bus.c:531
 device_del+0x6e2/0xbd0 drivers/base/core.c:3884
 usb_disable_device+0x3b8/0x840 drivers/usb/core/message.c:1414
 usb_disconnect+0x33c/0x8c0 drivers/usb/core/hub.c:2286
 hub_port_connect drivers/usb/core/hub.c:5333 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5629 [inline]
 port_event drivers/usb/core/hub.c:5785 [inline]
 hub_event+0x1f78/0x5730 drivers/usb/core/hub.c:5867
 process_one_work+0x917/0x1260 kernel/workqueue.c:2292
 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff88807812bc00
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 232 bytes inside of
 512-byte region [ffff88807812bc00, ffff88807812be00)

The buggy address belongs to the physical page:
page:ffffea0001e04a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78128
head:ffffea0001e04a00 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00007bc500 dead000000000002 ffff888017c41c80
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 3636, tgid 3636 (udevd), ts 27177591159, free_ts 23041594463
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2532
 prep_new_page mm/page_alloc.c:2539 [inline]
 get_page_from_freelist+0x3731/0x38d0 mm/page_alloc.c:4328
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5605
 alloc_slab_page+0x6a/0x150 mm/slub.c:1794
 allocate_slab mm/slub.c:1939 [inline]
 new_slab+0x84/0x2d0 mm/slub.c:1992
 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180
 __slab_alloc mm/slub.c:3279 [inline]
 slab_alloc_node mm/slub.c:3364 [inline]
 __kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437
 __do_kmalloc_node mm/slab_common.c:935 [inline]
 __kmalloc_node_track_caller+0xa0/0x220 mm/slab_common.c:956
 kmalloc_reserve net/core/skbuff.c:446 [inline]
 __alloc_skb+0x12a/0x2c0 net/core/skbuff.c:515
 alloc_skb include/linux/skbuff.h:1271 [inline]
 netlink_alloc_large_skb net/netlink/af_netlink.c:1183 [inline]
 netlink_sendmsg+0x6f8/0xd60 net/netlink/af_netlink.c:1834
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 ____sys_sendmsg+0x5d3/0x9a0 net/socket.c:2519
 ___sys_sendmsg net/socket.c:2573 [inline]
 __sys_sendmsg+0x2a9/0x390 net/socket.c:2602
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1459 [inline]
 free_pcp_prepare mm/page_alloc.c:1509 [inline]
 free_unref_page_prepare+0x12a6/0x15b0 mm/page_alloc.c:3384
 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3479
 free_contig_range+0x9a/0x150 mm/page_alloc.c:9565
 destroy_args+0xfe/0x997 mm/debug_vm_pgtable.c:1031
 debug_vm_pgtable+0x46d/0x4c2 mm/debug_vm_pgtable.c:1354
 do_one_initcall+0x265/0x8f0 init/main.c:1298
 do_initcall_level+0x157/0x207 init/main.c:1371
 do_initcalls+0x49/0x86 init/main.c:1387
 kernel_init_freeable+0x45c/0x60f init/main.c:1626
 kernel_init+0x19/0x290 init/main.c:1514
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Memory state around the buggy address:
 ffff88807812bb80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88807812bc00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807812bc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                          ^
 ffff88807812bd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88807812bd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/03/07 08:37 linux-6.1.y 3a8358583626 831e3629 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in steam_input_open
2025/03/06 16:17 linux-6.1.y 3a8358583626 831e3629 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in steam_input_open
2025/03/06 15:29 linux-6.1.y 3a8358583626 831e3629 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in steam_input_open
2025/03/06 15:17 linux-6.1.y 3a8358583626 831e3629 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in steam_input_open
2025/03/12 08:04 linux-6.1.y 6ae7ac5c4251 ee70e6db .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in steam_input_open
* Struck through repros no longer work on HEAD.