================================================================== BUG: KASAN: use-after-free in ext4_read_inline_data fs/ext4/inline.c:209 [inline] BUG: KASAN: use-after-free in ext4_convert_inline_data_nolock+0x319/0xd80 fs/ext4/inline.c:1224 Read of size 68 at addr ffff8881d79720cf by task syz-executor.2/486 CPU: 1 PID: 486 Comm: syz-executor.2 Not tainted 5.4.278-syzkaller-04928-gf076c16c9840 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 check_memory_region_inline mm/kasan/generic.c:141 [inline] check_memory_region+0x272/0x280 mm/kasan/generic.c:191 memcpy+0x25/0x50 mm/kasan/common.c:123 ext4_read_inline_data fs/ext4/inline.c:209 [inline] ext4_convert_inline_data_nolock+0x319/0xd80 fs/ext4/inline.c:1224 ext4_try_add_inline_entry+0x7ff/0xb20 fs/ext4/inline.c:1349 ext4_add_entry+0x6c2/0x1240 fs/ext4/namei.c:2352 ext4_mkdir+0xc9f/0x1520 fs/ext4/namei.c:2942 vfs_mkdir+0x4b9/0x690 fs/namei.c:3965 do_mkdirat+0x1a6/0x2c0 fs/namei.c:3987 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7fc819d2e9a7 Code: 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 02 01 00 00 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:00007fc81988fef8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fc81988ff80 RCX: 00007fc819d2e9a7 RDX: 00000000000001ff RSI: 0000000020000580 RDI: 00000000ffffff9c RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000580 R13: 00007fc81988ff40 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:ffffea00075e5c80 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 flags: 0x8000000000000000() raw: 8000000000000000 ffffea00075e5cc8 ffffea00075e5c48 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 0x1100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|0x1000000) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 __alloc_pages include/linux/gfp.h:503 [inline] __alloc_pages_node include/linux/gfp.h:516 [inline] alloc_pages_node include/linux/gfp.h:530 [inline] alloc_zeroed_user_highpage_movable include/linux/highmem.h:211 [inline] wp_page_copy+0x20f/0x1820 mm/memory.c:2461 handle_pte_fault mm/memory.c:4044 [inline] __handle_mm_fault mm/memory.c:4152 [inline] handle_mm_fault+0x1888/0x4920 mm/memory.c:4189 do_user_addr_fault arch/x86/mm/fault.c:1444 [inline] __do_page_fault+0x509/0xbb0 arch/x86/mm/fault.c:1505 page_fault+0x2f/0x40 arch/x86/entry/entry_64.S:1206 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x297/0x380 mm/page_alloc.c:3085 free_unref_page_list+0x10a/0x590 mm/page_alloc.c:3154 release_pages+0xad8/0xb20 mm/swap.c:842 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:189 [inline] tlb_flush_mmu mm/mmu_gather.c:196 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:277 unmap_region+0x31c/0x370 mm/mmap.c:2644 __do_munmap+0x649/0x850 mm/mmap.c:2875 __vm_munmap mm/mmap.c:2898 [inline] __do_sys_munmap mm/mmap.c:2924 [inline] __se_sys_munmap+0x11d/0x1a0 mm/mmap.c:2920 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881d7971f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881d7972000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881d7972080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881d7972100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881d7972180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop2): ext4_check_all_de:657: inode #12: block 5: comm syz-executor.2: bad entry in directory: rec_len is smaller than minimal - offset=0, inode=0, rec_len=0, size=124 fake=0