input: syz0 as /devices/virtual/input/input128 ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic64_try_cmpxchg_acquire include/asm-generic/atomic-instrumented.h:1515 [inline] BUG: KASAN: use-after-free in atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:443 [inline] BUG: KASAN: use-after-free in __mutex_trylock_fast kernel/locking/mutex.c:173 [inline] BUG: KASAN: use-after-free in mutex_lock+0x98/0x110 kernel/locking/mutex.c:298 Write of size 8 at addr ffff888104b8e440 by task syz.0.2587/10728 CPU: 0 PID: 10728 Comm: syz.0.2587 Not tainted 5.10.225-syzkaller-00513-g8d23314f588a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 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] atomic64_try_cmpxchg_acquire include/asm-generic/atomic-instrumented.h:1515 [inline] atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:443 [inline] __mutex_trylock_fast kernel/locking/mutex.c:173 [inline] mutex_lock+0x98/0x110 kernel/locking/mutex.c:298 steam_input_open+0x91/0x1a0 drivers/hid/hid-steam.c:297 input_open_device+0x151/0x2a0 drivers/input/input.c:635 evdev_open_device drivers/input/evdev.c:400 [inline] evdev_open+0x3a5/0x5c0 drivers/input/evdev.c:487 chrdev_open+0x4f7/0x620 fs/char_dev.c:414 do_dentry_open+0x7c1/0x10d0 fs/open.c:819 vfs_open+0x73/0x80 fs/open.c:942 do_open fs/namei.c:3391 [inline] path_openat+0x2660/0x3000 fs/namei.c:3509 do_filp_open+0x21c/0x460 fs/namei.c:3536 do_sys_openat2+0x13f/0x710 fs/open.c:1217 do_sys_open fs/open.c:1233 [inline] __do_sys_openat fs/open.c:1249 [inline] __se_sys_openat fs/open.c:1244 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1244 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fb5e088f890 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:00007fb5df4e8b70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb5e088f890 RDX: 0000000000000000 RSI: 00007fb5df4e8c10 RDI: 00000000ffffff9c RBP: 00007fb5df4e8c10 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fb5e0a49058 R15: 00007ffc469e1c38 The buggy address belongs to the page: page:ffffea000412e380 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x104b8e flags: 0x4000000000000000() raw: 4000000000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL), pid 8201, ts 575680105729, free_ts 584100500337 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:2960 __sigqueue_alloc+0x19e/0x2f0 kernel/signal.c:438 __send_signal+0x1e6/0xb90 kernel/signal.c:1119 send_signal+0x4c1/0x5e0 kernel/signal.c:1245 do_send_sig_info+0xde/0x230 kernel/signal.c:1294 group_send_sig_info+0x113/0x320 kernel/signal.c:1417 bpf_send_signal_common+0x2d8/0x420 kernel/trace/bpf_trace.c:1106 ____bpf_send_signal kernel/trace/bpf_trace.c:1111 [inline] bpf_send_signal+0x19/0x20 kernel/trace/bpf_trace.c:1109 0xffffffffa00261c4 bpf_dispatcher_nop_func include/linux/bpf.h:669 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:2061 [inline] bpf_trace_run2+0xef/0x280 kernel/trace/bpf_trace.c:2098 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page mm/page_alloc.c:3391 [inline] free_the_page+0x9e/0x370 mm/page_alloc.c:5407 __free_pages+0x67/0xc0 mm/page_alloc.c:5418 __free_slab+0xcf/0x190 mm/slub.c:1894 free_slab mm/slub.c:1909 [inline] discard_slab mm/slub.c:1915 [inline] unfreeze_partials+0x15e/0x190 mm/slub.c:2410 put_cpu_partial+0xbf/0x180 mm/slub.c:2446 __slab_free+0x2c8/0x3a0 mm/slub.c:3095 do_slab_free mm/slub.c:3191 [inline] ___cache_free+0x111/0x130 mm/slub.c:3210 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x47/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x170 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:440 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960 kmem_cache_alloc_node include/linux/slab.h:423 [inline] __alloc_skb+0x80/0x510 net/core/skbuff.c:200 alloc_skb include/linux/skbuff.h:1126 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1194 [inline] netlink_sendmsg+0x7a4/0xd00 net/netlink/af_netlink.c:1891 Memory state around the buggy address: ffff888104b8e300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888104b8e380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888104b8e400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888104b8e480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888104b8e500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== general protection fault, probably for non-canonical address 0xf62bfc5cc0000406: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0xb16002e600002030-0xb16002e600002037] CPU: 0 PID: 10728 Comm: syz.0.2587 Tainted: G B 5.10.225-syzkaller-00513-g8d23314f588a #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:620 [inline] RIP: 0010:mutex_optimistic_spin kernel/locking/mutex.c:664 [inline] RIP: 0010:__mutex_lock_common kernel/locking/mutex.c:976 [inline] RIP: 0010:__mutex_lock+0x1b5/0xf20 kernel/locking/mutex.c:1117 Code: 3c 38 00 74 08 4c 89 ef e8 f8 c6 f6 fc 4d 8b 65 00 49 83 e4 f8 0f 84 a2 00 00 00 4c 89 f9 49 8d 5c 24 2c 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 bb 0a 00 00 83 3b 00 0f 84 34 01 00 00 RSP: 0018:ffffc90001157400 EFLAGS: 00010a07 RAX: 162c005cc0000406 RBX: b16002e600002034 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000282 RDI: ffff888104b8e440 RBP: ffffc90001157560 R08: dffffc0000000000 R09: 0000000000000007 R10: ffffed1020971c88 R11: dffffc0000000001 R12: b16002e600002008 R13: ffff888104b8e440 R14: b16002e600002009 R15: dffffc0000000000 FS: 00007fb5df4e96c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fb5df4c8d58 CR3: 0000000132cd6000 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:1379 mutex_lock+0xd6/0x110 kernel/locking/mutex.c:299 steam_input_open+0x91/0x1a0 drivers/hid/hid-steam.c:297 input_open_device+0x151/0x2a0 drivers/input/input.c:635 evdev_open_device drivers/input/evdev.c:400 [inline] evdev_open+0x3a5/0x5c0 drivers/input/evdev.c:487 chrdev_open+0x4f7/0x620 fs/char_dev.c:414 do_dentry_open+0x7c1/0x10d0 fs/open.c:819 vfs_open+0x73/0x80 fs/open.c:942 do_open fs/namei.c:3391 [inline] path_openat+0x2660/0x3000 fs/namei.c:3509 do_filp_open+0x21c/0x460 fs/namei.c:3536 do_sys_openat2+0x13f/0x710 fs/open.c:1217 do_sys_open fs/open.c:1233 [inline] __do_sys_openat fs/open.c:1249 [inline] __se_sys_openat fs/open.c:1244 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1244 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fb5e088f890 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:00007fb5df4e8b70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fb5e088f890 RDX: 0000000000000000 RSI: 00007fb5df4e8c10 RDI: 00000000ffffff9c RBP: 00007fb5df4e8c10 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fb5e0a49058 R15: 00007ffc469e1c38 Modules linked in: ---[ end trace 0432eaecb6d75986 ]--- RIP: 0010:mutex_can_spin_on_owner kernel/locking/mutex.c:620 [inline] RIP: 0010:mutex_optimistic_spin kernel/locking/mutex.c:664 [inline] RIP: 0010:__mutex_lock_common kernel/locking/mutex.c:976 [inline] RIP: 0010:__mutex_lock+0x1b5/0xf20 kernel/locking/mutex.c:1117 Code: 3c 38 00 74 08 4c 89 ef e8 f8 c6 f6 fc 4d 8b 65 00 49 83 e4 f8 0f 84 a2 00 00 00 4c 89 f9 49 8d 5c 24 2c 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 bb 0a 00 00 83 3b 00 0f 84 34 01 00 00 RSP: 0018:ffffc90001157400 EFLAGS: 00010a07 RAX: 162c005cc0000406 RBX: b16002e600002034 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000282 RDI: ffff888104b8e440 RBP: ffffc90001157560 R08: dffffc0000000000 R09: 0000000000000007 R10: ffffed1020971c88 R11: dffffc0000000001 R12: b16002e600002008 R13: ffff888104b8e440 R14: b16002e600002009 R15: dffffc0000000000 FS: 00007fb5df4e96c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fb5df4c8d58 CR3: 0000000132cd6000 CR4: 00000000003506b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 3c 38 cmp $0x38,%al 2: 00 74 08 4c add %dh,0x4c(%rax,%rcx,1) 6: 89 ef mov %ebp,%edi 8: e8 f8 c6 f6 fc call 0xfcf6c705 d: 4d 8b 65 00 mov 0x0(%r13),%r12 11: 49 83 e4 f8 and $0xfffffffffffffff8,%r12 15: 0f 84 a2 00 00 00 je 0xbd 1b: 4c 89 f9 mov %r15,%rcx 1e: 49 8d 5c 24 2c lea 0x2c(%r12),%rbx 23: 48 89 d8 mov %rbx,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 42 0f b6 04 38 movzbl (%rax,%r15,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 0f 85 bb 0a 00 00 jne 0xaf2 37: 83 3b 00 cmpl $0x0,(%rbx) 3a: 0f 84 34 01 00 00 je 0x174