================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894 Read of size 4 at addr ffff88812cdbe000 by task syz-executor.3/7017 CPU: 1 PID: 7017 Comm: syz-executor.3 Tainted: G W 5.10.214-syzkaller-00187-ge6f44899ce5d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894 ext4_evict_inode+0x1095/0x1730 fs/ext4/inode.c:300 evict+0x2a3/0x6c0 fs/inode.c:577 iput_final fs/inode.c:1697 [inline] iput+0x632/0x7e0 fs/inode.c:1723 d_delete_notify include/linux/fsnotify.h:261 [inline] vfs_rmdir+0x271/0x3f0 fs/namei.c:3865 do_rmdir+0x2cf/0x5c0 fs/namei.c:3912 __do_sys_unlinkat fs/namei.c:4076 [inline] __se_sys_unlinkat fs/namei.c:4070 [inline] __x64_sys_unlinkat+0xdf/0xf0 fs/namei.c:4070 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7f096cb3d687 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 07 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:00007ffea8ebd5f8 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f096cb3d687 RDX: 0000000000000200 RSI: 00007ffea8ebe7a0 RDI: 00000000ffffff9c RBP: 00007f096cb9a636 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffea8ebe7a0 R13: 00007f096cb9a636 R14: 0000000000054fe9 R15: 0000000000000007 The buggy address belongs to the page: page:ffffea0004b36f80 refcount:2 mapcount:1 mapping:0000000000000000 index:0x555556f14 pfn:0x12cdbe anon flags: 0x4000000000080004(uptodate|swapbacked) raw: 4000000000080004 dead000000000100 dead000000000122 ffff8881151375c1 raw: 0000000555556f14 0000000000000000 0000000200000000 ffff8881180bc000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff8881180bc000 page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x100cca(GFP_HIGHUSER_MOVABLE), pid 7120, ts 348293110004, free_ts 348263145286 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5346 __alloc_pages include/linux/gfp.h:544 [inline] __alloc_pages_node include/linux/gfp.h:557 [inline] alloc_pages_node include/linux/gfp.h:571 [inline] alloc_pages include/linux/gfp.h:590 [inline] wp_page_copy+0x226/0x1940 mm/memory.c:3143 do_wp_page+0x71b/0xca0 handle_pte_fault+0xd59/0x3e30 mm/memory.c:4782 __handle_mm_fault mm/memory.c:4916 [inline] handle_mm_fault+0x11d6/0x1a10 mm/memory.c:5330 do_user_addr_fault arch/x86/mm/fault.c:1387 [inline] handle_page_fault arch/x86/mm/fault.c:1453 [inline] exc_page_fault+0x2a6/0x5b0 arch/x86/mm/fault.c:1509 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:571 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443 release_pages+0xea0/0xef0 mm/swap.c:1103 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:356 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:326 exit_mmap+0x312/0x5c0 mm/mmap.c:3357 __mmput+0x95/0x2d0 kernel/fork.c:1153 mmput+0x59/0x170 kernel/fork.c:1176 exit_mm kernel/exit.c:537 [inline] do_exit+0xbda/0x2a50 kernel/exit.c:848 do_group_exit+0x141/0x310 kernel/exit.c:983 __do_sys_exit_group kernel/exit.c:994 [inline] __se_sys_exit_group kernel/exit.c:992 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:992 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Memory state around the buggy address: ffff88812cdbdf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812cdbdf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88812cdbe000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88812cdbe080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812cdbe100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================