================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905 Read of size 4 at addr ffff8881399e4000 by task syz-executor.3/21031 CPU: 0 PID: 21031 Comm: syz-executor.3 Not tainted 6.1.78-syzkaller-00164-gac9706483e98 #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 mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905 ext4_evict_inode+0xef9/0x1550 fs/ext4/inode.c:296 evict+0x2a3/0x630 fs/inode.c:666 iput_final fs/inode.c:1791 [inline] iput+0x642/0x870 fs/inode.c:1817 d_delete_notify include/linux/fsnotify.h:284 [inline] vfs_rmdir+0x3c2/0x500 fs/namei.c:4205 do_rmdir+0x3ab/0x630 fs/namei.c:4253 __do_sys_unlinkat fs/namei.c:4433 [inline] __se_sys_unlinkat fs/namei.c:4427 [inline] __x64_sys_unlinkat+0xdf/0xf0 fs/namei.c:4427 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f6c6b67c747 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:00007fff0d725a08 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f6c6b67c747 RDX: 0000000000000200 RSI: 00007fff0d726bb0 RDI: 00000000ffffff9c RBP: 00007f6c6b6d9636 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007fff0d726bb0 R13: 00007f6c6b6d9636 R14: 0000000000159fcf R15: 000000000000000b The buggy address belongs to the physical page: page:ffffea0004e67900 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x1399e4 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0004946708 ffffea0004950008 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 0x152c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 27437, tgid 27435 (syz-executor.1), ts 1416530947944, free_ts 1416603178630 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4425 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5712 __folio_alloc+0x15/0x40 mm/page_alloc.c:5744 __folio_alloc_node include/linux/gfp.h:245 [inline] folio_alloc include/linux/gfp.h:274 [inline] filemap_alloc_folio include/linux/pagemap.h:507 [inline] page_cache_ra_unbounded+0x2a4/0x690 mm/readahead.c:259 do_page_cache_ra mm/readahead.c:311 [inline] page_cache_ra_order+0x92f/0xb40 mm/readahead.c:571 ondemand_readahead+0x92a/0xef0 mm/readahead.c:695 page_cache_async_ra+0xee/0x120 mm/readahead.c:744 do_async_mmap_readahead mm/filemap.c:3156 [inline] filemap_fault+0x6de/0x11a0 mm/filemap.c:3210 __do_fault mm/memory.c:4309 [inline] do_read_fault mm/memory.c:4668 [inline] do_fault+0xdb6/0x1cd0 mm/memory.c:4804 handle_pte_fault mm/memory.c:5101 [inline] __handle_mm_fault mm/memory.c:5243 [inline] handle_mm_fault+0x184a/0x2f40 mm/memory.c:5383 faultin_page mm/gup.c:1009 [inline] __get_user_pages+0x377/0xf20 mm/gup.c:1233 populate_vma_page_range mm/gup.c:1590 [inline] __mm_populate+0x375/0x570 mm/gup.c:1704 mm_populate include/linux/mm.h:3052 [inline] vm_mmap_pgoff+0x290/0x430 mm/util.c:530 ksys_mmap_pgoff+0x15d/0x1e0 mm/mmap.c:1521 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1498 [inline] free_pcp_prepare mm/page_alloc.c:1572 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3498 free_unref_page_list+0xf1/0x7b0 mm/page_alloc.c:3646 release_pages+0xf7f/0xfe0 mm/swap.c:1063 __pagevec_release+0x84/0x100 mm/swap.c:1083 pagevec_release include/linux/pagevec.h:71 [inline] folio_batch_release include/linux/pagevec.h:135 [inline] truncate_inode_pages_range+0x1d1/0x1020 mm/truncate.c:374 truncate_inode_pages mm/truncate.c:456 [inline] truncate_pagecache+0x6c/0x90 mm/truncate.c:762 ext4_setattr+0xfc9/0x1a50 fs/ext4/inode.c:5580 notify_change+0xd53/0x1010 fs/attr.c:499 do_truncate+0x21c/0x300 fs/open.c:66 handle_truncate fs/namei.c:3286 [inline] do_open fs/namei.c:3631 [inline] path_openat+0x2726/0x2d60 fs/namei.c:3784 do_filp_open+0x230/0x480 fs/namei.c:3811 do_sys_openat2+0x13f/0x850 fs/open.c:1341 do_sys_open fs/open.c:1357 [inline] __do_sys_creat fs/open.c:1433 [inline] __se_sys_creat fs/open.c:1427 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1427 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8881399e3f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881399e3f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881399e4000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881399e4080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881399e4100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================