================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:102 [inline] BUG: KASAN: use-after-free in atomic_long_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1779 [inline] BUG: KASAN: use-after-free in __mutex_trylock_fast kernel/locking/mutex.c:176 [inline] BUG: KASAN: use-after-free in mutex_lock+0x80/0x1a0 kernel/locking/mutex.c:295 Write of size 8 at addr ffff888110972c50 by task udevd/452 CPU: 0 PID: 452 Comm: udevd Not tainted 6.1.134-syzkaller-1169248-g7b89b57429c2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x71/0x210 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:427 kasan_report+0x122/0x150 mm/kasan/report.c:531 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x280/0x290 mm/kasan/generic.c:189 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:102 [inline] atomic_long_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1779 [inline] __mutex_trylock_fast kernel/locking/mutex.c:176 [inline] mutex_lock+0x80/0x1a0 kernel/locking/mutex.c:295 steam_input_open+0x91/0x160 drivers/hid/hid-steam.c:297 input_open_device+0x17b/0x300 drivers/input/input.c:650 evdev_open_device drivers/input/evdev.c:400 [inline] evdev_open+0x4b1/0x5c0 drivers/input/evdev.c:487 chrdev_open+0x5a5/0x680 fs/char_dev.c:414 do_dentry_open+0x88e/0x1260 fs/open.c:884 vfs_open+0x73/0x80 fs/open.c:1015 do_open fs/namei.c:3625 [inline] path_openat+0x2681/0x2f50 fs/namei.c:3782 do_filp_open+0x1c1/0x3c0 fs/namei.c:3809 do_sys_openat2+0x185/0x7e0 fs/open.c:1341 do_sys_open fs/open.c:1357 [inline] __do_sys_openat fs/open.c:1373 [inline] __se_sys_openat fs/open.c:1368 [inline] __x64_sys_openat+0x136/0x160 fs/open.c:1368 x64_sys_call+0x783/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fab3ed169a4 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:00007ffeeadb9c20 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fab3ed169a4 RDX: 0000000000080000 RSI: 000055f2df3463f0 RDI: 00000000ffffff9c RBP: 000055f2df3463f0 R08: 000055f2df3454e8 R09: 00007fab3edf1b10 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080000 R13: 00007ffeeadb9de8 R14: 0000000000000000 R15: 000055f2adfceed5 Allocated by task 39: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x25/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:388 kasan_kmalloc include/linux/kasan.h:212 [inline] __do_kmalloc_node mm/slab_common.c:938 [inline] __kmalloc_node_track_caller+0xb1/0x1e0 mm/slab_common.c:958 alloc_dr drivers/base/devres.c:116 [inline] devm_kmalloc+0x55/0x160 drivers/base/devres.c:826 devm_kzalloc include/linux/device.h:211 [inline] steam_probe+0x11b/0xb50 drivers/hid/hid-steam.c:741 hid_device_probe+0x268/0x390 drivers/hid/hid-core.c:2626 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x2cb/0x960 drivers/base/dd.c:639 __driver_probe_device+0x198/0x280 drivers/base/dd.c:808 driver_probe_device+0x54/0x3e0 drivers/base/dd.c:838 __device_attach_driver+0x2e9/0x4a0 drivers/base/dd.c:966 bus_for_each_drv+0x183/0x210 drivers/base/bus.c:429 __device_attach+0x2a2/0x400 drivers/base/dd.c:1038 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1087 bus_probe_device+0xc0/0x1f0 drivers/base/bus.c:489 device_add+0xb4d/0xef0 drivers/base/core.c:3698 hid_add_device+0x38f/0x540 drivers/hid/hid-core.c:2778 usbhid_probe+0xbb6/0xfa0 drivers/hid/usbhid/hid-core.c:1424 usb_probe_interface+0x610/0xaf0 drivers/usb/core/driver.c:397 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x2cb/0x960 drivers/base/dd.c:639 __driver_probe_device+0x198/0x280 drivers/base/dd.c:808 driver_probe_device+0x54/0x3e0 drivers/base/dd.c:838 __device_attach_driver+0x2e9/0x4a0 drivers/base/dd.c:966 bus_for_each_drv+0x183/0x210 drivers/base/bus.c:429 __device_attach+0x2a2/0x400 drivers/base/dd.c:1038 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1087 bus_probe_device+0xc0/0x1f0 drivers/base/bus.c:489 device_add+0xb4d/0xef0 drivers/base/core.c:3698 usb_set_configuration+0x19c2/0x1f10 drivers/usb/core/message.c:2165 usb_generic_driver_probe+0x91/0x150 drivers/usb/core/generic.c:238 usb_probe_device+0x159/0x270 drivers/usb/core/driver.c:294 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x2cb/0x960 drivers/base/dd.c:639 __driver_probe_device+0x198/0x280 drivers/base/dd.c:808 driver_probe_device+0x54/0x3e0 drivers/base/dd.c:838 __device_attach_driver+0x2e9/0x4a0 drivers/base/dd.c:966 bus_for_each_drv+0x183/0x210 drivers/base/bus.c:429 __device_attach+0x2a2/0x400 drivers/base/dd.c:1038 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1087 bus_probe_device+0xc0/0x1f0 drivers/base/bus.c:489 device_add+0xb4d/0xef0 drivers/base/core.c:3698 usb_new_device+0xa70/0x1520 drivers/usb/core/hub.c:2656 hub_port_connect drivers/usb/core/hub.c:5566 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5866 [inline] hub_event+0x2a5d/0x4680 drivers/usb/core/hub.c:5948 process_one_work+0x71f/0xc40 kernel/workqueue.c:2299 worker_thread+0xa29/0x11f0 kernel/workqueue.c:2446 kthread+0x281/0x320 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Freed by task 39: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x31/0x50 mm/kasan/generic.c:516 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1771 slab_free mm/slub.c:3686 [inline] __kmem_cache_free+0xb7/0x1b0 mm/slub.c:3702 kfree+0x6f/0xf0 mm/slab_common.c:990 release_nodes+0xf9/0x230 drivers/base/devres.c:503 devres_release_all+0x149/0x1b0 drivers/base/devres.c:532 device_unbind_cleanup drivers/base/dd.c:530 [inline] __device_release_driver drivers/base/dd.c:1288 [inline] device_release_driver_internal+0x581/0x820 drivers/base/dd.c:1309 device_release_driver+0x19/0x20 drivers/base/dd.c:1332 bus_remove_device+0x2ee/0x350 drivers/base/bus.c:531 device_del+0x6a4/0xeb0 drivers/base/core.c:3886 hid_remove_device drivers/hid/hid-core.c:2826 [inline] hid_destroy_device+0x6a/0x110 drivers/hid/hid-core.c:2845 usbhid_disconnect+0x9f/0xc0 drivers/hid/usbhid/hid-core.c:1451 usb_unbind_interface+0x223/0x8d0 drivers/usb/core/driver.c:459 device_remove drivers/base/dd.c:550 [inline] __device_release_driver drivers/base/dd.c:1283 [inline] device_release_driver_internal+0x508/0x820 drivers/base/dd.c:1309 device_release_driver+0x19/0x20 drivers/base/dd.c:1332 bus_remove_device+0x2ee/0x350 drivers/base/bus.c:531 device_del+0x6a4/0xeb0 drivers/base/core.c:3886 usb_disable_device+0x3a8/0x750 drivers/usb/core/message.c:1414 usb_disconnect+0x31e/0x860 drivers/usb/core/hub.c:2311 hub_port_connect drivers/usb/core/hub.c:5405 [inline] hub_port_connect_change drivers/usb/core/hub.c:5706 [inline] port_event drivers/usb/core/hub.c:5866 [inline] hub_event+0x1bd5/0x4680 drivers/usb/core/hub.c:5948 process_one_work+0x71f/0xc40 kernel/workqueue.c:2299 process_scheduled_works kernel/workqueue.c:2362 [inline] worker_thread+0xd2e/0x11f0 kernel/workqueue.c:2448 kthread+0x281/0x320 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888110972c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 80 bytes inside of 512-byte region [ffff888110972c00, ffff888110972e00) The buggy address belongs to the physical page: page:ffffea0004425c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x110970 head:ffffea0004425c00 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 105, tgid 105 (udevd), ts 5282871293, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2637 prep_new_page+0x1c/0x110 mm/page_alloc.c:2644 get_page_from_freelist+0x2c6e/0x2ce0 mm/page_alloc.c:4539 __alloc_pages+0x19e/0x3a0 mm/page_alloc.c:5838 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1 allocate_slab mm/slub.c:1962 [inline] new_slab+0x98/0x3d0 mm/slub.c:2015 ___slab_alloc+0x6f6/0xb50 mm/slub.c:3203 __slab_alloc+0x5e/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] __kmem_cache_alloc_node+0x203/0x2c0 mm/slub.c:3462 __do_kmalloc_node mm/slab_common.c:937 [inline] __kmalloc_node_track_caller+0xa0/0x1e0 mm/slab_common.c:958 kmalloc_reserve net/core/skbuff.c:446 [inline] __alloc_skb+0x224/0x7e0 net/core/skbuff.c:515 alloc_skb include/linux/skbuff.h:1290 [inline] alloc_skb_with_frags+0xa8/0x620 net/core/skbuff.c:6162 sock_alloc_send_pskb+0x853/0x980 net/core/sock.c:2756 unix_dgram_sendmsg+0x57e/0x18e0 net/unix/af_unix.c:1920 sock_sendmsg_nosec net/socket.c:716 [inline] __sock_sendmsg net/socket.c:728 [inline] sock_write_iter+0x2ca/0x3b0 net/socket.c:1133 call_write_iter include/linux/fs.h:2274 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x5db/0xca0 fs/read_write.c:584 page_owner free stack trace missing Memory state around the buggy address: ffff888110972b00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888110972b80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888110972c00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888110972c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888110972d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== hid 0003:28DE:1102.000B: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.000B: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.000B: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.000B: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.000B: No HID_FEATURE_REPORT submitted - nothing to read