================================================================== 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:171 [inline] BUG: KASAN: use-after-free in mutex_lock+0x98/0x110 kernel/locking/mutex.c:285 Write of size 8 at addr ffff888118faf850 by task udevd/524 CPU: 1 PID: 524 Comm: udevd Not tainted 6.1.99-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:395 kasan_report+0x13c/0x170 mm/kasan/report.c:495 kasan_check_range+0x294/0x2a0 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:171 [inline] mutex_lock+0x98/0x110 kernel/locking/mutex.c:285 steam_input_open+0x91/0x1a0 drivers/hid/hid-steam.c:297 input_open_device+0x1a5/0x310 drivers/input/input.c:650 evdev_open_device drivers/input/evdev.c:400 [inline] evdev_open+0x3dc/0x610 drivers/input/evdev.c:487 chrdev_open+0x4f7/0x620 fs/char_dev.c:414 do_dentry_open+0x88d/0x1150 fs/open.c:882 vfs_open+0x73/0x80 fs/open.c:1013 do_open fs/namei.c:3628 [inline] path_openat+0x2532/0x2d60 fs/namei.c:3785 do_filp_open+0x230/0x480 fs/namei.c:3812 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 x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 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:0x7f09295839a4 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:00007ffe0f3cb150 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f09295839a4 RDX: 0000000000080000 RSI: 000055f13a264d70 RDI: 00000000ffffff9c RBP: 000055f13a264d70 R08: 000055f13a2760b8 R09: fffffffffffffe98 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080000 R13: 00007ffe0f3cb318 R14: 0000000000000000 R15: 000055f138c81ed5 Allocated by task 40: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x9c/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc_node_track_caller+0xb3/0x1e0 mm/slab_common.c:975 alloc_dr drivers/base/devres.c:116 [inline] devm_kmalloc+0x55/0x180 drivers/base/devres.c:825 devm_kzalloc include/linux/device.h:210 [inline] steam_probe+0x12e/0xbd0 drivers/hid/hid-steam.c:741 hid_device_probe+0x286/0x390 drivers/hid/hid-core.c:2630 really_probe+0x2af/0x910 drivers/base/dd.c:639 __driver_probe_device+0x19d/0x310 drivers/base/dd.c:785 driver_probe_device+0x54/0x3d0 drivers/base/dd.c:815 __device_attach_driver+0x2e3/0x490 drivers/base/dd.c:943 bus_for_each_drv+0x182/0x200 drivers/base/bus.c:427 __device_attach+0x309/0x500 drivers/base/dd.c:1015 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1064 bus_probe_device+0xbb/0x1d0 drivers/base/bus.c:487 device_add+0xb51/0xef0 drivers/base/core.c:3689 hid_add_device+0x3ad/0x510 drivers/hid/hid-core.c:2782 usbhid_probe+0xc1c/0xff0 drivers/hid/usbhid/hid-core.c:1424 usb_probe_interface+0x5b0/0xa80 drivers/usb/core/driver.c:396 really_probe+0x2af/0x910 drivers/base/dd.c:639 __driver_probe_device+0x19d/0x310 drivers/base/dd.c:785 driver_probe_device+0x54/0x3d0 drivers/base/dd.c:815 __device_attach_driver+0x2e3/0x490 drivers/base/dd.c:943 bus_for_each_drv+0x182/0x200 drivers/base/bus.c:427 __device_attach+0x309/0x500 drivers/base/dd.c:1015 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1064 bus_probe_device+0xbb/0x1d0 drivers/base/bus.c:487 device_add+0xb51/0xef0 drivers/base/core.c:3689 usb_set_configuration+0x190c/0x1e70 drivers/usb/core/message.c:2165 usb_generic_driver_probe+0x8b/0x150 drivers/usb/core/generic.c:238 usb_probe_device+0x13e/0x260 drivers/usb/core/driver.c:293 really_probe+0x2af/0x910 drivers/base/dd.c:639 __driver_probe_device+0x19d/0x310 drivers/base/dd.c:785 driver_probe_device+0x54/0x3d0 drivers/base/dd.c:815 __device_attach_driver+0x2e3/0x490 drivers/base/dd.c:943 bus_for_each_drv+0x182/0x200 drivers/base/bus.c:427 __device_attach+0x309/0x500 drivers/base/dd.c:1015 device_initial_probe+0x1a/0x20 drivers/base/dd.c:1064 bus_probe_device+0xbb/0x1d0 drivers/base/bus.c:487 device_add+0xb51/0xef0 drivers/base/core.c:3689 usb_new_device+0xf2f/0x1820 drivers/usb/core/hub.c:2620 hub_port_connect drivers/usb/core/hub.c:5477 [inline] hub_port_connect_change drivers/usb/core/hub.c:5617 [inline] port_event drivers/usb/core/hub.c:5773 [inline] hub_event+0x2c50/0x4d00 drivers/usb/core/hub.c:5855 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2292 worker_thread+0xa5d/0x1260 kernel/workqueue.c:2439 kthread+0x26d/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Freed by task 40: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:236 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:244 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+0x218/0x3b0 mm/slub.c:3674 kfree+0x7a/0xf0 mm/slab_common.c:1007 release_nodes+0xf1/0x230 drivers/base/devres.c:503 devres_release_all+0x148/0x1a0 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+0x5af/0x850 drivers/base/dd.c:1286 device_release_driver+0x19/0x20 drivers/base/dd.c:1309 bus_remove_device+0x2ea/0x350 drivers/base/bus.c:529 device_del+0x61a/0xe80 drivers/base/core.c:3877 hid_remove_device drivers/hid/hid-core.c:2831 [inline] hid_destroy_device+0x68/0x110 drivers/hid/hid-core.c:2850 usbhid_disconnect+0x9e/0xc0 drivers/hid/usbhid/hid-core.c:1451 usb_unbind_interface+0x1f4/0x8b0 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+0x532/0x850 drivers/base/dd.c:1286 device_release_driver+0x19/0x20 drivers/base/dd.c:1309 bus_remove_device+0x2ea/0x350 drivers/base/bus.c:529 device_del+0x61a/0xe80 drivers/base/core.c:3877 usb_disable_device+0x380/0x720 drivers/usb/core/message.c:1414 usb_disconnect+0x32a/0x890 drivers/usb/core/hub.c:2275 hub_port_connect drivers/usb/core/hub.c:5321 [inline] hub_port_connect_change drivers/usb/core/hub.c:5617 [inline] port_event drivers/usb/core/hub.c:5773 [inline] hub_event+0x1d49/0x4d00 drivers/usb/core/hub.c:5855 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2292 process_scheduled_works kernel/workqueue.c:2355 [inline] worker_thread+0xd6e/0x1260 kernel/workqueue.c:2441 kthread+0x26d/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff888118faf800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 80 bytes inside of 512-byte region [ffff888118faf800, ffff888118fafa00) The buggy address belongs to the physical page: page:ffffea000463eb00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x118fac head:ffffea000463eb00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 0000000000000000 dead000000000122 ffff888100041c80 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 0x152a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 588, tgid 588 (kworker/1:4), ts 58857339159, free_ts 58843063643 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e2/0x1f0 mm/page_alloc.c:2517 prep_new_page mm/page_alloc.c:2524 [inline] get_page_from_freelist+0x2e1c/0x2ef0 mm/page_alloc.c:4283 __alloc_pages+0x3c2/0x7d0 mm/page_alloc.c:5551 allocate_slab mm/slub.c:1939 [inline] new_slab+0xce/0x4c0 mm/slub.c:1992 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3180 __slab_alloc+0x5d/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x1af/0x250 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc+0xa3/0x1e0 mm/slab_common.c:968 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:692 [inline] neigh_alloc net/core/neighbour.c:494 [inline] ___neigh_create+0x6af/0x1db0 net/core/neighbour.c:648 __neigh_create+0x32/0x40 net/core/neighbour.c:737 ip6_finish_output2+0x9d0/0x1840 net/ipv6/ip6_output.c:125 __ip6_finish_output net/ipv6/ip6_output.c:201 [inline] ip6_finish_output+0x50f/0xa60 net/ipv6/ip6_output.c:212 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x1f7/0x4c0 net/ipv6/ip6_output.c:233 dst_output include/net/dst.h:444 [inline] NF_HOOK include/linux/netfilter.h:302 [inline] ndisc_send_skb+0x7f8/0xdf0 net/ipv6/ndisc.c:509 ndisc_send_rs+0x47d/0x5f0 net/ipv6/ndisc.c:719 addrconf_dad_completed+0x8c4/0xdb0 net/ipv6/addrconf.c:4279 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1444 [inline] free_pcp_prepare mm/page_alloc.c:1517 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3362 free_unref_page+0x36/0x3c0 mm/page_alloc.c:3457 free_the_page mm/page_alloc.c:754 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5640 free_pages+0x7c/0x90 mm/page_alloc.c:5651 __stack_depot_save+0x42c/0x480 lib/stackdepot.c:506 kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x60/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x175/0x2c0 mm/slub.c:3422 skb_clone+0x1f8/0x380 net/core/skbuff.c:1660 do_one_broadcast net/netlink/af_netlink.c:1455 [inline] netlink_broadcast+0x684/0x1160 net/netlink/af_netlink.c:1521 uevent_net_broadcast_untagged lib/kobject_uevent.c:331 [inline] kobject_uevent_net_broadcast+0x3a1/0x590 lib/kobject_uevent.c:409 kobject_uevent_env+0x53c/0x720 lib/kobject_uevent.c:593 kobject_uevent+0x1f/0x30 lib/kobject_uevent.c:642 device_del+0xcb5/0xe80 drivers/base/core.c:3897 Memory state around the buggy address: ffff888118faf700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888118faf780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888118faf800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888118faf880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888118faf900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== hid 0003:28DE:1102.0006: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0006: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0006: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0006: No HID_FEATURE_REPORT submitted - nothing to read hid 0003:28DE:1102.0006: No HID_FEATURE_REPORT submitted - nothing to read