================================================================== BUG: KASAN: use-after-free in ext4_ext_binsearch fs/ext4/extents.c:827 [inline] BUG: KASAN: use-after-free in ext4_find_extent+0xbcc/0xe00 fs/ext4/extents.c:946 Read of size 4 at addr ffff88806e88e070 by task syz-executor.0/4809 CPU: 1 PID: 4809 Comm: syz-executor.0 Not tainted 5.15.187-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 ext4_ext_binsearch fs/ext4/extents.c:827 [inline] ext4_find_extent+0xbcc/0xe00 fs/ext4/extents.c:946 ext4_ext_map_blocks+0x25a/0x64e0 fs/ext4/extents.c:4166 ext4_map_blocks+0x981/0x1b30 fs/ext4/inode.c:673 _ext4_get_block+0x1d7/0x4e0 fs/ext4/inode.c:816 __block_write_begin_int+0x54e/0x15a0 fs/buffer.c:2012 __block_write_begin fs/buffer.c:2062 [inline] block_page_mkwrite+0x210/0x280 fs/buffer.c:2525 ext4_page_mkwrite+0x3ed/0x1240 fs/ext4/inode.c:6235 do_page_mkwrite+0x168/0x3c0 mm/memory.c:2922 wp_page_shared+0x16b/0x6d0 mm/memory.c:3259 handle_pte_fault mm/memory.c:4668 [inline] __handle_mm_fault mm/memory.c:4785 [inline] handle_mm_fault+0x1eca/0x43c0 mm/memory.c:4883 do_user_addr_fault+0x489/0xc80 arch/x86/mm/fault.c:1357 handle_page_fault arch/x86/mm/fault.c:1445 [inline] exc_page_fault+0x60/0x100 arch/x86/mm/fault.c:1501 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:606 RIP: 0033:0x7fcfcf616cc7 Code: ce 48 ff c7 48 01 fe 48 8d 54 11 80 0f 1f 80 00 00 00 00 c5 fe 6f 0e c5 fe 6f 56 20 c5 fe 6f 5e 40 c5 fe 6f 66 60 48 83 ee 80 fd 7f 0f c5 fd 7f 57 20 c5 fd 7f 5f 40 c5 fd 7f 67 60 48 83 ef RSP: 002b:00007ffc333e26e8 EFLAGS: 00010203 RAX: 0000000020003600 RBX: 00007ffc333e27f8 RCX: 0000000020003600 RDX: 00000000200036a9 RSI: 00007fcfcf1d97b0 RDI: 0000000020003620 RBP: 0000000000000001 R08: 0000000000000000 R09: 00007fcfcf754f8c R10: 00007ffc333e2820 R11: 0000000000000246 R12: 00007fcfcf1d96f0 R13: fffffffffffffffe R14: 00007fcfcf1b9000 R15: 00007fcfcf1d96f8 The buggy address belongs to the page: page:ffffea0001ba2380 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x6e88e flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001ba23c8 ffffea0001ba2348 0000000000000000 raw: 0000000000000001 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 0x1112c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL|__GFP_MOVABLE|__GFP_SKIP_KASAN_POISON), pid 4184, ts 48249227885, free_ts 69543177092 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5474 __page_cache_alloc+0xd2/0x3f0 mm/filemap.c:1022 page_cache_ra_unbounded+0x255/0x930 mm/readahead.c:216 page_cache_async_readahead include/linux/pagemap.h:856 [inline] filemap_readahead mm/filemap.c:2525 [inline] filemap_get_pages mm/filemap.c:2567 [inline] filemap_read+0x738/0x2480 mm/filemap.c:2634 __kernel_read+0x4eb/0x910 fs/read_write.c:443 integrity_kernel_read+0x86/0xd0 security/integrity/iint.c:228 ima_calc_file_hash_tfm security/integrity/ima/ima_crypto.c:485 [inline] ima_calc_file_shash security/integrity/ima/ima_crypto.c:516 [inline] ima_calc_file_hash+0x1546/0x18e0 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x2ef/0x760 security/integrity/ima/ima_api.c:255 process_measurement+0xfb9/0x1a10 security/integrity/ima/ima_main.c:351 ima_file_check+0xc1/0x100 security/integrity/ima/ima_main.c:533 do_open fs/namei.c:3610 [inline] path_openat+0x2735/0x2f30 fs/namei.c:3742 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 file_open_name+0x156/0x1a0 fs/open.c:1198 __do_sys_swapon mm/swapfile.c:3187 [inline] __se_sys_swapon+0x8c9/0x2460 mm/swapfile.c:3146 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 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+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page_list+0x122/0x7e0 mm/page_alloc.c:3433 release_pages+0x184b/0x1bb0 mm/swap.c:963 __pagevec_release+0x6d/0xe0 mm/swap.c:983 pagevec_release include/linux/pagevec.h:81 [inline] truncate_inode_pages_range+0x2f3/0xef0 mm/truncate.c:329 ext4_evict_inode+0x376/0x1080 fs/ext4/inode.c:224 evict+0x485/0x870 fs/inode.c:647 do_unlinkat+0x3d8/0x6f0 fs/namei.c:4355 __do_sys_unlink fs/namei.c:4396 [inline] __se_sys_unlink fs/namei.c:4394 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4394 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff88806e88df00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806e88df80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88806e88e000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806e88e080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806e88e100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================