EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none. ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf2/0x1b0 fs/ext4/namei.c:1543 Read of size 1 at addr ffff888075a18d23 by task syz-executor.0/5478 CPU: 0 PID: 5478 Comm: syz-executor.0 Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x163/0x540 mm/kasan/report.c:475 kasan_report+0x142/0x170 mm/kasan/report.c:588 ext4_search_dir+0xf2/0x1b0 fs/ext4/namei.c:1543 ext4_find_inline_entry+0x4ba/0x5e0 fs/ext4/inline.c:1694 __ext4_find_entry+0x2b4/0x1b30 fs/ext4/namei.c:1616 ext4_lookup_entry fs/ext4/namei.c:1771 [inline] ext4_lookup+0x17a/0x750 fs/ext4/namei.c:1839 lookup_one_qstr_excl+0x11b/0x250 fs/namei.c:1609 filename_create+0x297/0x530 fs/namei.c:3876 do_mkdirat+0xbd/0x3a0 fs/namei.c:4121 __do_sys_mkdirat fs/namei.c:4144 [inline] __se_sys_mkdirat fs/namei.c:4142 [inline] __x64_sys_mkdirat+0x89/0xa0 fs/namei.c:4142 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f096ac7cae9 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:00007f0969ffe0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f096ad9bf80 RCX: 00007f096ac7cae9 RDX: 0000000000000000 RSI: 0000000020000040 RDI: ffffffffffffff9c RBP: 00007f096acc847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f096ad9bf80 R15: 00007ffeff5235c8 The buggy address belongs to the physical page: page:ffffea0001d68600 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x75a18 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 ffffea0001d68648 ffffea0001d6adc8 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 5054, tgid 5054 (syz-executor), ts 55311574060, free_ts 81609461610 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3312 __alloc_pages+0x255/0x680 mm/page_alloc.c:4568 alloc_pages_mpol+0x3de/0x640 mm/mempolicy.c:2133 alloc_pages mm/mempolicy.c:2204 [inline] folio_alloc+0x12a/0x330 mm/mempolicy.c:2211 filemap_alloc_folio+0xde/0x500 mm/filemap.c:974 page_cache_ra_unbounded+0x1f2/0x7c0 mm/readahead.c:247 filemap_readahead mm/filemap.c:2472 [inline] filemap_get_pages+0x742/0x2080 mm/filemap.c:2513 filemap_read+0x41b/0xec0 mm/filemap.c:2593 __kernel_read+0x425/0x8b0 fs/read_write.c:428 integrity_kernel_read+0xb0/0xf0 security/integrity/iint.c:221 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+0xad1/0x1b30 security/integrity/ima/ima_crypto.c:573 ima_collect_measurement+0x554/0xb30 security/integrity/ima/ima_api.c:290 process_measurement+0x1373/0x21c0 security/integrity/ima/ima_main.c:359 ima_file_check+0xf1/0x170 security/integrity/ima/ima_main.c:557 do_open fs/namei.c:3624 [inline] path_openat+0x2897/0x3290 fs/namei.c:3779 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1137 [inline] free_unref_page_prepare+0x931/0xa60 mm/page_alloc.c:2347 free_unref_page_list+0x5a0/0x840 mm/page_alloc.c:2533 release_pages+0x2117/0x2400 mm/swap.c:1042 __folio_batch_release+0x84/0x100 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] truncate_inode_pages_range+0x457/0xf70 mm/truncate.c:371 ext4_evict_inode+0x21c/0xf30 fs/ext4/inode.c:193 evict+0x2a4/0x630 fs/inode.c:666 do_unlinkat+0x512/0x830 fs/namei.c:4389 __do_sys_unlink fs/namei.c:4430 [inline] __se_sys_unlink fs/namei.c:4428 [inline] __x64_sys_unlink+0x49/0x50 fs/namei.c:4428 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x45/0x110 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Memory state around the buggy address: ffff888075a18c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888075a18c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888075a18d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888075a18d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888075a18e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================