================================================================== BUG: KFENCE: use-after-free read in __lock_acquire+0xd8f/0x56c0 kernel/locking/lockdep.c:4899 Use-after-free read at 0xffff88823bd92328 (in kfence-#200): __lock_acquire+0xd8f/0x56c0 kernel/locking/lockdep.c:4899 lock_acquire kernel/locking/lockdep.c:5641 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5606 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x32/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:374 [inline] io_poll_remove_entry fs/io_uring.c:5787 [inline] io_poll_remove_entries.part.0+0x15f/0x7e0 fs/io_uring.c:5820 io_poll_remove_entries fs/io_uring.c:5800 [inline] io_apoll_task_func+0xba/0x230 fs/io_uring.c:5922 handle_tw_list fs/io_uring.c:2455 [inline] tctx_task_work+0x1a4/0x1460 fs/io_uring.c:2489 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:37 [inline] do_exit+0xaff/0x2a00 kernel/exit.c:795 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 get_signal+0x22df/0x24c0 kernel/signal.c:2864 arch_do_signal_or_restart+0x82/0x20f0 arch/x86/kernel/signal.c:867 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae kfence-#200: 0xffff88823bd92000-0xffff88823bd9273f, size=1856, cache=kmalloc-2k allocated by task 3388 on cpu 1 at 1146.167687s: io_ring_ctx_alloc fs/io_uring.c:1503 [inline] io_uring_create fs/io_uring.c:11129 [inline] io_uring_setup.cold+0x133/0x257d fs/io_uring.c:11235 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae freed by task 28651 on cpu 0 at 1146.347908s: io_ring_ctx_free fs/io_uring.c:9957 [inline] io_ring_exit_work+0xf57/0xf9d fs/io_uring.c:10100 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 CPU: 1 PID: 3388 Comm: syz-executor.3 Not tainted 5.18.0-rc1-syzkaller-00328-ge1f700ebd6be #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__lock_acquire+0xd8f/0x56c0 kernel/locking/lockdep.c:4899 Code: c8 00 00 00 89 05 11 c5 1a 0e e9 bd 00 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 80 3c 02 00 0f 85 15 31 00 00 <48> 81 3b 20 54 23 8f 0f 84 4f f3 ff ff 41 83 fa 01 0f 87 57 f3 ff RSP: 0018:ffffc9000445f740 EFLAGS: 00010046 RAX: dffffc0000000000 RBX: ffff88823bd92328 RCX: 0000000000000000 RDX: 1ffff110477b2465 RSI: 0000000000000000 RDI: ffff88823bd92328 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 R13: ffff88801cae0000 R14: 0000000000000000 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88823bd92328 CR3: 00000000494be000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: lock_acquire kernel/locking/lockdep.c:5641 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5606 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:119 [inline] _raw_spin_lock_irq+0x32/0x50 kernel/locking/spinlock.c:170 spin_lock_irq include/linux/spinlock.h:374 [inline] io_poll_remove_entry fs/io_uring.c:5787 [inline] io_poll_remove_entries.part.0+0x15f/0x7e0 fs/io_uring.c:5820 io_poll_remove_entries fs/io_uring.c:5800 [inline] io_apoll_task_func+0xba/0x230 fs/io_uring.c:5922 handle_tw_list fs/io_uring.c:2455 [inline] tctx_task_work+0x1a4/0x1460 fs/io_uring.c:2489 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:37 [inline] do_exit+0xaff/0x2a00 kernel/exit.c:795 do_group_exit+0xd2/0x2f0 kernel/exit.c:925 get_signal+0x22df/0x24c0 kernel/signal.c:2864 arch_do_signal_or_restart+0x82/0x20f0 arch/x86/kernel/signal.c:867 exit_to_user_mode_loop kernel/entry/common.c:166 [inline] exit_to_user_mode_prepare+0x15f/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f2d22289049 Code: Unable to access opcode bytes at RIP 0x7f2d2228901f. RSP: 002b:00007f2d23444218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f2d2239bf68 RCX: 00007f2d22289049 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f2d2239bf68 RBP: 00007f2d2239bf60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2d2239bf6c R13: 00007f2d228cfb1f R14: 00007f2d23444300 R15: 0000000000022000 ================================================================== ---------------- Code disassembly (best guess): 0: c8 00 00 00 enterq $0x0,$0x0 4: 89 05 11 c5 1a 0e mov %eax,0xe1ac511(%rip) # 0xe1ac51b a: e9 bd 00 00 00 jmpq 0xcc f: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 16: fc ff df 19: 48 89 da mov %rbx,%rdx 1c: 48 c1 ea 03 shr $0x3,%rdx 20: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) 24: 0f 85 15 31 00 00 jne 0x313f * 2a: 48 81 3b 20 54 23 8f cmpq $0xffffffff8f235420,(%rbx) <-- trapping instruction 31: 0f 84 4f f3 ff ff je 0xfffff386 37: 41 83 fa 01 cmp $0x1,%r10d 3b: 0f .byte 0xf 3c: 87 57 f3 xchg %edx,-0xd(%rdi) 3f: ff .byte 0xff