================================================================== BUG: KASAN: use-after-free in atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1503 [inline] BUG: KASAN: use-after-free in atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline] BUG: KASAN: use-after-free in __mutex_trylock_fast kernel/locking/mutex.c:173 [inline] BUG: KASAN: use-after-free in mutex_lock+0x7f/0xe0 kernel/locking/mutex.c:295 Write of size 8 at addr ffff8881de8b4440 by task udevd/475 CPU: 1 PID: 475 Comm: udevd Not tainted 5.4.292-syzkaller-05062-gcd8e74fa0fa3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack+0x1e/0x20 lib/dump_stack.c:77 dump_stack+0x15b/0x1b8 lib/dump_stack.c:118 print_address_description+0x8d/0x4c0 mm/kasan/report.c:384 __kasan_report+0xef/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 check_memory_region_inline mm/kasan/generic.c:141 [inline] check_memory_region+0x274/0x280 mm/kasan/generic.c:191 __kasan_check_write+0x14/0x20 mm/kasan/common.c:99 atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1503 [inline] atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline] __mutex_trylock_fast kernel/locking/mutex.c:173 [inline] mutex_lock+0x7f/0xe0 kernel/locking/mutex.c:295 steam_input_open+0x91/0x160 drivers/hid/hid-steam.c:297 input_open_device+0x14c/0x2a0 drivers/input/input.c:635 evdev_open_device drivers/input/evdev.c:400 [inline] evdev_open+0x494/0x590 drivers/input/evdev.c:486 chrdev_open+0x597/0x670 fs/char_dev.c:414 do_dentry_open+0x8b5/0x1030 fs/open.c:806 vfs_open+0x73/0x80 fs/open.c:920 do_last fs/namei.c:3565 [inline] path_openat+0x2a5e/0x35c0 fs/namei.c:3683 do_filp_open+0x1ae/0x3f0 fs/namei.c:3713 do_sys_open+0x2bb/0x5d0 fs/open.c:1123 __do_sys_openat fs/open.c:1150 [inline] __se_sys_openat fs/open.c:1144 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1144 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7fda16b769a4 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:00007fffa3f271f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fda16b769a4 RDX: 0000000000080000 RSI: 0000564012028b30 RDI: 00000000ffffff9c RBP: 0000564012028b30 R08: 0000564012056668 R09: fffffffffffffe98 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080000 R13: 00007fffa3f273b8 R14: 0000000000000000 R15: 00005640035a3ed5 Allocated by task 415: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x162/0x200 mm/kasan/common.c:529 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:537 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0x10d/0x2d0 mm/slub.c:4449 alloc_dr drivers/base/devres.c:103 [inline] devm_kmalloc+0x36/0x1e0 drivers/base/devres.c:816 devm_kzalloc include/linux/device.h:953 [inline] steam_probe+0x126/0xb00 drivers/hid/hid-steam.c:741 hid_device_probe+0x287/0x380 drivers/hid/hid-core.c:2296 really_probe+0x507/0xd20 drivers/base/dd.c:567 driver_probe_device+0xe7/0x190 drivers/base/dd.c:752 __device_attach_driver+0x27f/0x3f0 drivers/base/dd.c:864 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:432 __device_attach+0x290/0x370 drivers/base/dd.c:933 device_initial_probe+0x1a/0x20 drivers/base/dd.c:982 bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:492 device_add+0x91c/0xc90 drivers/base/core.c:2911 hid_add_device+0x356/0x4b0 drivers/hid/hid-core.c:2448 usbhid_probe+0xb2e/0xee0 drivers/hid/usbhid/hid-core.c:1418 usb_probe_interface+0x5ff/0xae0 drivers/usb/core/driver.c:361 really_probe+0x55b/0xd20 drivers/base/dd.c:571 driver_probe_device+0xe7/0x190 drivers/base/dd.c:752 __device_attach_driver+0x27f/0x3f0 drivers/base/dd.c:864 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:432 __device_attach+0x290/0x370 drivers/base/dd.c:933 device_initial_probe+0x1a/0x20 drivers/base/dd.c:982 bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:492 device_add+0x91c/0xc90 drivers/base/core.c:2911 usb_set_configuration+0x19d5/0x1f30 drivers/usb/core/message.c:2029 generic_probe+0x91/0x150 drivers/usb/core/generic.c:210 usb_probe_device+0xc1/0x100 drivers/usb/core/driver.c:266 really_probe+0x55b/0xd20 drivers/base/dd.c:571 driver_probe_device+0xe7/0x190 drivers/base/dd.c:752 __device_attach_driver+0x27f/0x3f0 drivers/base/dd.c:864 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:432 __device_attach+0x290/0x370 drivers/base/dd.c:933 device_initial_probe+0x1a/0x20 drivers/base/dd.c:982 bus_probe_device+0xc0/0x1e0 drivers/base/bus.c:492 device_add+0x91c/0xc90 drivers/base/core.c:2911 usb_new_device+0xcd1/0x1450 drivers/usb/core/hub.c:2592 hub_port_connect drivers/usb/core/hub.c:5225 [inline] hub_port_connect_change drivers/usb/core/hub.c:5344 [inline] port_event drivers/usb/core/hub.c:5490 [inline] hub_event+0x26e9/0x4780 drivers/usb/core/hub.c:5572 process_one_work+0x73b/0xcc0 kernel/workqueue.c:2290 worker_thread+0xa5c/0x13b0 kernel/workqueue.c:2436 kthread+0x31e/0x3a0 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 Freed by task 415: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1c3/0x280 mm/kasan/common.c:487 kasan_slab_free+0xe/0x10 mm/kasan/common.c:496 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0xb7/0x180 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kfree+0xbe/0x260 mm/slub.c:4071 release_nodes+0x716/0x790 drivers/base/devres.c:508 devres_release_all+0x7c/0xa0 drivers/base/devres.c:529 __device_release_driver drivers/base/dd.c:1191 [inline] device_release_driver_internal+0x4d3/0x710 drivers/base/dd.c:1220 device_release_driver+0x19/0x20 drivers/base/dd.c:1243 bus_remove_device+0x2dd/0x340 drivers/base/bus.c:534 device_del+0x660/0xfb0 drivers/base/core.c:3088 hid_remove_device drivers/hid/hid-core.c:2496 [inline] hid_destroy_device+0x6a/0x110 drivers/hid/hid-core.c:2515 usbhid_disconnect+0x9f/0xc0 drivers/hid/usbhid/hid-core.c:1445 usb_unbind_interface+0x212/0x8c0 drivers/usb/core/driver.c:423 __device_release_driver drivers/base/dd.c:1188 [inline] device_release_driver_internal+0x4c4/0x710 drivers/base/dd.c:1220 device_release_driver+0x19/0x20 drivers/base/dd.c:1243 bus_remove_device+0x2dd/0x340 drivers/base/bus.c:534 device_del+0x660/0xfb0 drivers/base/core.c:3088 usb_disable_device+0x3a8/0x750 drivers/usb/core/message.c:1277 usb_disconnect+0x31e/0x850 drivers/usb/core/hub.c:2248 hub_port_connect drivers/usb/core/hub.c:5068 [inline] hub_port_connect_change drivers/usb/core/hub.c:5344 [inline] port_event drivers/usb/core/hub.c:5490 [inline] hub_event+0x18e9/0x4780 drivers/usb/core/hub.c:5572 process_one_work+0x73b/0xcc0 kernel/workqueue.c:2290 process_scheduled_works kernel/workqueue.c:2352 [inline] worker_thread+0xd82/0x13b0 kernel/workqueue.c:2438 kthread+0x31e/0x3a0 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 The buggy address belongs to the object at ffff8881de8b4400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 64 bytes inside of 512-byte region [ffff8881de8b4400, ffff8881de8b4600) The buggy address belongs to the page: page:ffffea00077a2d00 refcount:1 mapcount:0 mapping:ffff8881f5c02500 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 ffffea00077bea00 0000000300000003 ffff8881f5c02500 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) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x35e/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x1296/0x1310 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x202/0x4b0 mm/page_alloc.c:4894 alloc_slab_page+0x3c/0x3b0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x93/0x420 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x29e/0x420 mm/slub.c:2667 __slab_alloc+0x63/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc_trace+0x130/0x290 mm/slub.c:2854 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] __do_execve_file+0x28d/0x1010 fs/exec.c:1798 do_execveat_common fs/exec.c:1928 [inline] do_execve fs/exec.c:1945 [inline] __do_sys_execve fs/exec.c:2021 [inline] __se_sys_execve fs/exec.c:2016 [inline] __x64_sys_execve+0x94/0xb0 fs/exec.c:2016 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 page_owner free stack trace missing Memory state around the buggy address: ffff8881de8b4300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881de8b4380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881de8b4400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881de8b4480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881de8b4500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== hid 0003:28DE:1102.0008: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0008: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0008: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0008: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0008: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0021: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0021: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0021: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0021: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0021: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002D: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002D: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002D: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002D: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002D: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002B: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002B: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002B: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002B: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002B: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002D: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002D: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002D: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.002D: No HID_FEATURE_REPORT submitted - nothing to read