================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894 Read of size 4 at addr ffff88812fdf0000 by task syz-executor.3/6788 CPU: 0 PID: 6788 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:0x7fae4e3ca687 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:00007ffdd27cf508 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007fae4e3ca687 RDX: 0000000000000200 RSI: 00007ffdd27d06b0 RDI: 00000000ffffff9c RBP: 00007fae4e427636 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffdd27d06b0 R13: 00007fae4e427636 R14: 00000000000514b5 R15: 0000000000000007 The buggy address belongs to the page: page:ffffea0004bf7c00 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x12fdf0 flags: 0x4000000000000000() raw: 4000000000000000 ffffea00049d3408 ffffea0004804008 0000000000000000 raw: 0000000000000001 0000000000000002 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 0x112cca(GFP_HIGHUSER_MOVABLE|__GFP_NOWARN|__GFP_NORETRY), pid 7450, ts 329035081844, free_ts 329251528301 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] __page_cache_alloc include/linux/pagemap.h:290 [inline] page_cache_ra_unbounded+0x363/0x890 mm/readahead.c:226 do_page_cache_ra mm/readahead.c:277 [inline] ondemand_readahead+0x863/0xc60 mm/readahead.c:559 page_cache_async_ra+0x294/0x2d0 mm/readahead.c:617 page_cache_async_readahead include/linux/pagemap.h:860 [inline] generic_file_buffered_read+0x8a8/0x2ad0 mm/filemap.c:2262 generic_file_read_iter+0x107/0x6b0 mm/filemap.c:2568 ext4_file_read_iter+0x287/0x4d0 call_read_iter include/linux/fs.h:2015 [inline] generic_file_splice_read+0x4aa/0x780 fs/splice.c:311 do_splice_to fs/splice.c:788 [inline] splice_direct_to_actor+0x419/0xba0 fs/splice.c:867 do_splice_direct+0x27f/0x3c0 fs/splice.c:976 do_sendfile+0x8f4/0x10e0 fs/read_write.c:1257 __do_sys_sendfile64 fs/read_write.c:1318 [inline] __se_sys_sendfile64 fs/read_write.c:1304 [inline] __x64_sys_sendfile64+0x1ce/0x230 fs/read_write.c:1304 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] truncate_inode_pages_range+0xa81/0x1ae0 mm/truncate.c:367 truncate_inode_pages mm/truncate.c:473 [inline] truncate_inode_pages_final+0xc1/0xd0 mm/truncate.c:524 ext4_evict_inode+0x4e0/0x1730 fs/ext4/inode.c:225 evict+0x2a3/0x6c0 fs/inode.c:577 iput_final fs/inode.c:1697 [inline] iput+0x632/0x7e0 fs/inode.c:1723 do_unlinkat+0x48e/0x8b0 fs/namei.c:4042 __do_sys_unlink fs/namei.c:4082 [inline] __se_sys_unlink fs/namei.c:4080 [inline] __x64_sys_unlink+0x49/0x50 fs/namei.c:4080 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Memory state around the buggy address: ffff88812fdeff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812fdeff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88812fdf0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88812fdf0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88812fdf0100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================