================================================================== BUG: KASAN: use-after-free in ext4_ext_split fs/ext4/extents.c:1152 [inline] BUG: KASAN: use-after-free in ext4_ext_create_new_leaf fs/ext4/extents.c:1412 [inline] BUG: KASAN: use-after-free in ext4_ext_insert_extent+0x223d/0x4d20 fs/ext4/extents.c:2094 Read of size 12636729360 at addr ffff88810ecacffc by task syz-executor.0/2155 CPU: 1 PID: 2155 Comm: syz-executor.0 Not tainted 5.10.209-syzkaller-999850-ge7daca75b4c3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189 memmove+0x2d/0x70 mm/kasan/shadow.c:54 ext4_ext_split fs/ext4/extents.c:1152 [inline] ext4_ext_create_new_leaf fs/ext4/extents.c:1412 [inline] ext4_ext_insert_extent+0x223d/0x4d20 fs/ext4/extents.c:2094 ext4_ext_map_blocks+0x1b4c/0x6be0 fs/ext4/extents.c:4302 ext4_map_blocks+0xaa7/0x1ec0 fs/ext4/inode.c:646 _ext4_get_block+0x21b/0x610 fs/ext4/inode.c:793 ext4_get_block_unwritten+0x2a/0x40 fs/ext4/inode.c:824 ext4_block_write_begin+0x61e/0x13b0 fs/ext4/inode.c:1077 ext4_write_begin+0x6fa/0x1730 ext4_da_write_begin+0x49d/0xf60 fs/ext4/inode.c:3021 generic_perform_write+0x2cd/0x570 mm/filemap.c:3509 ext4_buffered_write_iter+0x482/0x610 fs/ext4/file.c:271 ext4_file_write_iter+0x193/0x1c80 fs/ext4/file.c:685 call_write_iter include/linux/fs.h:2019 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xb55/0xe70 fs/read_write.c:605 ksys_write+0x199/0x2c0 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7f4beb07f8d9 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:00007f4beac020c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f4beb19ef80 RCX: 00007f4beb07f8d9 RDX: 000000000208e24b RSI: 0000000020000000 RDI: 0000000000000006 RBP: 00007f4beb0dbad0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f4beb19ef80 R15: 00007ffeb5ed89b8 The buggy address belongs to the page: page:ffffea00043b2b00 refcount:2 mapcount:0 mapping:ffff88810044a8d0 index:0x80 pfn:0x10ecac aops:def_blk_aops ino:0 flags: 0x4000000000022036(referenced|uptodate|lru|active|private|mappedtodisk) raw: 4000000000022036 ffffea00044e3c48 ffffea000433b7c8 ffff88810044a8d0 raw: 0000000000000080 ffff8881262395e8 00000002ffffffff ffff888100144000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888100144000 page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 459, ts 77632300113, free_ts 76658741598 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5346 __alloc_pages include/linux/gfp.h:544 [inline] __alloc_pages_node include/linux/gfp.h:557 [inline] alloc_pages_node include/linux/gfp.h:571 [inline] alloc_pages include/linux/gfp.h:590 [inline] __page_cache_alloc include/linux/pagemap.h:290 [inline] page_cache_ra_unbounded+0x363/0x890 mm/readahead.c:226 do_page_cache_ra mm/readahead.c:277 [inline] force_page_cache_ra+0x373/0x3e0 mm/readahead.c:308 page_cache_sync_ra+0x254/0x2c0 mm/readahead.c:582 page_cache_sync_readahead include/linux/pagemap.h:837 [inline] generic_file_buffered_read+0x6da/0x2ad0 mm/filemap.c:2250 generic_file_read_iter+0x107/0x6b0 mm/filemap.c:2568 blkdev_read_iter+0x135/0x190 fs/block_dev.c:1956 call_read_iter include/linux/fs.h:2013 [inline] new_sync_read fs/read_write.c:415 [inline] vfs_read+0x999/0xbb0 fs/read_write.c:496 ksys_read+0x199/0x2c0 fs/read_write.c:634 __do_sys_read fs/read_write.c:644 [inline] __se_sys_read fs/read_write.c:642 [inline] __x64_sys_read+0x7b/0x90 fs/read_write.c:642 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443 release_pages+0xea0/0xef0 mm/swap.c:1103 __pagevec_release+0x84/0x100 mm/swap.c:1123 pagevec_release include/linux/pagevec.h:88 [inline] __invalidate_mapping_pages+0xa67/0xb50 mm/truncate.c:607 invalidate_mapping_pages+0x27/0x30 mm/truncate.c:632 invalidate_bdev+0xa3/0x140 fs/block_dev.c:97 ext4_put_super+0x67d/0xc70 fs/ext4/super.c:1237 generic_shutdown_super+0x14f/0x2d0 fs/super.c:465 kill_block_super+0x7e/0xe0 fs/super.c:1456 deactivate_locked_super+0xad/0x110 fs/super.c:335 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1118 __cleanup_mnt+0x19/0x20 fs/namespace.c:1125 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xbf/0xd0 kernel/entry/common.c:172 Memory state around the buggy address: ffff88810ecacf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88810ecacf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88810ecad000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810ecad080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810ecad100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================