input: syz0 as /devices/virtual/input/input69
==================================================================
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 ffff88810858ac50 by task syz.1.3768/14853
CPU: 1 PID: 14853 Comm: syz.1.3768 Tainted: G W 5.15.158-syzkaller-00979-gc53388f01037 #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:0x7f79b8a49890
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:00007f79b76c3b70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f79b8a49890
RDX: 0000000000000000 RSI: 00007f79b76c3c10 RDI: 00000000ffffff9c
RBP: 00007f79b76c3c10 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f79b8c02f80 R15: 00007ffcf406f0d8
Allocated by task 14106:
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:4570
fixup_permanent_addr net/ipv6/addrconf.c:3531 [inline]
addrconf_permanent_addr+0x270/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/0x3ae0 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:2505
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
__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]
__ip6_del_rt+0xf3/0x140 net/ipv6/route.c:3896
ip6_del_rt+0xdd/0x130 net/ipv6/route.c:3907
__ipv6_ifa_notify+0xa09/0x11c0 net/ipv6/addrconf.c:6220
addrconf_ifdown+0xe14/0x1ae0 net/ipv6/addrconf.c:3921
addrconf_notify+0x37d/0xdd0
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/0x3ae0 net/core/rtnetlink.c:2741
rtnl_group_changelink net/core/rtnetlink.c:3270 [inline]
__rtnl_newlink net/core/rtnetlink.c:3439 [inline]
rtnl_newlink+0x1088/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:2505
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_sendmsg+0x59e/0x8f0 net/socket.c:2431
___sys_sendmsg+0x252/0x2e0 net/socket.c:2485
__sys_sendmsg net/socket.c:2514 [inline]
__do_sys_sendmsg net/socket.c:2523 [inline]
__se_sys_sendmsg+0x19a/0x260 net/socket.c:2521
__x64_sys_sendmsg+0x7b/0x90 net/socket.c:2521
x64_sys_call+0x16a/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:47
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
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_periodic_work+0x857/0xa40 net/core/neighbour.c:947
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 ffff88810858ac00
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 80 bytes inside of
512-byte region [ffff88810858ac00, ffff88810858ae00)
The buggy address belongs to the page:
page:ffffea0004216200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888108589400 pfn:0x108588
head:ffffea0004216200 order:2 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head|zone=1)
raw: 4000000000010200 ffffea00042b3d08 ffffea0004950d08 ffff888100042f00
raw: ffff888108589400 000000000010000c 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 1, ts 1665480048, free_ts 1665470855
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_array include/linux/slab.h:643 [inline]
kcalloc include/linux/slab.h:672 [inline]
cache_random_seq_create+0x71/0x1d0 mm/slab_common.c:1029
init_cache_random_seq mm/slub.c:1813 [inline]
kmem_cache_open mm/slub.c:4232 [inline]
__kmem_cache_create+0x206/0x680 mm/slub.c:4912
create_cache mm/slab_common.c:265 [inline]
kmem_cache_create_usercopy+0x150/0x2a0 mm/slab_common.c:367
kmem_cache_create+0x13/0x20 mm/slab_common.c:422
eventpoll_init+0x168/0x1b0 fs/eventpoll.c:2447
do_one_initcall+0x182/0x610 init/main.c:1302
do_initcall_level+0x186/0x310 init/main.c:1375
do_initcalls+0x4e/0x90 init/main.c:1391
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]
create_cache mm/slab_common.c:254 [inline]
kmem_cache_create_usercopy+0xfb/0x2a0 mm/slab_common.c:367
kmem_cache_create+0x13/0x20 mm/slab_common.c:422
eventpoll_init+0x168/0x1b0 fs/eventpoll.c:2447
do_one_initcall+0x182/0x610 init/main.c:1302
do_initcall_level+0x186/0x310 init/main.c:1375
do_initcalls+0x4e/0x90 init/main.c:1391
do_basic_setup+0x81/0x90 init/main.c:1410
kernel_init_freeable+0x2c1/0x400 init/main.c:1615
Memory state around the buggy address:
ffff88810858ab00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88810858ab80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88810858ac00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88810858ac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88810858ad00: 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: 14853 Comm: syz.1.3768 Tainted: G B W 5.15.158-syzkaller-00979-gc53388f01037 #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: 69 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:ffffc90000c972e0 EFLAGS: 00010a03
RAX: 1004000020000016 RBX: ffff88810858ac50 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000286 RDI: ffff88810858ac50
RBP: ffffc90000c97500 R08: dffffc0000000000 R09: 0000000000000007
R10: ffffed10210b158a R11: dffffc0000000001 R12: 1ffff110200774f0
R13: 80200001000000b4 R14: 1ffff92000192e6c R15: 8020000100000080
FS: 00007f79b76c46c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f79b7681f98 CR3: 00000001166b8000 CR4: 00000000003506b0
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:0x7f79b8a49890
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:00007f79b76c3b70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f79b8a49890
RDX: 0000000000000000 RSI: 00007f79b76c3c10 RDI: 00000000ffffff9c
RBP: 00007f79b76c3c10 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f79b8c02f80 R15: 00007ffcf406f0d8
Modules linked in:
---[ end trace ad31205ac0a1c9bd ]---
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: 69 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:ffffc90000c972e0 EFLAGS: 00010a03
RAX: 1004000020000016 RBX: ffff88810858ac50 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000286 RDI: ffff88810858ac50
RBP: ffffc90000c97500 R08: dffffc0000000000 R09: 0000000000000007
R10: ffffed10210b158a R11: dffffc0000000001 R12: 1ffff110200774f0
R13: 80200001000000b4 R14: 1ffff92000192e6c R15: 8020000100000080
FS: 00007f79b76c46c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f79b7681f98 CR3: 00000001166b8000 CR4: 00000000003506b0
----------------
Code disassembly (best guess):
0: 69 ce fc 4c 8b 3b imul $0x3b8b4cfc,%esi,%ecx
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