================================================================== BUG: KASAN: use-after-free in get_max_inline_xattr_value_size+0x369/0x510 fs/ext4/inline.c:62 Read of size 4 at addr ffff88803b3160d4 by task syz-executor.3/24365 CPU: 0 PID: 24365 Comm: syz-executor.3 Not tainted 6.3.0-rc7-syzkaller-00043-gaf67688dca57 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/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:319 [inline] print_report+0x163/0x540 mm/kasan/report.c:430 kasan_report+0x176/0x1b0 mm/kasan/report.c:536 get_max_inline_xattr_value_size+0x369/0x510 fs/ext4/inline.c:62 ext4_update_inline_dir fs/ext4/inline.c:1109 [inline] ext4_try_add_inline_entry+0x34b/0xb70 fs/ext4/inline.c:1306 ext4_add_entry+0x535/0x1010 fs/ext4/namei.c:2384 ext4_mkdir+0x553/0xce0 fs/ext4/namei.c:3006 vfs_mkdir+0x29d/0x450 fs/namei.c:4038 do_mkdirat+0x264/0x520 fs/namei.c:4061 __do_sys_mkdir fs/namei.c:4081 [inline] __se_sys_mkdir fs/namei.c:4079 [inline] __x64_sys_mkdir+0x6e/0x80 fs/namei.c:4079 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fbdb608c169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fbdb6e3a168 EFLAGS: 00000246 ORIG_RAX: 0000000000000053 RAX: ffffffffffffffda RBX: 00007fbdb61abf80 RCX: 00007fbdb608c169 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000200000c0 RBP: 00007fbdb60e7ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffeb2c4b9f R14: 00007fbdb6e3a300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea0000ecc580 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x3b316 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000ed4508 ffffea0000e10448 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffff7f 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 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), pid 24364, tgid 24364 (syz-executor.4), ts 942705168876, free_ts 942753326886 prep_new_page mm/page_alloc.c:2553 [inline] get_page_from_freelist+0x3246/0x33c0 mm/page_alloc.c:4326 __alloc_pages+0x255/0x670 mm/page_alloc.c:5592 __folio_alloc+0x13/0x30 mm/page_alloc.c:5624 vma_alloc_folio+0x48a/0x9a0 mm/mempolicy.c:2244 do_anonymous_page mm/memory.c:4066 [inline] handle_pte_fault mm/memory.c:4921 [inline] __handle_mm_fault mm/memory.c:5065 [inline] handle_mm_fault+0x2984/0x51c0 mm/memory.c:5211 do_user_addr_fault arch/x86/mm/fault.c:1407 [inline] handle_page_fault arch/x86/mm/fault.c:1498 [inline] exc_page_fault+0x5b1/0x7c0 arch/x86/mm/fault.c:1554 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:570 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1454 [inline] free_pcp_prepare mm/page_alloc.c:1504 [inline] free_unref_page_prepare+0xe2f/0xe70 mm/page_alloc.c:3388 free_unref_page_list+0x596/0x830 mm/page_alloc.c:3529 release_pages+0x219e/0x2470 mm/swap.c:1042 tlb_batch_pages_flush mm/mmu_gather.c:97 [inline] tlb_flush_mmu_free mm/mmu_gather.c:292 [inline] tlb_flush_mmu+0x100/0x210 mm/mmu_gather.c:299 tlb_finish_mmu+0xd4/0x1f0 mm/mmu_gather.c:391 exit_mmap+0x3ce/0x9d0 mm/mmap.c:3043 __mmput+0x115/0x3c0 kernel/fork.c:1207 exit_mm+0x227/0x310 kernel/exit.c:563 do_exit+0x612/0x2290 kernel/exit.c:856 do_group_exit+0x206/0x2c0 kernel/exit.c:1019 __do_sys_exit_group kernel/exit.c:1030 [inline] __se_sys_exit_group kernel/exit.c:1028 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1028 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88803b315f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88803b316000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88803b316080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88803b316100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88803b316180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================