================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 Read of size 4 at addr ffff88812ad51000 by task syz-executor/1077 CPU: 1 PID: 1077 Comm: syz-executor Tainted: G W 5.15.150-syzkaller-00330-g9044d25b8ff5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 ext4_evict_inode+0xea1/0x14e0 fs/ext4/inode.c:300 evict+0x2a3/0x630 fs/inode.c:587 iput_final fs/inode.c:1705 [inline] iput+0x63b/0x7e0 fs/inode.c:1731 d_delete_notify include/linux/fsnotify.h:270 [inline] vfs_rmdir+0x359/0x470 fs/namei.c:4162 do_rmdir+0x3ab/0x630 fs/namei.c:4210 __do_sys_unlinkat fs/namei.c:4390 [inline] __se_sys_unlinkat fs/namei.c:4384 [inline] __x64_sys_unlinkat+0xdf/0xf0 fs/namei.c:4384 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fe053cd3167 Code: 73 01 c3 48 c7 c1 a8 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 07 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc49fe7378 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007fe053cd3167 RDX: 0000000000000200 RSI: 00007ffc49fe8520 RDI: 00000000ffffff9c RBP: 00007fe053d4164a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffc49fe8520 R13: 00007fe053d4164a R14: 000000000000fad6 R15: 00007ffc49fea700 The buggy address belongs to the page: page:ffffea0004ab5440 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x12ad51 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0004a490c8 ffffea00049ee648 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 0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), pid 2140, ts 64428246492, free_ts 64496022336 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2604 prep_new_page+0x1b/0x110 mm/page_alloc.c:2610 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4484 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5776 __alloc_pages_node include/linux/gfp.h:591 [inline] alloc_pages_node include/linux/gfp.h:605 [inline] alloc_pages include/linux/gfp.h:618 [inline] wp_page_copy+0x1d4/0x1b00 mm/memory.c:3186 do_wp_page+0x6fa/0xb60 handle_pte_fault+0x7c0/0x24d0 mm/memory.c:4892 do_handle_mm_fault+0x1ea9/0x23a0 mm/memory.c:5293 do_user_addr_fault arch/x86/mm/fault.c:1365 [inline] handle_page_fault arch/x86/mm/fault.c:1549 [inline] exc_page_fault+0x26f/0x830 arch/x86/mm/fault.c:1605 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:568 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1471 [inline] free_pcp_prepare mm/page_alloc.c:1543 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3533 free_unref_page_list+0x14b/0xa60 mm/page_alloc.c:3670 release_pages+0x1310/0x1370 mm/swap.c:1009 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:320 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:338 exit_mmap+0x40d/0x940 mm/mmap.c:3218 __mmput+0x95/0x310 kernel/fork.c:1179 mmput+0x5b/0x170 kernel/fork.c:1202 exit_mm kernel/exit.c:552 [inline] do_exit+0xb9c/0x2ca0 kernel/exit.c:865 do_group_exit+0x141/0x310 kernel/exit.c:1000 __do_sys_exit_group kernel/exit.c:1011 [inline] __se_sys_exit_group kernel/exit.c:1009 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1009 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88812ad50f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812ad50f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88812ad51000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88812ad51080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812ad51100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================