EXT4-fs error (device loop0): ext4_free_blocks:6212: comm syz.0.24: Freeing blocks not in datazone - block = 41, count = 1 EXT4-fs (loop0): Remounting filesystem read-only ================================================================== BUG: KASAN: out-of-bounds in ext4_ext_rm_leaf fs/ext4/extents.c:2713 [inline] BUG: KASAN: out-of-bounds in ext4_ext_remove_space+0x1c22/0x4f30 fs/ext4/extents.c:2935 Read of size 18446744073709551604 at addr ffff888056577018 by task syz.0.24/3800 CPU: 0 PID: 3800 Comm: syz.0.24 Not tainted 6.1.105-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 kasan_check_range+0x27f/0x290 mm/kasan/generic.c:189 memmove+0x25/0x60 mm/kasan/shadow.c:54 ext4_ext_rm_leaf fs/ext4/extents.c:2713 [inline] ext4_ext_remove_space+0x1c22/0x4f30 fs/ext4/extents.c:2935 ext4_punch_hole+0x80b/0xd00 fs/ext4/inode.c:4138 ext4_fallocate+0x30b/0x2160 fs/ext4/extents.c:4738 vfs_fallocate+0x547/0x6b0 fs/open.c:323 ksys_fallocate fs/open.c:346 [inline] __do_sys_fallocate fs/open.c:354 [inline] __se_sys_fallocate fs/open.c:352 [inline] __x64_sys_fallocate+0xb9/0x100 fs/open.c:352 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f8e02179e79 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:00007f8e0302a038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d RAX: ffffffffffffffda RBX: 00007f8e02316058 RCX: 00007f8e02179e79 RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004 RBP: 00007f8e021e7916 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001a00 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f8e02316058 R15: 00007ffdc9f726c8 The buggy address belongs to the physical page: page:ffffea0001595dc0 refcount:3 mapcount:0 mapping:ffff88814088b3f8 index:0x27 pfn:0x56577 memcg:ffff888077d4e000 aops:def_blk_aops ino:700000 flags: 0xfff58000002056(referenced|uptodate|lru|workingset|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff58000002056 ffffea0001561e08 ffffea0001cf85c8 ffff88814088b3f8 raw: 0000000000000027 ffff8880595da570 00000003ffffffff ffff888077d4e000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x148c48(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 3800, tgid 3792 (syz.0.24), ts 66549662982, free_ts 66379016784 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517 prep_new_page mm/page_alloc.c:2524 [inline] get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4290 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5558 folio_alloc+0x1a/0x50 mm/mempolicy.c:2292 filemap_alloc_folio+0xda/0x4f0 mm/filemap.c:971 __filemap_get_folio+0x749/0xe80 mm/filemap.c:1965 pagecache_get_page+0x28/0x250 mm/folio-compat.c:110 find_or_create_page include/linux/pagemap.h:646 [inline] grow_dev_page fs/buffer.c:946 [inline] grow_buffers fs/buffer.c:1011 [inline] __getblk_slow fs/buffer.c:1038 [inline] __getblk_gfp+0x211/0xa20 fs/buffer.c:1333 sb_getblk_gfp include/linux/buffer_head.h:363 [inline] ext4_ext_grow_indepth fs/ext4/extents.c:1334 [inline] ext4_ext_create_new_leaf fs/ext4/extents.c:1435 [inline] ext4_ext_insert_extent+0xfdf/0x4e50 fs/ext4/extents.c:2102 ext4_split_extent_at+0x80e/0x10f0 fs/ext4/extents.c:3231 ext4_split_extent+0x1c0/0x4e0 fs/ext4/extents.c:3332 ext4_split_convert_extents fs/ext4/extents.c:3691 [inline] ext4_ext_handle_unwritten_extents fs/ext4/extents.c:3853 [inline] ext4_ext_map_blocks+0x25b2/0x7ab0 fs/ext4/extents.c:4208 ext4_map_blocks+0xa2b/0x1cb0 fs/ext4/inode.c:678 mpage_map_one_extent fs/ext4/inode.c:2433 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2486 [inline] ext4_writepages+0x1643/0x3de0 fs/ext4/inode.c:2854 do_writepages+0x3a2/0x670 mm/page-writeback.c:2491 filemap_fdatawrite_wbc+0x121/0x180 mm/filemap.c:388 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1444 [inline] free_pcp_prepare mm/page_alloc.c:1494 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3369 free_unref_page_list+0x663/0x900 mm/page_alloc.c:3510 release_pages+0x2836/0x2b40 mm/swap.c:1055 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu+0xfc/0x210 mm/mmu_gather.c:261 tlb_finish_mmu+0xce/0x1f0 mm/mmu_gather.c:361 exit_mmap+0x3c3/0x9f0 mm/mmap.c:3239 __mmput+0x115/0x3c0 kernel/fork.c:1199 exit_mm+0x226/0x300 kernel/exit.c:565 do_exit+0x9f6/0x26a0 kernel/exit.c:858 do_group_exit+0x202/0x2b0 kernel/exit.c:1021 __do_sys_exit_group kernel/exit.c:1032 [inline] __se_sys_exit_group kernel/exit.c:1030 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1030 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff888056576f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888056576f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888056577000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888056577080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888056577100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================