================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2910 Read of size 4 at addr ffff888124e9c000 by task syz-executor385/296 CPU: 0 PID: 296 Comm: syz-executor385 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:0x7f8b5fab6dc7 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:00007fff191fefc8 EFLAGS: 00000207 ORIG_RAX: 0000000000000054 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f8b5fab6dc7 RDX: 0000000000008890 RSI: 0000000000000000 RDI: 00007fff19200170 RBP: 0000000000000065 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007fff19200170 R13: 000055556894b740 R14: 431bde82d7b634db R15: 00007fff192022f0 The buggy address belongs to the page: page:ffffea000493a700 refcount:2 mapcount:0 mapping:ffff88810c5d49a8 index:0x1e pfn:0x124e9c memcg:ffff888100210000 aops:shmem_aops ino:2 dentry name:"messages" flags: 0x400000000008002e(referenced|uptodate|dirty|active|swapbacked|zone=1) raw: 400000000008002e 0000000000000000 dead000000000122 ffff88810c5d49a8 raw: 000000000000001e 0000000000000000 00000002ffffffff ffff888100210000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x100cca(GFP_HIGHUSER_MOVABLE), pid 83, ts 25517070254, free_ts 25356444364 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] shmem_alloc_page mm/shmem.c:1587 [inline] shmem_alloc_and_acct_page+0x4bd/0xa80 mm/shmem.c:1612 shmem_getpage_gfp+0x1388/0x23c0 mm/shmem.c:1908 shmem_getpage mm/shmem.c:152 [inline] shmem_write_begin+0xca/0x1b0 mm/shmem.c:2479 generic_perform_write+0x2bc/0x5a0 mm/filemap.c:3849 __generic_file_write_iter+0x25b/0x4b0 mm/filemap.c:3976 generic_file_write_iter+0xaf/0x1c0 mm/filemap.c:4008 call_write_iter include/linux/fs.h:2204 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xd5d/0x1110 fs/read_write.c:594 ksys_write+0x199/0x2c0 fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:656 x64_sys_call+0x2f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2 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 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] shmem_undo_range+0x604/0x1560 mm/shmem.c:965 shmem_truncate_range mm/shmem.c:1064 [inline] shmem_evict_inode+0x215/0x9d0 mm/shmem.c:1146 evict+0x529/0x930 fs/inode.c:622 iput_final fs/inode.c:1740 [inline] iput+0x63b/0x7e0 fs/inode.c:1766 dentry_unlink_inode+0x34e/0x430 fs/dcache.c:380 __dentry_kill+0x447/0x660 fs/dcache.c:586 dentry_kill+0xc0/0x2a0 dput+0x45/0x80 fs/dcache.c:893 do_renameat2+0xc5b/0x1480 fs/namei.c:4987 __do_sys_rename fs/namei.c:5031 [inline] __se_sys_rename fs/namei.c:5029 [inline] __x64_sys_rename+0x86/0x90 fs/namei.c:5029 x64_sys_call+0x266/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:83 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff888124e9bf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888124e9bf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888124e9c000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff888124e9c080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888124e9c100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================