EXT4-fs (loop3): mounted filesystem without journal. Quota mode: writeback. ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:837 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:953 Read of size 4 at addr ffff888140d15e18 by task syz.3.285/1144 CPU: 1 PID: 1144 Comm: syz.3.285 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x71/0x210 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:427 kasan_report+0x122/0x150 mm/kasan/report.c:531 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 ext4_ext_binsearch fs/ext4/extents.c:837 [inline] ext4_find_extent+0xbeb/0xe20 fs/ext4/extents.c:953 ext4_ext_map_blocks+0x1dc/0x6060 fs/ext4/extents.c:4166 ext4_map_blocks+0x9cb/0x1b60 fs/ext4/inode.c:679 _ext4_get_block+0x1da/0x4e0 fs/ext4/inode.c:822 ext4_get_block+0x39/0x50 fs/ext4/inode.c:839 __block_write_begin_int+0x47a/0x1420 fs/buffer.c:2034 __block_write_begin fs/buffer.c:2084 [inline] block_page_mkwrite+0x281/0x300 fs/buffer.c:2558 ext4_page_mkwrite+0x4f2/0x1300 fs/ext4/inode.c:6316 do_page_mkwrite mm/memory.c:3036 [inline] wp_page_shared+0x505/0x8d0 mm/memory.c:3429 do_wp_page+0xde4/0xfc0 mm/memory.c:3581 handle_pte_fault mm/memory.c:5189 [inline] __handle_mm_fault mm/memory.c:5313 [inline] handle_mm_fault+0x10e4/0x2640 mm/memory.c:5453 do_user_addr_fault+0x63b/0x1050 arch/x86/mm/fault.c:1374 handle_page_fault arch/x86/mm/fault.c:1466 [inline] exc_page_fault+0x51/0xb0 arch/x86/mm/fault.c:1522 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:608 RIP: 0010:copy_user_enhanced_fast_string+0xa/0x40 arch/x86/lib/copy_user_64.S:166 Code: ff c9 75 f2 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 01 ca c3 8d 0c ca 89 ca eb 20 0f 01 cb 83 fa 40 72 38 89 d1 a4 31 c0 0f 01 ca c3 89 ca eb 0a 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90000cbfbe0 EFLAGS: 00050202 RAX: ffffffff82635601 RBX: 0000000000000841 RCX: 0000000000000781 RDX: 0000000000000841 RSI: ffff88812cc500c0 RDI: 0000200000001000 RBP: ffffc90000cbfc08 R08: dffffc0000000000 R09: ffffed102598a109 R10: 0000000000000000 R11: 0000000000000108 R12: 00007fffffffe7bf R13: ffffc90000cbfce0 R14: 0000200000000f40 R15: ffff88812cc50000 copy_to_user include/linux/uaccess.h:169 [inline] do_getxattr+0x317/0x350 fs/xattr.c:704 getxattr fs/xattr.c:735 [inline] path_getxattr+0x24f/0x400 fs/xattr.c:751 __do_sys_lgetxattr fs/xattr.c:769 [inline] __se_sys_lgetxattr fs/xattr.c:766 [inline] __x64_sys_lgetxattr+0x9e/0xb0 fs/xattr.c:766 x64_sys_call+0x194/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:193 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fdc6ef8ebe9 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdc6fe96038 EFLAGS: 00000246 ORIG_RAX: 00000000000000c0 RAX: ffffffffffffffda RBX: 00007fdc6f1b5fa0 RCX: 00007fdc6ef8ebe9 RDX: 0000200000000f40 RSI: 0000200000000280 RDI: 0000200000000240 RBP: 00007fdc6f011e19 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000ffffff92 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fdc6f1b6038 R14: 00007fdc6f1b5fa0 R15: 00007ffc23977cf8 The buggy address belongs to the physical page: page:ffffea0005034540 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x140d15 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 1135, tgid 1134 (syz.0.282), ts 49266018499, free_ts 49437699767 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2637 prep_new_page+0x1c/0x110 mm/page_alloc.c:2644 get_page_from_freelist+0x2c7b/0x2cf0 mm/page_alloc.c:4544 __alloc_pages+0x1c3/0x450 mm/page_alloc.c:5858 __folio_alloc+0x12/0x40 mm/page_alloc.c:5890 __folio_alloc_node include/linux/gfp.h:245 [inline] folio_alloc include/linux/gfp.h:274 [inline] shmem_alloc_folio mm/shmem.c:1601 [inline] shmem_alloc_and_acct_folio+0x650/0x870 mm/shmem.c:1626 shmem_get_folio_gfp+0x119f/0x2230 mm/shmem.c:1955 shmem_get_folio mm/shmem.c:2086 [inline] shmem_write_begin+0xea/0x2c0 mm/shmem.c:2571 generic_perform_write+0x2f6/0x6d0 mm/filemap.c:3882 __generic_file_write_iter+0x227/0x580 mm/filemap.c:4011 generic_file_write_iter+0xae/0x310 mm/filemap.c:4043 call_write_iter include/linux/fs.h:2282 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x5db/0xca0 fs/read_write.c:584 ksys_write+0x140/0x240 fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:646 x64_sys_call+0x27b/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1545 [inline] free_pcp_prepare mm/page_alloc.c:1619 [inline] free_unref_page_prepare+0x742/0x750 mm/page_alloc.c:3581 free_unref_page_list+0x112/0x8b0 mm/page_alloc.c:3730 release_pages+0xad1/0xb20 mm/swap.c:1043 __pagevec_release+0x71/0xe0 mm/swap.c:1063 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] shmem_undo_range+0x51a/0x1470 mm/shmem.c:955 shmem_truncate_range mm/shmem.c:1071 [inline] shmem_evict_inode+0x242/0xa10 mm/shmem.c:1180 evict+0x493/0x890 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x620/0x670 fs/inode.c:1860 do_unlinkat+0x375/0x6b0 fs/namei.c:4396 __do_sys_unlink fs/namei.c:4437 [inline] __se_sys_unlink fs/namei.c:4435 [inline] __x64_sys_unlink+0x49/0x50 fs/namei.c:4435 x64_sys_call+0x958/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:88 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff888140d15d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888140d15d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888140d15e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888140d15e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888140d15f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop3): ext4_map_blocks:745: inode #15: block 4: comm syz.3.285: lblock 4 mapped to illegal pblock 4 (length 1) EXT4-fs error (device loop3): ext4_map_blocks:635: inode #15: block 4: comm syz.3.285: lblock 4 mapped to illegal pblock 4 (length 1) ---------------- Code disassembly (best guess): 0: ff c9 dec %ecx 2: 75 f2 jne 0xfffffff6 4: 89 d1 mov %edx,%ecx 6: c1 e9 03 shr $0x3,%ecx 9: 83 e2 07 and $0x7,%edx c: f3 48 a5 rep movsq %ds:(%rsi),%es:(%rdi) f: 89 d1 mov %edx,%ecx 11: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) 13: 31 c0 xor %eax,%eax 15: 0f 01 ca clac 18: c3 ret 19: 8d 0c ca lea (%rdx,%rcx,8),%ecx 1c: 89 ca mov %ecx,%edx 1e: eb 20 jmp 0x40 20: 0f 01 cb stac 23: 83 fa 40 cmp $0x40,%edx 26: 72 38 jb 0x60 28: 89 d1 mov %edx,%ecx * 2a: f3 a4 rep movsb %ds:(%rsi),%es:(%rdi) <-- trapping instruction 2c: 31 c0 xor %eax,%eax 2e: 0f 01 ca clac 31: c3 ret 32: 89 ca mov %ecx,%edx 34: eb 0a jmp 0x40 36: 90 nop 37: 90 nop 38: 90 nop 39: 90 nop 3a: 90 nop 3b: 90 nop 3c: 90 nop 3d: 90 nop 3e: 90 nop 3f: 90 nop