==================================================================
BUG: KASAN: use-after-free in ext4_find_extent+0xae6/0xcc0
Read of size 4 at addr ffff88803c79110c by task syz.5.883/10000

CPU: 1 UID: 0 PID: 10000 Comm: syz.5.883 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250
 print_report+0xca/0x240
 kasan_report+0x118/0x150
 ext4_find_extent+0xae6/0xcc0
 ext4_ext_map_blocks+0x288/0x6ac0
 ext4_map_blocks+0x860/0x1740
 _ext4_get_block+0x200/0x4c0
 ext4_get_block_unwritten+0x2e/0x100
 ext4_block_write_begin+0x993/0x1710
 ext4_page_mkwrite+0x760/0x1190
 do_page_mkwrite+0x14d/0x310
 do_wp_page+0x268d/0x5800
 __handle_mm_fault+0x1033/0x5440
 handle_mm_fault+0x40a/0x8e0
 do_user_addr_fault+0xa81/0x1390
 exc_page_fault+0x76/0xf0
 asm_exc_page_fault+0x26/0x30
RIP: 0033:0x7f6b80b58a13
Code: 0f 10 44 16 c0 48 29 ce 48 ff c7 48 01 fe 48 8d 54 11 c0 0f 1f 40 00 0f 10 0e 0f 10 56 10 0f 10 5e 20 0f 10 66 30 48 83 ee c0 <0f> 29 0f 0f 29 57 10 0f 29 5f 20 0f 29 67 30 48 83 ef c0 48 39 fa
RSP: 002b:00007ffd4fcf0f98 EFLAGS: 00010207
RAX: 0000200000008400 RBX: 0000000000000004 RCX: 0000200000008400
RDX: 000020000000a3c0 RSI: 0000001b2d730e56 RDI: 0000200000008410
RBP: 00007f6b80dd7da0 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000002 R12: 00007f6b80dd5fac
R13: 00007f6b80dd5fa0 R14: fffffffffffffffe R15: 00007ffd4fcf10b0
 </TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x776 pfn:0x3c791
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea0000f1e488 ffffea0000f1e408 0000000000000000
raw: 0000000000000776 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 10002, tgid 10000 (syz.5.883), ts 376551851065, free_ts 377191749577
 post_alloc_hook+0x240/0x2a0
 get_page_from_freelist+0x21e4/0x22c0
 __alloc_frozen_pages_noprof+0x181/0x370
 alloc_pages_mpol+0x232/0x4a0
 folio_alloc_mpol_noprof+0x39/0x70
 shmem_alloc_and_add_folio+0x447/0xf60
 shmem_get_folio_gfp+0x59d/0x1660
 shmem_write_begin+0xf7/0x2b0
 generic_perform_write+0x2c5/0x900
 shmem_file_write_iter+0xf8/0x120
 vfs_write+0x5c9/0xb30
 ksys_write+0x145/0x250
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 10002 tgid 10000 stack trace:
 free_unref_folios+0xdbd/0x1520
 folios_put_refs+0x559/0x640
 shmem_undo_range+0x49e/0x14b0
 shmem_evict_inode+0x272/0xa70
 evict+0x504/0x9c0
 __dentry_kill+0x209/0x660
 dput+0x19f/0x2b0
 __fput+0x68e/0xa70
 fput_close_sync+0x119/0x200
 __x64_sys_close+0x7f/0x110
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff88803c791000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88803c791080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88803c791100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                      ^
 ffff88803c791180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88803c791200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
