================================================================== BUG: KASAN: out-of-bounds in ext4_ext_rm_leaf fs/ext4/extents.c:2711 [inline] BUG: KASAN: out-of-bounds in ext4_ext_remove_space+0x1e04/0x4db0 fs/ext4/extents.c:2933 Read of size 18446744073709551544 at addr ffff88806e356054 by task syz-executor.3/5869 CPU: 1 PID: 5869 Comm: syz-executor.3 Not tainted 5.15.156-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/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:2711 [inline] ext4_ext_remove_space+0x1e04/0x4db0 fs/ext4/extents.c:2933 ext4_punch_hole+0x7c0/0xc10 fs/ext4/inode.c:4088 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:0x7fc64dccada9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc64d04c0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fc64ddf9f80 RCX: 00007fc64dccada9 RDX: 0000000020000080 RSI: 000000004030582b RDI: 0000000000000004 RBP: 00007fc64dd1747a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fc64ddf9f80 R15: 00007fffd1d26db8 The buggy address belongs to the page: page:ffffea0001b8d580 refcount:2 mapcount:0 mapping:ffff888140834370 index:0x11 pfn:0x6e356 memcg:ffff88807cf78000 aops:def_blk_aops ino:700003 flags: 0xfff80000002036(referenced|uptodate|lru|active|private|node=0|zone=1|lastcpupid=0xfff) raw: 00fff80000002036 ffffea00017faa88 ffff888064c0b030 ffff888140834370 raw: 0000000000000011 ffff8880706d8488 00000002ffffffff ffff88807cf78000 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 5869, ts 131412496955, free_ts 129969475682 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 __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:1328 [inline] ext4_ext_create_new_leaf fs/ext4/extents.c:1429 [inline] ext4_ext_insert_extent+0xfdf/0x4e60 fs/ext4/extents.c:2099 ext4_ext_map_blocks+0x1d6d/0x7690 fs/ext4/extents.c:4337 ext4_map_blocks+0xaad/0x1e00 fs/ext4/inode.c:645 _ext4_get_block+0x23b/0x660 fs/ext4/inode.c:792 ext4_block_write_begin+0x6b0/0x13a0 fs/ext4/inode.c:1077 ext4_write_begin+0x6c6/0x15f0 ext4_da_write_begin+0x342/0xb60 fs/ext4/inode.c:2963 generic_perform_write+0x2bf/0x5b0 mm/filemap.c:3785 ext4_buffered_write_iter+0x227/0x360 fs/ext4/file.c:268 ext4_file_write_iter+0x87c/0x1990 call_write_iter include/linux/fs.h:2172 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xacf/0xe50 fs/read_write.c:594 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] truncate_inode_pages_range+0x48b/0x1290 mm/truncate.c:329 ext4_punch_hole+0x4a7/0xc10 fs/ext4/inode.c:4050 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 Memory state around the buggy address: ffff88806e355f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806e355f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88806e356000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88806e356080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88806e356100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================