================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894 Read of size 4 at addr ffff88812a146000 by task syz-executor.4/1375 CPU: 0 PID: 1375 Comm: syz-executor.4 Not tainted 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:0x7f5d188db687 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:00007fffd84ee2d8 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f5d188db687 RDX: 0000000000000200 RSI: 00007fffd84ef480 RDI: 00000000ffffff9c RBP: 00007f5d18938636 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007fffd84ef480 R13: 00007f5d18938636 R14: 000000000000b6b1 R15: 0000000000000007 The buggy address belongs to the page: page:ffffea0004a85180 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x12a146 flags: 0x4000000000000000() raw: 4000000000000000 ffffea0004a8b308 ffffea0004a56d08 0000000000000000 raw: 0000000000000001 0000000000000001 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 0x100cca(GFP_HIGHUSER_MOVABLE), pid 1415, ts 45811695810, free_ts 46655406871 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] shmem_alloc_page+0x257/0x420 mm/shmem.c:1580 shmem_alloc_and_acct_page+0x395/0x8e0 mm/shmem.c:1605 shmem_getpage_gfp+0x891/0x2480 mm/shmem.c:1918 shmem_fault+0x2d4/0x7b0 mm/shmem.c:2139 __do_fault mm/memory.c:4036 [inline] do_read_fault mm/memory.c:4371 [inline] do_fault mm/memory.c:4499 [inline] handle_pte_fault+0x23a9/0x3e30 mm/memory.c:4763 __handle_mm_fault mm/memory.c:4916 [inline] handle_mm_fault+0x11d6/0x1a10 mm/memory.c:5330 faultin_page mm/gup.c:902 [inline] __get_user_pages+0xb31/0x11b0 mm/gup.c:1121 populate_vma_page_range mm/gup.c:1454 [inline] __mm_populate+0x363/0x520 mm/gup.c:1502 mm_populate include/linux/mm.h:2768 [inline] vm_mmap_pgoff+0x264/0x390 mm/util.c:548 ksys_mmap_pgoff+0xf8/0x1f0 mm/mmap.c:1701 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:95 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __x64_sys_mmap+0x103/0x120 arch/x86/kernel/sys_x86_64.c:86 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 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 __pagevec_release+0x84/0x100 mm/swap.c:1123 pagevec_release include/linux/pagevec.h:88 [inline] shmem_undo_range+0x7d1/0x1a60 mm/shmem.c:965 shmem_truncate_range mm/shmem.c:1069 [inline] shmem_evict_inode+0x215/0x9d0 mm/shmem.c:1169 evict+0x2a3/0x6c0 fs/inode.c:577 iput_final fs/inode.c:1697 [inline] iput+0x632/0x7e0 fs/inode.c:1723 dentry_unlink_inode+0x2e5/0x3d0 fs/dcache.c:374 __dentry_kill+0x447/0x650 fs/dcache.c:579 dentry_kill+0xc0/0x2a0 dput+0x40/0x80 fs/dcache.c:879 __fput+0x4f4/0x760 fs/file_table.c:294 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x129/0x190 kernel/task_work.c:165 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xc83/0x2a50 kernel/exit.c:861 Memory state around the buggy address: ffff88812a145f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812a145f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88812a146000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88812a146080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812a146100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================