================================================================== 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 12501094416 at addr ffff888116e06ffc by task syz-executor.1/2022 CPU: 1 PID: 2022 Comm: syz-executor.1 Not tainted 5.10.215-syzkaller-1002366-gb58b8f9dad93 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/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+0x1c47/0x6ee0 fs/ext4/extents.c:4332 ext4_map_blocks+0xa65/0x1d10 fs/ext4/inode.c:644 _ext4_get_block+0x21b/0x610 fs/ext4/inode.c:787 ext4_get_block_unwritten+0x2a/0x40 fs/ext4/inode.c:818 ext4_block_write_begin+0x61e/0x13b0 fs/ext4/inode.c:1071 ext4_write_begin+0x6fa/0x1730 ext4_da_write_begin+0x49d/0xf60 fs/ext4/inode.c:3004 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:2021 [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:0x7f2f3a4128d9 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:00007f2f39f950c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f2f3a531f80 RCX: 00007f2f3a4128d9 RDX: 000000000208e24b RSI: 0000000020000000 RDI: 0000000000000006 RBP: 00007f2f3a46ead0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f2f3a531f80 R15: 00007ffd8d90f9a8 The buggy address belongs to the page: page:ffffea00045b8180 refcount:2 mapcount:0 mapping:ffff888109195c10 index:0x80 pfn:0x116e06 aops:def_blk_aops ino:0 flags: 0x4000000000022036(referenced|uptodate|lru|active|private|mappedtodisk) raw: 4000000000022036 ffffea00044b4a08 ffffea00041476c8 ffff888109195c10 raw: 0000000000000080 ffff888123511b28 00000002ffffffff ffff888100140000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888100140000 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 418, ts 75742858271, free_ts 75530733882 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:5348 __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:2015 [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 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:356 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:326 exit_mmap+0x312/0x5c0 mm/mmap.c:3357 __mmput+0x95/0x2d0 kernel/fork.c:1153 mmput+0x59/0x170 kernel/fork.c:1176 exit_mm kernel/exit.c:537 [inline] do_exit+0xbda/0x2a50 kernel/exit.c:848 do_group_exit+0x141/0x310 kernel/exit.c:983 get_signal+0x10a0/0x1410 kernel/signal.c:2782 arch_do_signal_or_restart+0xbd/0x17c0 arch/x86/kernel/signal.c:805 handle_signal_work kernel/entry/common.c:145 [inline] exit_to_user_mode_loop+0x9b/0xd0 kernel/entry/common.c:169 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xa2/0x1a0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Memory state around the buggy address: ffff888116e06f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888116e06f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888116e07000: fa fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ^ ffff888116e07080: fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 ffff888116e07100: 00 00 fc fc fc fc fc fc fc fc fb fb fb fb fb fb ==================================================================