================================================================== 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+0x98/0x110 kernel/locking/mutex.c:295 Write of size 8 at addr ffff8881df166040 by task udevd/615 CPU: 0 PID: 615 Comm: udevd Not tainted 5.4.290-syzkaller-05053-g41adfeb3d639 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/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+0x272/0x280 mm/kasan/generic.c:191 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+0x98/0x110 kernel/locking/mutex.c:295 steam_input_open+0x91/0x1a0 drivers/hid/hid-steam.c:297 input_open_device+0x145/0x280 drivers/input/input.c:635 evdev_open_device drivers/input/evdev.c:400 [inline] evdev_open+0x396/0x590 drivers/input/evdev.c:486 chrdev_open+0x54a/0x630 fs/char_dev.c:414 do_dentry_open+0x964/0x1130 fs/open.c:806 do_last fs/namei.c:3565 [inline] path_openat+0x29bf/0x34b0 fs/namei.c:3683 do_filp_open+0x20b/0x450 fs/namei.c:3713 do_sys_open+0x39c/0x810 fs/open.c:1123 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7fb75a0c49a4 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:00007fffb9b28ce0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb75a0c49a4 RDX: 0000000000080000 RSI: 00005596acec4ed0 RDI: 00000000ffffff9c RBP: 00005596acec4ed0 R08: 00005596acebb2a8 R09: fffffffffffffe98 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080000 R13: 00007fffb9b28ea8 R14: 0000000000000000 R15: 0000559695251ed5 Allocated by task 461: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 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+0x100/0x2b0 mm/slub.c:4449 alloc_dr drivers/base/devres.c:103 [inline] devm_kmalloc+0x34/0x1d0 drivers/base/devres.c:816 devm_kzalloc include/linux/device.h:953 [inline] steam_probe+0x11a/0xa70 drivers/hid/hid-steam.c:741 hid_device_probe+0x2ac/0x3b0 drivers/hid/hid-core.c:2294 really_probe+0x496/0xb80 drivers/base/dd.c:567 driver_probe_device+0xe5/0x240 drivers/base/dd.c:752 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:432 __device_attach+0x31c/0x490 drivers/base/dd.c:933 bus_probe_device+0xbd/0x1e0 drivers/base/bus.c:492 device_add+0x88d/0xbb0 drivers/base/core.c:2911 hid_add_device+0x37f/0x4c0 drivers/hid/hid-core.c:2446 usbhid_probe+0xafd/0xea0 drivers/hid/usbhid/hid-core.c:1418 usb_probe_interface+0x5aa/0xa90 drivers/usb/core/driver.c:361 really_probe+0x4dd/0xb80 drivers/base/dd.c:571 driver_probe_device+0xe5/0x240 drivers/base/dd.c:752 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:432 __device_attach+0x31c/0x490 drivers/base/dd.c:933 bus_probe_device+0xbd/0x1e0 drivers/base/bus.c:492 device_add+0x88d/0xbb0 drivers/base/core.c:2911 usb_set_configuration+0x18ce/0x1e30 drivers/usb/core/message.c:2029 generic_probe+0x84/0x140 drivers/usb/core/generic.c:210 really_probe+0x4dd/0xb80 drivers/base/dd.c:571 driver_probe_device+0xe5/0x240 drivers/base/dd.c:752 bus_for_each_drv+0x183/0x200 drivers/base/bus.c:432 __device_attach+0x31c/0x490 drivers/base/dd.c:933 bus_probe_device+0xbd/0x1e0 drivers/base/bus.c:492 device_add+0x88d/0xbb0 drivers/base/core.c:2911 usb_new_device+0xbbc/0x1760 drivers/usb/core/hub.c:2581 hub_port_connect drivers/usb/core/hub.c:5214 [inline] hub_port_connect_change drivers/usb/core/hub.c:5333 [inline] port_event drivers/usb/core/hub.c:5479 [inline] hub_event+0x2c62/0x4d50 drivers/usb/core/hub.c:5561 process_one_work+0x765/0xd20 kernel/workqueue.c:2290 worker_thread+0xaef/0x1470 kernel/workqueue.c:2436 kthread+0x2da/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 Freed by task 461: 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+0x1b5/0x270 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kfree+0x123/0x370 mm/slub.c:4071 release_nodes+0x85a/0x8e0 drivers/base/devres.c:508 __device_release_driver drivers/base/dd.c:1191 [inline] device_release_driver_internal+0x519/0x7b0 drivers/base/dd.c:1220 bus_remove_device+0x2ca/0x340 drivers/base/bus.c:534 device_del+0x65a/0xfa0 drivers/base/core.c:3088 hid_remove_device drivers/hid/hid-core.c:2494 [inline] hid_destroy_device+0x64/0x100 drivers/hid/hid-core.c:2513 usbhid_disconnect+0x9a/0xc0 drivers/hid/usbhid/hid-core.c:1445 usb_unbind_interface+0x1d0/0x840 drivers/usb/core/driver.c:423 __device_release_driver drivers/base/dd.c:1188 [inline] device_release_driver_internal+0x50a/0x7b0 drivers/base/dd.c:1220 bus_remove_device+0x2ca/0x340 drivers/base/bus.c:534 device_del+0x65a/0xfa0 drivers/base/core.c:3088 usb_disable_device+0x38c/0x750 drivers/usb/core/message.c:1277 usb_disconnect+0x32c/0x890 drivers/usb/core/hub.c:2237 hub_port_connect drivers/usb/core/hub.c:5057 [inline] hub_port_connect_change drivers/usb/core/hub.c:5333 [inline] port_event drivers/usb/core/hub.c:5479 [inline] hub_event+0x1c75/0x4d50 drivers/usb/core/hub.c:5561 process_one_work+0x765/0xd20 kernel/workqueue.c:2290 process_scheduled_works kernel/workqueue.c:2352 [inline] worker_thread+0xe02/0x1470 kernel/workqueue.c:2438 kthread+0x2da/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 The buggy address belongs to the object at ffff8881df166000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 64 bytes inside of 512-byte region [ffff8881df166000, ffff8881df166200) The buggy address belongs to the page: page:ffffea00077c5900 refcount:1 mapcount:0 mapping:ffff8881f5c02500 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 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+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc_trace+0x12d/0x260 mm/slub.c:2854 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] bpf_prog_alloc_no_stats+0xc7/0x240 kernel/bpf/core.c:92 bpf_prog_alloc+0x1a/0x1e0 kernel/bpf/core.c:114 bpf_prog_create_from_user+0xa0/0x3d0 net/core/filter.c:1394 seccomp_prepare_filter kernel/seccomp.c:631 [inline] seccomp_prepare_user_filter kernel/seccomp.c:668 [inline] seccomp_set_mode_filter kernel/seccomp.c:1636 [inline] do_seccomp+0x8b8/0x15e0 kernel/seccomp.c:1756 __do_sys_prctl kernel/sys.c:2505 [inline] __se_sys_prctl+0x34e/0x29c0 kernel/sys.c:2423 do_syscall_64+0xca/0x1c0 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: ffff8881df165f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881df165f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881df166000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881df166080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881df166100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== hid 0003:28DE:1102.0001: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0001: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0001: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0001: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0001: No HID_FEATURE_REPORT submitted - nothing to read