================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:840 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xaea/0xcc0 fs/ext4/extents.c:956 Read of size 4 at addr ffff888065491e18 by task syz.3.790/11329 CPU: 0 UID: 0 PID: 11329 Comm: syz.3.790 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 ext4_ext_binsearch fs/ext4/extents.c:840 [inline] ext4_find_extent+0xaea/0xcc0 fs/ext4/extents.c:956 ext4_ext_map_blocks+0x283/0x58b0 fs/ext4/extents.c:4261 ext4_map_create_blocks+0x11d/0x540 fs/ext4/inode.c:616 ext4_map_blocks+0x7cd/0x11d0 fs/ext4/inode.c:809 ext4_iomap_alloc fs/ext4/inode.c:3714 [inline] ext4_iomap_begin+0xe87/0x1940 fs/ext4/inode.c:3797 iomap_iter+0x600/0x1020 fs/iomap/iter.c:110 __iomap_dio_rw+0x1363/0x1ea0 fs/iomap/direct-io.c:795 iomap_dio_rw+0x45/0xb0 fs/iomap/direct-io.c:890 ext4_dio_write_iter fs/ext4/file.c:576 [inline] ext4_file_write_iter+0x1728/0x1c10 fs/ext4/file.c:717 iter_file_splice_write+0x9a6/0x10f0 fs/splice.c:736 do_splice_from fs/splice.c:936 [inline] direct_splice_actor+0x104/0x160 fs/splice.c:1159 splice_direct_to_actor+0x545/0xc80 fs/splice.c:1103 do_splice_direct_actor fs/splice.c:1202 [inline] do_splice_direct+0x19b/0x2a0 fs/splice.c:1228 do_sendfile+0x547/0x7e0 fs/read_write.c:1372 __do_sys_sendfile64 fs/read_write.c:1433 [inline] __se_sys_sendfile64+0x144/0x1a0 fs/read_write.c:1419 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f5b48c5c799 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f5b46eae028 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f5b48ed5fa0 RCX: 00007f5b48c5c799 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000006 RBP: 00007f5b48cf2c99 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000020fffe82 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f5b48ed6038 R14: 00007f5b48ed5fa0 R15: 00007ffffc807538 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x8f0 pfn:0x65491 flags: 0x80000000000000(node=0|zone=1) raw: 0080000000000000 ffffea0001952408 ffffea0001952488 0000000000000000 raw: 00000000000008f0 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 11276, tgid 11275 (syz.0.783), ts 504179770865, free_ts 508353538347 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x28bb/0x2950 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250 alloc_pages_mpol+0xd1/0x380 mm/mempolicy.c:2484 folio_alloc_mpol_noprof+0x39/0xe0 mm/mempolicy.c:2503 shmem_alloc_folio mm/shmem.c:1930 [inline] shmem_alloc_and_add_folio mm/shmem.c:1972 [inline] shmem_get_folio_gfp+0x644/0x1a80 mm/shmem.c:2567 shmem_get_folio mm/shmem.c:2673 [inline] shmem_write_begin+0x166/0x320 mm/shmem.c:3327 generic_perform_write+0x2af/0x8b0 mm/filemap.c:4319 shmem_file_write_iter+0xfb/0x120 mm/shmem.c:3502 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x629/0xba0 fs/read_write.c:688 ksys_write+0x156/0x270 fs/read_write.c:740 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5798 tgid 5798 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] free_unref_folios+0xe7b/0x1c70 mm/page_alloc.c:3040 folios_put_refs+0x56f/0x680 mm/swap.c:1002 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x52c/0x1660 mm/shmem.c:1149 shmem_truncate_range mm/shmem.c:1277 [inline] shmem_evict_inode+0x240/0x9e0 mm/shmem.c:1407 evict+0x61e/0xb10 fs/inode.c:846 __dentry_kill+0x1a2/0x5e0 fs/dcache.c:670 finish_dput+0xc9/0x480 fs/dcache.c:879 __fput+0x6a3/0xa90 fs/file_table.c:477 task_work_run+0x1d9/0x270 kernel/task_work.c:233 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] __exit_to_user_mode_loop kernel/entry/common.c:67 [inline] exit_to_user_mode_loop+0xed/0x480 kernel/entry/common.c:98 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline] do_syscall_64+0x32d/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888065491d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888065491d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888065491e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888065491e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888065491f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================