EXT4-fs error (device loop1): ext4_free_blocks:6213: comm syz.1.463: Freeing blocks not in datazone - block = 41, count = 1 ================================================================== 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 ffff8880563c0018 by task syz.1.463/5934 CPU: 0 PID: 5934 Comm: syz.1.463 Not tainted 6.1.103-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/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:4127 ext4_fallocate+0x30b/0x2160 fs/ext4/extents.c:4737 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:0x7fd542d779f9 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:00007fd543b0f048 EFLAGS: 00000246 ORIG_RAX: 000000000000011d RAX: ffffffffffffffda RBX: 00007fd542f06058 RCX: 00007fd542d779f9 RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004 RBP: 00007fd542de58ee R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001a00 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007fd542f06058 R15: 00007ffe6da64f18 The buggy address belongs to the physical page: page:ffffea000158f000 refcount:2 mapcount:0 mapping:ffff888148dec9f8 index:0x27 pfn:0x563c0 memcg:ffff888028c40000 aops:def_blk_aops ino:700001 flags: 0xfff98000002056(referenced|uptodate|lru|workingset|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff98000002056 ffffea0001c51cc8 ffff888029080338 ffff888148dec9f8 raw: 0000000000000027 ffff888072477000 00000002ffffffff ffff888028c40000 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 5905, tgid 5905 (syz.1.463), ts 195637006723, free_ts 195606445333 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:4283 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5551 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:3230 ext4_split_extent+0x1c0/0x4e0 fs/ext4/extents.c:3331 ext4_ext_convert_to_initialized fs/ext4/extents.c:3613 [inline] ext4_ext_handle_unwritten_extents fs/ext4/extents.c:3909 [inline] ext4_ext_map_blocks+0x4f8f/0x7b60 fs/ext4/extents.c:4207 ext4_map_blocks+0xa3c/0x1ca0 fs/ext4/inode.c:651 _ext4_get_block+0x23b/0x660 fs/ext4/inode.c:798 __block_write_begin_int+0x544/0x1a30 fs/buffer.c:1991 __block_write_begin fs/buffer.c:2041 [inline] block_page_mkwrite+0x2f5/0x610 fs/buffer.c:2510 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:3362 free_unref_page_list+0x663/0x900 mm/page_alloc.c:3503 release_pages+0x2836/0x2b40 mm/swap.c:1055 __pagevec_release+0x80/0xf0 mm/swap.c:1075 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] shmem_undo_range+0x865/0x2390 mm/shmem.c:946 shmem_truncate_range mm/shmem.c:1062 [inline] shmem_evict_inode+0x265/0xa60 mm/shmem.c:1171 evict+0x2a4/0x620 fs/inode.c:666 __dentry_kill+0x436/0x650 fs/dcache.c:611 dentry_kill+0xbb/0x290 dput+0xfb/0x1d0 fs/dcache.c:918 do_renameat2+0xded/0x1440 fs/namei.c:5031 __do_sys_rename fs/namei.c:5075 [inline] __se_sys_rename fs/namei.c:5073 [inline] __x64_sys_rename+0x82/0x90 fs/namei.c:5073 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: ffff8880563bff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880563bff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880563c0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880563c0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880563c0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================