input: syz0 as /devices/virtual/input/input51 ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_long_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1667 [inline] BUG: KASAN: use-after-free in __mutex_trylock_fast kernel/locking/mutex.c:169 [inline] BUG: KASAN: use-after-free in mutex_lock+0xa9/0x1e0 kernel/locking/mutex.c:288 Write of size 8 at addr ffff888123106050 by task syz.3.2062/6054 CPU: 1 PID: 6054 Comm: syz.3.2062 Tainted: G W 5.15.161-syzkaller-00425-gb92c0d35d015 #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/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_long_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:1667 [inline] __mutex_trylock_fast kernel/locking/mutex.c:169 [inline] mutex_lock+0xa9/0x1e0 kernel/locking/mutex.c:288 steam_input_open+0x91/0x1a0 drivers/hid/hid-steam.c:297 input_open_device+0x1a5/0x310 drivers/input/input.c:640 evdev_open_device drivers/input/evdev.c:404 [inline] evdev_open+0x3df/0x620 drivers/input/evdev.c:491 chrdev_open+0x4f7/0x620 fs/char_dev.c:414 do_dentry_open+0x81c/0xfd0 fs/open.c:828 vfs_open+0x73/0x80 fs/open.c:958 do_open fs/namei.c:3608 [inline] path_openat+0x26f0/0x2f40 fs/namei.c:3742 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13f/0x830 fs/open.c:1234 do_sys_open fs/open.c:1250 [inline] __do_sys_openat fs/open.c:1266 [inline] __se_sys_openat fs/open.c:1261 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1261 x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7febb0b148d0 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:00007febaf78eb70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007febb0b148d0 RDX: 0000000000000000 RSI: 00007febaf78ec10 RDI: 00000000ffffff9c RBP: 00007febaf78ec10 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007febb0ccdf80 R15: 00007ffd39a585d8 Allocated by task 5928: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] kmem_cache_alloc_trace+0x115/0x210 mm/slub.c:3267 kmalloc include/linux/slab.h:603 [inline] kmalloc_array include/linux/slab.h:642 [inline] rtnl_newlink+0x10a/0x2050 net/core/rtnetlink.c:3545 rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5629 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2508 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5647 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1924 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x564/0x720 net/socket.c:2058 __do_sys_sendto net/socket.c:2070 [inline] __se_sys_sendto net/socket.c:2066 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2066 x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 5928: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3519 [inline] kfree+0xc8/0x220 mm/slub.c:4579 rtnl_newlink+0x15dc/0x2050 net/core/rtnetlink.c:3550 rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5629 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2508 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5647 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1924 sock_sendmsg_nosec net/socket.c:704 [inline] __sock_sendmsg net/socket.c:716 [inline] __sys_sendto+0x564/0x720 net/socket.c:2058 __do_sys_sendto net/socket.c:2070 [inline] __se_sys_sendto net/socket.c:2066 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2066 x64_sys_call+0x15c/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:45 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 kvfree_call_rcu+0xb1/0x8b0 kernel/rcu/tree.c:3644 inet6_ifa_finish_destroy+0x120/0x1a0 net/ipv6/addrconf.c:1004 in6_ifa_put include/net/addrconf.h:445 [inline] addrconf_ifdown+0x1330/0x1ae0 net/ipv6/addrconf.c:3933 addrconf_notify+0x37d/0xdd0 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2025 [inline] call_netdevice_notifiers_extack net/core/dev.c:2037 [inline] call_netdevice_notifiers net/core/dev.c:2051 [inline] dev_close_many+0x37c/0x530 net/core/dev.c:1626 unregister_netdevice_many+0x492/0x17c0 net/core/dev.c:11085 ip6gre_exit_batch_net+0x5b2/0x600 net/ipv6/ip6_gre.c:1650 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x6ce/0xc00 net/core/net_namespace.c:599 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 kvfree_call_rcu+0xb1/0x8b0 kernel/rcu/tree.c:3644 neigh_destroy+0x411/0x540 net/core/neighbour.c:860 neigh_release include/net/neighbour.h:427 [inline] neigh_cleanup_and_release+0x73/0x1b0 net/core/neighbour.c:103 neigh_flush_dev+0x693/0x850 net/core/neighbour.c:374 __neigh_ifdown+0x41/0x3d0 net/core/neighbour.c:391 neigh_ifdown+0x1f/0x30 net/core/neighbour.c:408 rt6_disable_ip+0x6a2/0x730 net/ipv6/route.c:4903 addrconf_ifdown+0x160/0x1ae0 net/ipv6/addrconf.c:3797 addrconf_notify+0x37d/0xdd0 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2025 [inline] call_netdevice_notifiers_extack net/core/dev.c:2037 [inline] call_netdevice_notifiers net/core/dev.c:2051 [inline] dev_close_many+0x37c/0x530 net/core/dev.c:1626 unregister_netdevice_many+0x492/0x17c0 net/core/dev.c:11085 default_device_exit_batch+0x38a/0x3f0 net/core/dev.c:11642 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x6ce/0xc00 net/core/net_namespace.c:599 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 The buggy address belongs to the object at ffff888123106000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 80 bytes inside of 512-byte region [ffff888123106000, ffff888123106200) The buggy address belongs to the page: page:ffffea00048c4100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x123104 head:ffffea00048c4100 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 ffffea00044fbb00 0000000400000004 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 299, ts 31389226808, free_ts 31388922496 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3248 [inline] __kmalloc_track_caller+0x16c/0x260 mm/slub.c:4945 kmalloc_reserve net/core/skbuff.c:357 [inline] __alloc_skb+0x10c/0x550 net/core/skbuff.c:428 alloc_skb include/linux/skbuff.h:1183 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet_netconf_notify_devconf+0x173/0x220 net/ipv4/devinet.c:2109 __devinet_sysctl_register+0x232/0x2a0 net/ipv4/devinet.c:2597 devinet_sysctl_register+0x16a/0x1e0 net/ipv4/devinet.c:2631 inetdev_init+0x284/0x4b0 net/ipv4/devinet.c:283 inetdev_event+0x205/0x10a0 net/ipv4/devinet.c:1531 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2025 [inline] call_netdevice_notifiers_extack net/core/dev.c:2037 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2051 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5855 free_pages+0x7c/0x90 mm/page_alloc.c:5866 __stack_depot_save+0x420/0x470 lib/stackdepot.c:358 kasan_save_stack mm/kasan/common.c:39 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] __kasan_slab_alloc+0xc3/0xe0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550 slab_alloc_node mm/slub.c:3240 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3253 kmem_cache_zalloc include/linux/slab.h:723 [inline] __kernfs_new_node+0xdb/0x700 fs/kernfs/dir.c:593 kernfs_new_node+0x130/0x230 fs/kernfs/dir.c:669 kernfs_create_dir_ns+0x44/0x130 fs/kernfs/dir.c:1017 sysfs_create_dir_ns+0x185/0x390 fs/sysfs/dir.c:59 create_dir lib/kobject.c:89 [inline] kobject_add_internal+0x763/0xd90 lib/kobject.c:263 kobject_add_varg lib/kobject.c:398 [inline] kobject_init_and_add+0x120/0x190 lib/kobject.c:481 rx_queue_add_kobject net/core/net-sysfs.c:1059 [inline] net_rx_queue_update_kobjects+0x1a4/0x490 net/core/net-sysfs.c:1110 register_queue_kobjects net/core/net-sysfs.c:1767 [inline] netdev_register_kobject+0x231/0x320 net/core/net-sysfs.c:2018 Memory state around the buggy address: ffff888123105f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888123105f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888123106000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888123106080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888123106100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== general protection fault, probably for non-canonical address 0xdffffc0000000213: 0000 [#1] PREEMPT SMP KASAN KASAN: probably user-memory-access in range [0x0000000000001098-0x000000000000109f] CPU: 0 PID: 6054 Comm: syz.3.2062 Tainted: G B W 5.15.161-syzkaller-00425-gb92c0d35d015 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 RIP: 0010:steam_send_report+0x66/0x330 drivers/hid/hid-steam.c:172 Code: 80 3c 18 00 74 12 4c 89 ef e8 76 5c 0a fe 48 ba 00 00 00 00 00 fc ff df 4d 8b 7d 00 49 8d 9f 98 10 00 00 48 89 d8 48 c1 e8 03 <80> 3c 10 00 74 12 48 89 df e8 4c 5c 0a fe 48 ba 00 00 00 00 00 fc RSP: 0018:ffffc90000c27588 EFLAGS: 00010202 RAX: 0000000000000213 RBX: 0000000000001098 RCX: ffffffff83a84a8a RDX: dffffc0000000000 RSI: 0000000000000292 RDI: ffff888123106040 RBP: ffffc90000c275d0 R08: ffffffff83a87c81 R09: fffff52000184ead R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90000c27600 R13: ffff888123106040 R14: ffff888123106050 R15: 0000000000000000 FS: 00007febaf78f6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000900 CR3: 000000013604e000 CR4: 00000000003506b0 Call Trace: steam_send_report_byte drivers/hid/hid-steam.c:212 [inline] steam_set_lizard_mode drivers/hid/hid-steam.c:285 [inline] steam_input_open+0x108/0x1a0 drivers/hid/hid-steam.c:299 input_open_device+0x1a5/0x310 drivers/input/input.c:640 evdev_open_device drivers/input/evdev.c:404 [inline] evdev_open+0x3df/0x620 drivers/input/evdev.c:491 chrdev_open+0x4f7/0x620 fs/char_dev.c:414 do_dentry_open+0x81c/0xfd0 fs/open.c:828 vfs_open+0x73/0x80 fs/open.c:958 do_open fs/namei.c:3608 [inline] path_openat+0x26f0/0x2f40 fs/namei.c:3742 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13f/0x830 fs/open.c:1234 do_sys_open fs/open.c:1250 [inline] __do_sys_openat fs/open.c:1266 [inline] __se_sys_openat fs/open.c:1261 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1261 x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7febb0b148d0 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:00007febaf78eb70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007febb0b148d0 RDX: 0000000000000000 RSI: 00007febaf78ec10 RDI: 00000000ffffff9c RBP: 00007febaf78ec10 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007febb0ccdf80 R15: 00007ffd39a585d8 Modules linked in: ---[ end trace 2605424ed5a3db0c ]--- RIP: 0010:steam_send_report+0x66/0x330 drivers/hid/hid-steam.c:172 Code: 80 3c 18 00 74 12 4c 89 ef e8 76 5c 0a fe 48 ba 00 00 00 00 00 fc ff df 4d 8b 7d 00 49 8d 9f 98 10 00 00 48 89 d8 48 c1 e8 03 <80> 3c 10 00 74 12 48 89 df e8 4c 5c 0a fe 48 ba 00 00 00 00 00 fc RSP: 0018:ffffc90000c27588 EFLAGS: 00010202 RAX: 0000000000000213 RBX: 0000000000001098 RCX: ffffffff83a84a8a RDX: dffffc0000000000 RSI: 0000000000000292 RDI: ffff888123106040 RBP: ffffc90000c275d0 R08: ffffffff83a87c81 R09: fffff52000184ead R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90000c27600 R13: ffff888123106040 R14: ffff888123106050 R15: 0000000000000000 FS: 00007febaf78f6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000900 CR3: 000000013604e000 CR4: 00000000003506b0 ---------------- Code disassembly (best guess): 0: 80 3c 18 00 cmpb $0x0,(%rax,%rbx,1) 4: 74 12 je 0x18 6: 4c 89 ef mov %r13,%rdi 9: e8 76 5c 0a fe call 0xfe0a5c84 e: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 15: fc ff df 18: 4d 8b 7d 00 mov 0x0(%r13),%r15 1c: 49 8d 9f 98 10 00 00 lea 0x1098(%r15),%rbx 23: 48 89 d8 mov %rbx,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 80 3c 10 00 cmpb $0x0,(%rax,%rdx,1) <-- trapping instruction 2e: 74 12 je 0x42 30: 48 89 df mov %rbx,%rdi 33: e8 4c 5c 0a fe call 0xfe0a5c84 38: 48 rex.W 39: ba 00 00 00 00 mov $0x0,%edx 3e: 00 fc add %bh,%ah