================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2910 Read of size 4 at addr ffff88811a901000 by task syz-executor313/297 CPU: 1 PID: 297 Comm: syz-executor313 Not tainted 5.15.167-syzkaller-android13-5.15.167_r00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1c0 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:2910 ext4_evict_inode+0xea1/0x14e0 fs/ext4/inode.c:300 evict+0x529/0x930 fs/inode.c:622 iput_final fs/inode.c:1740 [inline] iput+0x63b/0x7e0 fs/inode.c:1766 d_delete_notify include/linux/fsnotify.h:278 [inline] vfs_rmdir+0x359/0x470 fs/namei.c:4162 do_rmdir+0x3ab/0x630 fs/namei.c:4210 __do_sys_rmdir fs/namei.c:4229 [inline] __se_sys_rmdir fs/namei.c:4227 [inline] __x64_sys_rmdir+0x49/0x50 fs/namei.c:4227 x64_sys_call+0x274/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:85 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fcabe697dc7 Code: 73 01 c3 48 c7 c1 b8 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 54 00 00 00 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:00007ffe6ed70e78 EFLAGS: 00000207 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fcabe697dc7 RDX: 0000000000008890 RSI: 0000000000000000 RDI: 00007ffe6ed72020 RBP: 0000000000000065 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffe6ed72020 R13: 000055556afd0740 R14: 431bde82d7b634db R15: 00007ffe6ed741a0 The buggy address belongs to the page: page:ffffea00046a4040 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11a901 flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea00046a3e48 ffffea00046a6448 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0xc40(GFP_NOFS), pid 304, ts 28520438887, free_ts 28562133884 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 __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] __page_cache_alloc include/linux/pagemap.h:305 [inline] pagecache_get_page+0xb18/0xeb0 mm/filemap.c:1946 find_or_create_page include/linux/pagemap.h:418 [inline] ext4_mb_get_buddy_page_lock fs/ext4/mballoc.c:1402 [inline] ext4_mb_init_group+0x10d/0x590 fs/ext4/mballoc.c:1465 ext4_mb_good_group_nolock fs/ext4/mballoc.c:2584 [inline] ext4_mb_regular_allocator+0x1067/0x38e0 fs/ext4/mballoc.c:2793 ext4_mb_new_blocks+0xfe6/0x48f0 fs/ext4/mballoc.c:5780 ext4_new_meta_blocks+0x206/0x4f0 fs/ext4/balloc.c:738 ext4_xattr_block_set+0x232a/0x37e0 fs/ext4/xattr.c:2099 ext4_xattr_set_handle+0xdac/0x1560 fs/ext4/xattr.c:2412 ext4_initxattrs+0xa7/0x120 fs/ext4/xattr_security.c:44 security_inode_init_security+0x252/0x390 security/security.c:1115 ext4_init_security+0x34/0x40 fs/ext4/xattr_security.c:58 __ext4_new_inode+0x31f0/0x40a0 fs/ext4/ialloc.c:1329 ext4_create+0x275/0x550 fs/ext4/namei.c:2881 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page_list+0x14b/0xa60 mm/page_alloc.c:3671 release_pages+0x1310/0x1370 mm/swap.c:1009 __pagevec_release+0x84/0x100 mm/swap.c:1029 pagevec_release include/linux/pagevec.h:81 [inline] truncate_inode_pages_range+0x482/0x1160 mm/truncate.c:329 truncate_inode_pages mm/truncate.c:425 [inline] truncate_inode_pages_final+0x83/0x90 mm/truncate.c:464 ext4_evict_inode+0x3c8/0x14e0 fs/ext4/inode.c:214 evict+0x529/0x930 fs/inode.c:622 iput_final fs/inode.c:1740 [inline] iput+0x63b/0x7e0 fs/inode.c:1766 ext4_mb_release+0x78a/0xd40 fs/ext4/mballoc.c:3643 ext4_put_super+0x1f8/0xd20 fs/ext4/super.c:1203 generic_shutdown_super+0x157/0x2e0 fs/super.c:475 kill_block_super+0x7e/0xe0 fs/super.c:1425 deactivate_locked_super+0xad/0x110 fs/super.c:335 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1143 Memory state around the buggy address: ffff88811a900f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88811a900f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88811a901000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811a901080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811a901100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================