EXT4-fs error (device loop0): ext4_free_blocks:6213: comm syz.0.21: 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+0x1e16/0x4f50 fs/ext4/extents.c:2935 Read of size 18446744073709551604 at addr ffff888123e5e018 by task syz.0.21/499 CPU: 0 PID: 499 Comm: syz.0.21 Not tainted 6.1.99-syzkaller-1151474-g110595418159 #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+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 kasan_check_range+0x294/0x2a0 mm/kasan/generic.c:189 memmove+0x2d/0x70 mm/kasan/shadow.c:54 ext4_ext_rm_leaf fs/ext4/extents.c:2713 [inline] ext4_ext_remove_space+0x1e16/0x4f50 fs/ext4/extents.c:2935 ext4_punch_hole+0x794/0xc00 fs/ext4/inode.c:4129 ext4_fallocate+0x318/0x1e90 fs/ext4/extents.c:4737 vfs_fallocate+0x492/0x570 fs/open.c:324 ksys_fallocate fs/open.c:347 [inline] __do_sys_fallocate fs/open.c:355 [inline] __se_sys_fallocate fs/open.c:353 [inline] __x64_sys_fallocate+0xc0/0x110 fs/open.c:353 x64_sys_call+0x783/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:286 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:0x7f52deb75bd9 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:00007f52df8f2048 EFLAGS: 00000246 ORIG_RAX: 000000000000011d RAX: ffffffffffffffda RBX: 00007f52ded04038 RCX: 00007f52deb75bd9 RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000000000004 RBP: 00007f52debe4aa1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000001a00 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f52ded04038 R15: 00007ffd5054c048 The buggy address belongs to the physical page: page:ffffea00048f9780 refcount:2 mapcount:0 mapping:ffff88810054d0d0 index:0x27 pfn:0x123e5e memcg:ffff888125e92000 aops:def_blk_aops ino:700000 flags: 0x5600000000002056(referenced|uptodate|lru|workingset|private|zone=1) raw: 5600000000002056 ffffea00048fbb08 ffffea00048f4508 ffff88810054d0d0 raw: 0000000000000027 ffff88811ebec7e0 00000002ffffffff ffff888125e92000 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 496, tgid 495 (syz.0.21), ts 50716554462, free_ts 50678534007 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4425 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5714 __folio_alloc+0x15/0x40 mm/page_alloc.c:5746 __folio_alloc_node include/linux/gfp.h:245 [inline] folio_alloc include/linux/gfp.h:274 [inline] filemap_alloc_folio include/linux/pagemap.h:513 [inline] __filemap_get_folio+0x827/0xae0 mm/filemap.c:1989 pagecache_get_page+0x2f/0x110 mm/folio-compat.c:110 find_or_create_page include/linux/pagemap.h:654 [inline] grow_dev_page fs/buffer.c:989 [inline] grow_buffers fs/buffer.c:1054 [inline] __getblk_slow fs/buffer.c:1081 [inline] __getblk_gfp+0x205/0x7d0 fs/buffer.c:1376 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+0xfd2/0x4e00 fs/ext4/extents.c:2102 ext4_split_extent_at+0x863/0x11f0 fs/ext4/extents.c:3230 ext4_split_extent+0x1bd/0x4e0 fs/ext4/extents.c:3331 ext4_split_convert_extents fs/ext4/extents.c:3690 [inline] ext4_ext_handle_unwritten_extents fs/ext4/extents.c:3852 [inline] ext4_ext_map_blocks+0x2201/0x7390 fs/ext4/extents.c:4207 ext4_map_blocks+0xa36/0x1ca0 fs/ext4/inode.c:651 mpage_map_one_extent fs/ext4/inode.c:2423 [inline] mpage_map_and_submit_extent fs/ext4/inode.c:2476 [inline] ext4_writepages+0x17b5/0x3fd0 fs/ext4/inode.c:2844 do_writepages+0x385/0x620 mm/page-writeback.c:2494 filemap_fdatawrite_wbc+0x153/0x1b0 mm/filemap.c:408 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1498 [inline] free_pcp_prepare mm/page_alloc.c:1572 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3498 free_unref_page_list+0xf1/0x7b0 mm/page_alloc.c:3646 release_pages+0xf7f/0xfe0 mm/swap.c:1063 folios_put include/linux/mm.h:1466 [inline] folio_batch_move_lru+0x3cf/0x4a0 mm/swap.c:253 lru_add_drain_cpu+0xf4/0x4e0 mm/swap.c:669 lru_add_drain+0x3d/0xc0 mm/swap.c:773 __pagevec_release+0x56/0x100 mm/swap.c:1080 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] truncate_inode_pages_range+0x1d1/0x1020 mm/truncate.c:374 truncate_inode_pages+0x24/0x30 mm/truncate.c:456 kill_bdev block/bdev.c:77 [inline] set_blocksize+0x2e8/0x360 block/bdev.c:157 sb_set_blocksize+0x4a/0xf0 block/bdev.c:166 ext4_load_super fs/ext4/super.c:5006 [inline] __ext4_fill_super fs/ext4/super.c:5062 [inline] ext4_fill_super+0x1394/0x8460 fs/ext4/super.c:5651 get_tree_bdev+0x440/0x680 fs/super.c:1357 ext4_get_tree+0x1c/0x20 fs/ext4/super.c:5681 vfs_get_tree+0x88/0x290 fs/super.c:1564 do_new_mount+0x2ba/0xb30 fs/namespace.c:3051 Memory state around the buggy address: ffff888123e5df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888123e5df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888123e5e000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888123e5e080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888123e5e100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== EXT4-fs error (device loop0): __ext4_get_inode_loc:4497: comm syz.0.21: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0) in ext4_reserve_inode_write:5870: Corrupt filesystem EXT4-fs error (device loop0): __ext4_ext_dirty:202: inode #16: comm syz.0.21: mark_inode_dirty error EXT4-fs error (device loop0): __ext4_get_inode_loc:4497: comm syz.0.21: Invalid inode table block 0 in block_group 0 EXT4-fs error (device loop0) in ext4_reserve_inode_write:5870: Corrupt filesystem EXT4-fs error (device loop0): ext4_punch_hole:4142: inode #16: comm syz.0.21: mark_inode_dirty error