EXT4-fs error (device loop3): ext4_free_blocks:6223: comm syz.3.235: Freeing blocks not in datazone - block = 41, count = 1 ================================================================== BUG: KASAN: out-of-bounds in ext4_ext_rm_leaf fs/ext4/extents.c:2715 [inline] BUG: KASAN: out-of-bounds in ext4_ext_remove_space+0x1e04/0x4db0 fs/ext4/extents.c:2937 Read of size 18446744073709551604 at addr ffff8880588ea018 by task syz.3.235/5462 CPU: 1 PID: 5462 Comm: syz.3.235 Not tainted 5.15.173-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189 memmove+0x25/0x60 mm/kasan/shadow.c:54 ext4_ext_rm_leaf fs/ext4/extents.c:2715 [inline] ext4_ext_remove_space+0x1e04/0x4db0 fs/ext4/extents.c:2937 ext4_punch_hole+0x7c0/0xc10 fs/ext4/inode.c:4099 ext4_fallocate+0x30a/0x20f0 fs/ext4/extents.c:4763 vfs_fallocate+0x54a/0x6b0 fs/open.c:308 ksys_fallocate fs/open.c:331 [inline] __do_sys_fallocate fs/open.c:339 [inline] __se_sys_fallocate fs/open.c:337 [inline] __x64_sys_fallocate+0xb9/0x100 fs/open.c:337 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:0x7f52db512d19 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:00007f52d9362038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d RAX: ffffffffffffffda RBX: 00007f52db703080 RCX: 00007f52db512d19 RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004 RBP: 00007f52db58ea20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001a00 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f52db703080 R15: 00007ffc58f50058 The buggy address belongs to the page: page:ffffea0001623a80 refcount:2 mapcount:0 mapping:ffff888140894370 index:0x27 pfn:0x588ea memcg:ffff888020554000 aops:def_blk_aops ino:700003 flags: 0xfff00000002036(referenced|uptodate|lru|active|private|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000002036 ffffea0001f6f088 ffff8880202ef030 ffff888140894370 raw: 0000000000000027 ffff888070ca2bc8 00000002ffffffff ffff888020554000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), pid 5412, ts 187088112759, free_ts 180573485617 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192 __alloc_pages+0x272/0x700 mm/page_alloc.c:5464 __page_cache_alloc+0xd4/0x4a0 mm/filemap.c:1022 pagecache_get_page+0xa91/0x1010 mm/filemap.c:1940 find_or_create_page include/linux/pagemap.h:420 [inline] grow_dev_page fs/buffer.c:949 [inline] grow_buffers fs/buffer.c:1014 [inline] __getblk_slow fs/buffer.c:1041 [inline] __getblk_gfp+0x22a/0xaf0 fs/buffer.c:1336 sb_getblk_gfp include/linux/buffer_head.h:368 [inline] ext4_ext_grow_indepth fs/ext4/extents.c:1330 [inline] ext4_ext_create_new_leaf fs/ext4/extents.c:1431 [inline] ext4_ext_insert_extent+0xfe8/0x4e50 fs/ext4/extents.c:2102 ext4_split_extent_at+0x825/0x11b0 fs/ext4/extents.c:3234 ext4_split_extent+0x1c0/0x4e0 fs/ext4/extents.c:3353 ext4_ext_convert_to_initialized fs/ext4/extents.c:3637 [inline] ext4_ext_handle_unwritten_extents fs/ext4/extents.c:3932 [inline] ext4_ext_map_blocks+0x4d26/0x7630 fs/ext4/extents.c:4230 ext4_map_blocks+0xa66/0x1c70 fs/ext4/inode.c:672 _ext4_get_block+0x23b/0x660 fs/ext4/inode.c:815 __block_write_begin_int+0x60b/0x1650 fs/buffer.c:2012 __block_write_begin fs/buffer.c:2062 [inline] block_page_mkwrite+0x210/0x280 fs/buffer.c:2525 ext4_page_mkwrite+0x3e9/0x1290 fs/ext4/inode.c:6205 do_page_mkwrite+0x1a9/0x440 mm/memory.c:2920 wp_page_shared+0x179/0x690 mm/memory.c:3257 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_list+0x1f7/0x8e0 mm/page_alloc.c:3433 release_pages+0x1bb9/0x1f40 mm/swap.c:963 __pagevec_release+0x80/0xf0 mm/swap.c:983 pagevec_release include/linux/pagevec.h:81 [inline] shmem_undo_range+0x67a/0x1b50 mm/shmem.c:964 shmem_truncate_range mm/shmem.c:1063 [inline] shmem_evict_inode+0x21b/0xa00 mm/shmem.c:1147 evict+0x529/0x930 fs/inode.c:622 __dentry_kill+0x436/0x650 fs/dcache.c:586 dentry_kill+0xbb/0x290 dput+0xd8/0x1a0 fs/dcache.c:893 __fput+0x636/0x8e0 fs/file_table.c:288 task_work_run+0x129/0x1a0 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0x6a3/0x2480 kernel/exit.c:874 do_group_exit+0x144/0x310 kernel/exit.c:996 get_signal+0xc66/0x14e0 kernel/signal.c:2900 arch_do_signal_or_restart+0xc3/0x1890 arch/x86/kernel/signal.c:867 Memory state around the buggy address: ffff8880588e9f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880588e9f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880588ea000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880588ea080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880588ea100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================