================================================================== BUG: KASAN: use-after-free in ext4_xattr_set_entry+0x212/0x2034 fs/ext4/xattr.c:1593 Read of size 4 at addr ffffaf800f7f7ffe by task syz-executor.1/3929 CPU: 1 PID: 3929 Comm: syz-executor.1 Not tainted 5.17.0-rc1-syzkaller-00002-g0966d385830d #0 Hardware name: riscv-virtio,qemu (DT) Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:113 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:119 [] __dump_stack lib/dump_stack.c:88 [inline] [] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:106 [] print_address_description.constprop.0+0x2a/0x330 mm/kasan/report.c:255 [] __kasan_report mm/kasan/report.c:442 [inline] [] kasan_report+0x184/0x1e0 mm/kasan/report.c:459 [] check_region_inline mm/kasan/generic.c:183 [inline] [] __asan_load4+0x6e/0x96 mm/kasan/generic.c:255 [] ext4_xattr_set_entry+0x212/0x2034 fs/ext4/xattr.c:1593 [] ext4_xattr_ibody_set+0x5c/0x158 fs/ext4/xattr.c:2210 [] ext4_xattr_set_handle+0x65e/0xea0 fs/ext4/xattr.c:2367 [] ext4_xattr_set+0x12e/0x2b4 fs/ext4/xattr.c:2480 [] ext4_xattr_trusted_set+0x34/0x46 fs/ext4/xattr_trusted.c:38 [] __vfs_setxattr+0x106/0x172 fs/xattr.c:180 [] __vfs_setxattr_noperm+0xca/0x378 fs/xattr.c:214 [] __vfs_setxattr_locked+0x16a/0x186 fs/xattr.c:275 [] vfs_setxattr+0x136/0x296 fs/xattr.c:301 [] setxattr+0x212/0x29a fs/xattr.c:575 [] path_setxattr+0x1a2/0x1bc fs/xattr.c:595 [] __do_sys_lsetxattr fs/xattr.c:618 [inline] [] sys_lsetxattr+0x36/0x48 fs/xattr.c:614 [] ret_from_syscall+0x0/0x2 The buggy address belongs to the page: page:ffffaf807aaa4d78 refcount:2 mapcount:0 mapping:ffffaf800ababf10 index:0xb8 pfn:0x8f9f7 memcg:ffffaf80073e0000 aops:def_blk_aops ino:fd00000 flags: 0x880000203a(referenced|dirty|lru|active|private|section=17|node=0|zone=0) raw: 000000880000203a ffffaf807aaa4d38 ffffaf807aaa4708 ffffaf800ababf10 raw: 00000000000000b8 ffffaf8007752d98 00000002ffffffff ffffaf80073e0000 raw: 00000000000007ff page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x148c40(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL), pid 1, ts 535544763000, free_ts 0 __set_page_owner+0x48/0x136 mm/page_owner.c:183 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0xd0/0x10a mm/page_alloc.c:2427 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0x8da/0x12d8 mm/page_alloc.c:4165 __alloc_pages+0x150/0x3b6 mm/page_alloc.c:5389 alloc_pages+0x132/0x2a6 mm/mempolicy.c:2271 folio_alloc+0x24/0x30 mm/mempolicy.c:2281 filemap_alloc_folio mm/filemap.c:987 [inline] __filemap_get_folio+0x63c/0xd58 mm/filemap.c:1990 pagecache_get_page+0x2e/0x230 mm/folio-compat.c:125 find_or_create_page include/linux/pagemap.h:488 [inline] grow_dev_page fs/buffer.c:949 [inline] grow_buffers fs/buffer.c:1014 [inline] __getblk_slow+0x1f2/0x738 fs/buffer.c:1041 __getblk_gfp+0x74/0x78 fs/buffer.c:1334 sb_getblk_gfp include/linux/buffer_head.h:334 [inline] ext4_sb_breadahead_unmovable+0x46/0xa8 fs/ext4/super.c:264 __ext4_get_inode_loc+0x9d6/0xc08 fs/ext4/inode.c:4488 __ext4_get_inode_loc_noinmem+0xb2/0x138 fs/ext4/inode.c:4518 __ext4_iget+0x348/0x20f8 fs/ext4/inode.c:4711 ext4_lookup fs/ext4/namei.c:1785 [inline] ext4_lookup+0x28a/0x4ea fs/ext4/namei.c:1760 lookup_open.isra.0+0x6a6/0xd4a fs/namei.c:3308 page_owner free stack trace missing Memory state around the buggy address: ffffaf800f7f7f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffaf800f7f7f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffffaf800f7f8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffffaf800f7f8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffffaf800f7f8100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device vda): ext4_xattr_set_entry:1596: inode #640: comm syz-executor.1: corrupted xattr entries