================================================================== 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+0xa4/0x1e0 kernel/locking/mutex.c:295 Write of size 8 at addr ffff88812d61ac50 by task syz.0.1414/3971 CPU: 1 PID: 3971 Comm: syz.0.1414 Tainted: G W 6.1.99-syzkaller-00083-g03b93dc707ed #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:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 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:176 [inline] mutex_lock+0xa4/0x1e0 kernel/locking/mutex.c:295 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+0x3df/0x620 drivers/input/evdev.c:487 chrdev_open+0x4f7/0x620 fs/char_dev.c:414 do_dentry_open+0x891/0x1250 fs/open.c:884 vfs_open+0x73/0x80 fs/open.c:1015 do_open fs/namei.c:3627 [inline] path_openat+0x2532/0x2d60 fs/namei.c:3784 do_filp_open+0x230/0x480 fs/namei.c:3811 do_sys_openat2+0x151/0x870 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+0x243/0x290 fs/open.c:1368 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:0x7fe6fb97c890 Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 19 8f 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 6c 8f 02 00 8b 44 RSP: 002b:00007fe6fc842b70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000441 RCX: 00007fe6fb97c890 RDX: 0000000000000441 RSI: 00007fe6fc842c10 RDI: 00000000ffffff9c RBP: 00007fe6fc842c10 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe6fbb35f80 R15: 00007ffc52e72ee8 Allocated by task 3485: 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:379 [inline] __kasan_kmalloc+0x9c/0xb0 mm/kasan/common.c:388 kasan_kmalloc include/linux/kasan.h:212 [inline] __do_kmalloc_node mm/slab_common.c:957 [inline] __kmalloc+0xb4/0x1e0 mm/slab_common.c:970 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:692 [inline] new_dir fs/proc/proc_sysctl.c:971 [inline] get_subdir fs/proc/proc_sysctl.c:1015 [inline] __register_sysctl_table+0x9d8/0x1060 fs/proc/proc_sysctl.c:1377 register_net_sysctl+0x246/0x260 net/sysctl_net.c:169 neigh_sysctl_register+0x3ec/0x4d0 net/core/neighbour.c:3847 devinet_sysctl_register+0xaa/0x1e0 net/ipv4/devinet.c:2636 inetdev_init+0x2b4/0x4e0 net/ipv4/devinet.c:279 inetdev_event+0x205/0x1110 net/ipv4/devinet.c:1534 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:1978 [inline] call_netdevice_notifiers_extack net/core/dev.c:2016 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2030 register_netdevice+0x10cf/0x1490 net/core/dev.c:10140 veth_newlink+0x7fc/0xc70 drivers/net/veth.c:1775 rtnl_newlink_create net/core/rtnetlink.c:3390 [inline] __rtnl_newlink net/core/rtnetlink.c:3610 [inline] rtnl_newlink+0x14c6/0x2030 net/core/rtnetlink.c:3623 rtnetlink_rcv_msg+0x9a5/0xca0 net/core/rtnetlink.c:6121 netlink_rcv_skb+0x1cd/0x410 net/netlink/af_netlink.c:2518 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6139 netlink_unicast_kernel net/netlink/af_netlink.c:1327 [inline] netlink_unicast+0x906/0xab0 net/netlink/af_netlink.c:1353 netlink_sendmsg+0xa15/0xd30 net/netlink/af_netlink.c:1875 sock_sendmsg_nosec net/socket.c:716 [inline] __sock_sendmsg net/socket.c:728 [inline] __sys_sendto+0x480/0x600 net/socket.c:2138 __do_sys_sendto net/socket.c:2150 [inline] __se_sys_sendto net/socket.c:2146 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2146 x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45 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 Freed by task 24: 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: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 mm/slub.c:1771 [inline] slab_free mm/slub.c:3684 [inline] kmem_cache_free_bulk+0x636/0x7a0 mm/slub.c:3802 kfree_bulk include/linux/slab.h:468 [inline] kfree_rcu_work+0x2ae/0x760 kernel/rcu/tree.c:3130 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2299 worker_thread+0xa60/0x1260 kernel/workqueue.c:2446 kthread+0x26d/0x300 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb4/0xc0 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496 kvfree_call_rcu+0x9f/0x800 kernel/rcu/tree.c:3444 drop_sysctl_table+0x311/0x450 fs/proc/proc_sysctl.c:1729 drop_sysctl_table+0x323/0x450 fs/proc/proc_sysctl.c:1732 unregister_sysctl_table+0x76/0x120 fs/proc/proc_sysctl.c:1767 unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:175 neigh_sysctl_unregister+0x78/0x90 net/core/neighbour.c:3866 devinet_sysctl_unregister net/ipv4/devinet.c:2651 [inline] inetdev_destroy net/ipv4/devinet.c:327 [inline] inetdev_event+0x848/0x1110 net/ipv4/devinet.c:1602 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:1978 [inline] call_netdevice_notifiers_extack net/core/dev.c:2016 [inline] call_netdevice_notifiers net/core/dev.c:2030 [inline] unregister_netdevice_many+0xe2a/0x1740 net/core/dev.c:10890 default_device_exit_batch+0x975/0xa00 net/core/dev.c:11403 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x6c9/0xbf0 net/core/net_namespace.c:604 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2299 worker_thread+0xa60/0x1260 kernel/workqueue.c:2446 kthread+0x26d/0x300 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb4/0xc0 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:496 __call_rcu_common kernel/rcu/tree.c:2806 [inline] call_rcu+0xee/0x1340 kernel/rcu/tree.c:2925 pwq_unbound_release_workfn+0x29f/0x2e0 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2299 worker_thread+0xa60/0x1260 kernel/workqueue.c:2446 kthread+0x26d/0x300 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff88812d61ac00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 80 bytes inside of 512-byte region [ffff88812d61ac00, ffff88812d61ae00) The buggy address belongs to the physical page: page:ffffea0004b58600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12d618 head:ffffea0004b58600 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 297, tgid 297 (syz-executor), ts 27204612235, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4425 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5714 alloc_slab_page+0x6c/0xf0 allocate_slab mm/slub.c:1962 [inline] new_slab+0x90/0x3e0 mm/slub.c:2015 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203 __slab_alloc+0x5d/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] __kmem_cache_alloc_node+0x1af/0x250 mm/slub.c:3460 __do_kmalloc_node mm/slab_common.c:956 [inline] __kmalloc_node_track_caller+0xa2/0x1e0 mm/slab_common.c:977 kmalloc_reserve net/core/skbuff.c:446 [inline] __alloc_skb+0x125/0x2d0 net/core/skbuff.c:515 alloc_skb include/linux/skbuff.h:1290 [inline] nlmsg_new include/net/netlink.h:991 [inline] netlink_ack+0x392/0x12a0 net/netlink/af_netlink.c:2455 netlink_rcv_skb+0x24a/0x410 net/netlink/af_netlink.c:2524 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:6139 netlink_unicast_kernel net/netlink/af_netlink.c:1327 [inline] netlink_unicast+0x906/0xab0 net/netlink/af_netlink.c:1353 netlink_sendmsg+0xa15/0xd30 net/netlink/af_netlink.c:1875 page_owner free stack trace missing Memory state around the buggy address: ffff88812d61ab00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88812d61ab80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88812d61ac00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88812d61ac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88812d61ad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== "*(> (efault): No HID_FEATURE_REPORT submitted - nothing to read "*(> (efault): No HID_FEATURE_REPORT submitted - nothing to read "*(> (efault): No HID_FEATURE_REPORT submitted - nothing to read "*(> (efault): No HID_FEATURE_REPORT submitted - nothing to read "*(> (efault): No HID_FEATURE_REPORT submitted - nothing to read