================================================================== BUG: KFENCE: use-after-free read in bio_poll+0x46/0x320 block/blk-core.c:981 Use-after-free read at 0xffff88823bda4034 (in kfence-#209): bio_poll+0x46/0x320 block/blk-core.c:981 __iomap_dio_rw+0x110e/0x1ad0 fs/iomap/direct-io.c:657 iomap_dio_rw+0x38/0x90 fs/iomap/direct-io.c:680 ext4_dio_write_iter fs/ext4/file.c:564 [inline] ext4_file_write_iter+0xe1b/0x14d0 fs/ext4/file.c:675 call_write_iter include/linux/fs.h:2074 [inline] do_iter_readv_writev+0x47a/0x750 fs/read_write.c:725 do_iter_write+0x188/0x710 fs/read_write.c:851 vfs_writev+0x1aa/0x630 fs/read_write.c:924 do_pwritev+0x1bc/0x270 fs/read_write.c:1021 __do_sys_pwritev2 fs/read_write.c:1080 [inline] __se_sys_pwritev2 fs/read_write.c:1071 [inline] __x64_sys_pwritev2+0xeb/0x150 fs/read_write.c:1071 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 kfence-#209: 0xffff88823bda4000-0xffff88823bda40c7, size=200, cache=bio-200 allocated by task 25726 on cpu 0 at 1615.390801s: mempool_alloc+0x146/0x350 mm/mempool.c:392 bio_alloc_bioset+0x2ff/0x4a0 block/bio.c:468 bio_alloc include/linux/bio.h:422 [inline] iomap_dio_bio_iter+0x97b/0x1560 fs/iomap/direct-io.c:312 iomap_dio_iter fs/iomap/direct-io.c:434 [inline] __iomap_dio_rw+0x84a/0x1ad0 fs/iomap/direct-io.c:590 iomap_dio_rw+0x38/0x90 fs/iomap/direct-io.c:680 ext4_dio_write_iter fs/ext4/file.c:564 [inline] ext4_file_write_iter+0xe1b/0x14d0 fs/ext4/file.c:675 call_write_iter include/linux/fs.h:2074 [inline] do_iter_readv_writev+0x47a/0x750 fs/read_write.c:725 do_iter_write+0x188/0x710 fs/read_write.c:851 vfs_writev+0x1aa/0x630 fs/read_write.c:924 do_pwritev+0x1bc/0x270 fs/read_write.c:1021 __do_sys_pwritev2 fs/read_write.c:1080 [inline] __se_sys_pwritev2 fs/read_write.c:1071 [inline] __x64_sys_pwritev2+0xeb/0x150 fs/read_write.c:1071 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 19 on cpu 1 at 1615.439922s: rcu_do_batch kernel/rcu/tree.c:2527 [inline] rcu_core+0x7b1/0x1820 kernel/rcu/tree.c:2778 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 run_ksoftirqd kernel/softirq.c:921 [inline] run_ksoftirqd+0x2d/0x60 kernel/softirq.c:913 smpboot_thread_fn+0x645/0x9c0 kernel/smpboot.c:164 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 CPU: 1 PID: 25726 Comm: syz-executor.5 Not tainted 5.17.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:bio_poll+0x46/0x320 block/blk-core.c:981 Code: 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 0f b6 14 02 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 48 02 00 00 <8b> 6b 34 bf ff ff ff ff 89 ee e8 1b dd af fd 83 fd ff 0f 84 c7 01 RSP: 0018:ffffc90003bff708 EFLAGS: 00010246 RAX: 0000000000000007 RBX: ffff88823bda4000 RCX: ffffc9000d8ec000 RDX: 0000000000000000 RSI: ffffffff83c80648 RDI: ffff88823bda4034 RBP: ffffed1005665f1e R08: 0000000000000001 R09: ffff88802b32e21b R10: ffffed1005665c43 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: ffff888074760c00 R15: ffff88823bda4000 FS: 00007f0f93140700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88823bda4034 CR3: 0000000073727000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __iomap_dio_rw+0x110e/0x1ad0 fs/iomap/direct-io.c:657 iomap_dio_rw+0x38/0x90 fs/iomap/direct-io.c:680 ext4_dio_write_iter fs/ext4/file.c:564 [inline] ext4_file_write_iter+0xe1b/0x14d0 fs/ext4/file.c:675 call_write_iter include/linux/fs.h:2074 [inline] do_iter_readv_writev+0x47a/0x750 fs/read_write.c:725 do_iter_write+0x188/0x710 fs/read_write.c:851 vfs_writev+0x1aa/0x630 fs/read_write.c:924 do_pwritev+0x1bc/0x270 fs/read_write.c:1021 __do_sys_pwritev2 fs/read_write.c:1080 [inline] __se_sys_pwritev2 fs/read_write.c:1071 [inline] __x64_sys_pwritev2+0xeb/0x150 fs/read_write.c:1071 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 RIP: 0033:0x7f0f947ec049 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0f93140168 EFLAGS: 00000246 ORIG_RAX: 0000000000000148 RAX: ffffffffffffffda RBX: 00007f0f948ff030 RCX: 00007f0f947ec049 RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000005 RBP: 00007f0f9484608d R08: 0000000000000000 R09: 0000000000000003 R10: 0000000000004200 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff4b483fef R14: 00007f0f93140300 R15: 0000000000022000 ================================================================== ---------------- Code disassembly (best guess): 0: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 7: fc ff df a: 48 89 fa mov %rdi,%rdx d: 48 c1 ea 03 shr $0x3,%rdx 11: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx 15: 48 89 f8 mov %rdi,%rax 18: 83 e0 07 and $0x7,%eax 1b: 83 c0 03 add $0x3,%eax 1e: 38 d0 cmp %dl,%al 20: 7c 08 jl 0x2a 22: 84 d2 test %dl,%dl 24: 0f 85 48 02 00 00 jne 0x272 * 2a: 8b 6b 34 mov 0x34(%rbx),%ebp <-- trapping instruction 2d: bf ff ff ff ff mov $0xffffffff,%edi 32: 89 ee mov %ebp,%esi 34: e8 1b dd af fd callq 0xfdafdd54 39: 83 fd ff cmp $0xffffffff,%ebp 3c: 0f .byte 0xf 3d: 84 c7 test %al,%bh 3f: 01 .byte 0x1