input: syz0 as /devices/virtual/input/input19 ================================================================== 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 ffff8881236d0450 by task syz.1.793/2599 CPU: 0 PID: 2599 Comm: syz.1.793 Not tainted 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:0x7f96be5a9890 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:00007f96bd223b70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f96be5a9890 RDX: 0000000000000000 RSI: 00007f96bd223c10 RDI: 00000000ffffff9c RBP: 00007f96bd223c10 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f96be762f80 R15: 00007fffbd2c2408 Allocated by task 2543: 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] __kmalloc+0x13a/0x270 mm/slub.c:4427 kmalloc include/linux/slab.h:608 [inline] kzalloc include/linux/slab.h:733 [inline] fib6_info_alloc+0x33/0xe0 net/ipv6/ip6_fib.c:155 ip6_route_info_create+0x50b/0x14c0 net/ipv6/route.c:3775 addrconf_f6i_alloc+0x215/0x4c0 net/ipv6/route.c:4573 ipv6_add_addr+0x44e/0xd40 net/ipv6/addrconf.c:1123 inet6_addr_add+0x45a/0x9b0 net/ipv6/addrconf.c:3018 inet6_rtm_newaddr+0x98d/0x26b0 net/ipv6/addrconf.c:4973 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 13: 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 fib6_info_destroy_rcu+0x168/0x1b0 net/ipv6/ip6_fib.c:178 rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2523 rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776 handle_softirqs+0x25e/0x5c0 kernel/softirq.c:565 run_ksoftirqd+0x28/0x40 kernel/softirq.c:941 smpboot_thread_fn+0x466/0x8d0 kernel/smpboot.c:164 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 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 __call_rcu_common kernel/rcu/tree.c:3007 [inline] call_rcu+0x135/0x1310 kernel/rcu/tree.c:3125 fib6_info_release include/net/ip6_fib.h:349 [inline] fixup_permanent_addr net/ipv6/addrconf.c:3542 [inline] addrconf_permanent_addr+0x376/0xba0 net/ipv6/addrconf.c:3570 addrconf_notify+0x762/0xdd0 net/ipv6/addrconf.c:3638 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391 __dev_notify_flags+0x304/0x610 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8896 do_setlink+0xcd1/0x3b00 net/core/rtnetlink.c:2741 __rtnl_newlink net/core/rtnetlink.c:3429 [inline] rtnl_newlink+0x1779/0x2050 net/core/rtnetlink.c:3549 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 The buggy address belongs to the object at ffff8881236d0400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 80 bytes inside of 512-byte region [ffff8881236d0400, ffff8881236d0600) The buggy address belongs to the page: page:ffffea00048db400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1236d0 head:ffffea00048db400 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 289, ts 21332374914, free_ts 0 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+0x16d/0x270 mm/slub.c:4423 kmalloc include/linux/slab.h:608 [inline] kzalloc include/linux/slab.h:733 [inline] new_dir fs/proc/proc_sysctl.c:956 [inline] get_subdir fs/proc/proc_sysctl.c:1001 [inline] __register_sysctl_table+0x9de/0x1240 fs/proc/proc_sysctl.c:1350 register_net_sysctl+0x21e/0x230 net/sysctl_net.c:169 neigh_sysctl_register+0x454/0x530 net/core/neighbour.c:3713 addrconf_sysctl_register+0xae/0x1a0 net/ipv6/addrconf.c:7180 ipv6_add_dev+0xc84/0x1140 net/ipv6/addrconf.c:454 addrconf_notify+0x593/0xdd0 net/ipv6/addrconf.c:3598 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_owner free stack trace missing Memory state around the buggy address: ffff8881236d0300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881236d0380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881236d0400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881236d0480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881236d0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== general protection fault, probably for non-canonical address 0xf003fc0020000016: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0x80200001000000b0-0x80200001000000b7] CPU: 0 PID: 2599 Comm: syz.1.793 Tainted: G B 5.15.161-syzkaller-00425-gb92c0d35d015 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 RIP: 0010:mutex_can_spin_on_owner kernel/locking/mutex.c:417 [inline] RIP: 0010:mutex_optimistic_spin kernel/locking/mutex.c:462 [inline] RIP: 0010:__mutex_lock_common kernel/locking/mutex.c:621 [inline] RIP: 0010:__mutex_lock+0x279/0x1870 kernel/locking/mutex.c:756 Code: 31 ce fc 4c 8b 3b 49 83 e7 f8 0f 84 ba 00 00 00 4c 89 6c 24 20 4d 8d 6f 34 4c 89 e8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <0f> b6 04 08 84 c0 0f 85 8f 0f 00 00 41 83 7d 00 00 74 67 49 83 c7 RSP: 0018:ffffc90000a972e0 EFLAGS: 00010a03 RAX: 1004000020000016 RBX: ffff8881236d0450 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000286 RDI: ffff8881236d0450 RBP: ffffc90000a97500 R08: dffffc0000000000 R09: 0000000000000007 R10: ffffed10246da08a R11: dffffc0000000001 R12: 1ffff110229ecc58 R13: 80200001000000b4 R14: 1ffff92000152e6c R15: 8020000100000080 FS: 00007f96bd2246c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f96bd203d58 CR3: 000000012055c000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __mutex_lock_slowpath+0xe/0x10 kernel/locking/mutex.c:1007 mutex_lock+0x135/0x1e0 kernel/locking/mutex.c:289 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:0x7f96be5a9890 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:00007f96bd223b70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f96be5a9890 RDX: 0000000000000000 RSI: 00007f96bd223c10 RDI: 00000000ffffff9c RBP: 00007f96bd223c10 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f96be762f80 R15: 00007fffbd2c2408 Modules linked in: ---[ end trace 91d8c629ec949190 ]--- RIP: 0010:mutex_can_spin_on_owner kernel/locking/mutex.c:417 [inline] RIP: 0010:mutex_optimistic_spin kernel/locking/mutex.c:462 [inline] RIP: 0010:__mutex_lock_common kernel/locking/mutex.c:621 [inline] RIP: 0010:__mutex_lock+0x279/0x1870 kernel/locking/mutex.c:756 Code: 31 ce fc 4c 8b 3b 49 83 e7 f8 0f 84 ba 00 00 00 4c 89 6c 24 20 4d 8d 6f 34 4c 89 e8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <0f> b6 04 08 84 c0 0f 85 8f 0f 00 00 41 83 7d 00 00 74 67 49 83 c7 RSP: 0018:ffffc90000a972e0 EFLAGS: 00010a03 RAX: 1004000020000016 RBX: ffff8881236d0450 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000286 RDI: ffff8881236d0450 RBP: ffffc90000a97500 R08: dffffc0000000000 R09: 0000000000000007 R10: ffffed10246da08a R11: dffffc0000000001 R12: 1ffff110229ecc58 R13: 80200001000000b4 R14: 1ffff92000152e6c R15: 8020000100000080 FS: 00007f96bd2246c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f96bd203d58 CR3: 000000012055c000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 31 ce xor %ecx,%esi 2: fc cld 3: 4c 8b 3b mov (%rbx),%r15 6: 49 83 e7 f8 and $0xfffffffffffffff8,%r15 a: 0f 84 ba 00 00 00 je 0xca 10: 4c 89 6c 24 20 mov %r13,0x20(%rsp) 15: 4d 8d 6f 34 lea 0x34(%r15),%r13 19: 4c 89 e8 mov %r13,%rax 1c: 48 c1 e8 03 shr $0x3,%rax 20: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 27: fc ff df * 2a: 0f b6 04 08 movzbl (%rax,%rcx,1),%eax <-- trapping instruction 2e: 84 c0 test %al,%al 30: 0f 85 8f 0f 00 00 jne 0xfc5 36: 41 83 7d 00 00 cmpl $0x0,0x0(%r13) 3b: 74 67 je 0xa4 3d: 49 rex.WB 3e: 83 .byte 0x83 3f: c7 .byte 0xc7