loop0: detected capacity change from 0 to 512 EXT4-fs: Ignoring removed bh option EXT4-fs (loop0): mounting ext3 file system using the ext4 subsystem EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem without journal. Quota mode: none. ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xee/0x1b0 fs/ext4/namei.c:1544 Read of size 1 at addr ffff88806f6e93ed by task syz-executor.0/3923 CPU: 1 PID: 3923 Comm: syz-executor.0 Not tainted 6.1.111-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 ext4_search_dir+0xee/0x1b0 fs/ext4/namei.c:1544 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1726 __ext4_find_entry+0x2b0/0x1b20 fs/ext4/namei.c:1617 ext4_lookup_entry fs/ext4/namei.c:1772 [inline] ext4_lookup+0x176/0x740 fs/ext4/namei.c:1840 lookup_open fs/namei.c:3462 [inline] open_last_lookups fs/namei.c:3552 [inline] path_openat+0x10fb/0x2e60 fs/namei.c:3782 do_filp_open+0x230/0x480 fs/namei.c:3812 do_sys_openat2+0x13b/0x4f0 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_open fs/open.c:1342 [inline] __se_sys_open fs/open.c:1338 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1338 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fc72ac7cb29 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:00007fc72b9890c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007fc72ad9bf80 RCX: 00007fc72ac7cb29 RDX: 0000000000000000 RSI: 0000000000141042 RDI: 0000000020000100 RBP: 00007fc72acc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fc72ad9bf80 R15: 00007ffe8b700d48 The buggy address belongs to the physical page: page:ffffea0001bdba40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x6f6e9 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001bdba88 ffffea0001bdba08 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 0x152c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 3551, tgid 3551 (syz-executor), ts 63136945055, free_ts 87014765374 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517 prep_new_page mm/page_alloc.c:2524 [inline] get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4290 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5558 folio_alloc+0x1a/0x50 mm/mempolicy.c:2292 filemap_alloc_folio+0xda/0x4f0 mm/filemap.c:971 page_cache_ra_unbounded+0x1ee/0x7b0 mm/readahead.c:248 filemap_readahead mm/filemap.c:2611 [inline] filemap_get_pages mm/filemap.c:2652 [inline] filemap_read+0xaad/0x31d0 mm/filemap.c:2730 __kernel_read+0x421/0x890 fs/read_write.c:428 integrity_kernel_read+0xac/0xf0 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+0xa57/0x1c00 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x559/0xc40 security/integrity/ima/ima_api.c:293 process_measurement+0x135c/0x21b0 security/integrity/ima/ima_main.c:351 ima_file_check+0xed/0x170 security/integrity/ima/ima_main.c:534 do_open fs/namei.c:3630 [inline] path_openat+0x2687/0x2e60 fs/namei.c:3785 do_filp_open+0x230/0x480 fs/namei.c:3812 file_open_name+0x242/0x2a0 fs/open.c:1263 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1444 [inline] free_pcp_prepare mm/page_alloc.c:1494 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3369 free_unref_page_list+0x663/0x900 mm/page_alloc.c:3510 release_pages+0x2836/0x2b40 mm/swap.c:1055 __pagevec_release+0x80/0xf0 mm/swap.c:1075 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] truncate_inode_pages_range+0x48a/0x1340 mm/truncate.c:372 ext4_evict_inode+0x39c/0x1150 fs/ext4/inode.c:221 evict+0x529/0x930 fs/inode.c:701 do_unlinkat+0x509/0x820 fs/namei.c:4399 __do_sys_unlink fs/namei.c:4440 [inline] __se_sys_unlink fs/namei.c:4438 [inline] __x64_sys_unlink+0x45/0x50 fs/namei.c:4438 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff88806f6e9280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806f6e9300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88806f6e9380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88806f6e9400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88806f6e9480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================