EXT4-fs (loop0): mounted filesystem without journal. Opts: errors=remount-ro,noquota,debug,auto_da_alloc=0x0000000000000000,data_err=ignore,auto_da_alloc=0x0000000000008000,nouid32,delalloc,usrquota,. Quota mode: writeback. ext4 filesystem being mounted at /root/file1 supports timestamps until 2038 (0x7fffffff) ================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbc4/0xdd0 fs/ext4/extents.c:946 Read of size 4 at addr ffff88807003fa90 by task syz-executor152/3498 CPU: 0 PID: 3498 Comm: syz-executor152 Not tainted 5.15.158-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 ext4_ext_binsearch fs/ext4/extents.c:827 [inline] ext4_find_extent+0xbc4/0xdd0 fs/ext4/extents.c:946 ext4_ext_map_blocks+0x2da/0x7690 fs/ext4/extents.c:4142 ext4_map_blocks+0xaad/0x1e00 fs/ext4/inode.c:645 mpage_map_one_extent fs/ext4/inode.c:2396 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2449 [inline] ext4_writepages+0x160e/0x3d10 fs/ext4/inode.c:2817 do_writepages+0x481/0x730 mm/page-writeback.c:2364 filemap_fdatawrite_wbc+0x1d6/0x230 mm/filemap.c:400 __filemap_fdatawrite_range mm/filemap.c:433 [inline] filemap_write_and_wait_range+0x19e/0x280 mm/filemap.c:704 ext4_punch_hole+0x199/0xc10 fs/ext4/inode.c:3983 ext4_fallocate+0x30a/0x20c0 fs/ext4/extents.c:4740 vfs_fallocate+0x54a/0x6b0 fs/open.c:308 do_vfs_ioctl+0x2317/0x2b70 fs/ioctl.c:853 __do_sys_ioctl fs/ioctl.c:872 [inline] __se_sys_ioctl+0x81/0x160 fs/ioctl.c:860 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:0x7ff66a973ba9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 41 1a 00 00 90 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:00007ffde0ff8068 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ff66a9b5110 RCX: 00007ff66a973ba9 RDX: 0000000020000000 RSI: 0000000040305829 RDI: 0000000000000004 RBP: 636f6c6c615f6164 R08: 00007ff66a9b50cc R09: 00007ff66a9b50cc R10: 00007ff66a9b50cc R11: 0000000000000246 R12: 5f61645f6f747561 R13: 00007ff66a9b50e5 R14: 0000000000000001 R15: 0000000000000001 The buggy address belongs to the page: page:ffffea0001c00fc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x7003f flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001c01008 ffffea0001c00f88 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 0x8(__GFP_MOVABLE), pid 1, ts 10687359079, free_ts 11846083502 split_map_pages+0x246/0x510 mm/compaction.c:99 isolate_freepages_range+0x47c/0x4e0 mm/compaction.c:749 alloc_contig_range+0xc2b/0xf90 mm/page_alloc.c:9216 __alloc_contig_pages mm/page_alloc.c:9240 [inline] alloc_contig_pages+0x3ea/0x4e0 mm/page_alloc.c:9320 debug_vm_pgtable_alloc_huge_page+0xb9/0x110 mm/debug_vm_pgtable.c:1085 init_args+0xc4f/0xf40 mm/debug_vm_pgtable.c:1207 debug_vm_pgtable+0xaa/0x470 mm/debug_vm_pgtable.c:1245 do_one_initcall+0x22b/0x7a0 init/main.c:1302 do_initcall_level+0x157/0x210 init/main.c:1375 do_initcalls+0x49/0x90 init/main.c:1391 kernel_init_freeable+0x425/0x5c0 init/main.c:1615 kernel_init+0x19/0x290 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 free_contig_range+0x95/0xf0 mm/page_alloc.c:9342 destroy_args+0xfe/0x980 mm/debug_vm_pgtable.c:1018 debug_vm_pgtable+0x40d/0x470 mm/debug_vm_pgtable.c:1331 do_one_initcall+0x22b/0x7a0 init/main.c:1302 do_initcall_level+0x157/0x210 init/main.c:1375 do_initcalls+0x49/0x90 init/main.c:1391 kernel_init_freeable+0x425/0x5c0 init/main.c:1615 kernel_init+0x19/0x290 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 Memory state around the buggy address: ffff88807003f980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807003fa00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88807003fa80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88807003fb00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88807003fb80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================