================================================================== BUG: KASAN: slab-use-after-free in xfs_inode_item_push+0x367/0x370 fs/xfs/xfs_inode_item.c:743 Read of size 8 at addr ffff88806c70ed00 by task xfsaild/loop4/6689 CPU: 1 PID: 6689 Comm: xfsaild/loop4 Not tainted 6.10.0-rc1-syzkaller-00027-g4a4be1ad3a6e #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+0x116/0x1f0 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 xfs_inode_item_push+0x367/0x370 fs/xfs/xfs_inode_item.c:743 xfsaild_push_item fs/xfs/xfs_trans_ail.c:414 [inline] xfsaild_push fs/xfs/xfs_trans_ail.c:486 [inline] xfsaild+0xa03/0x2810 fs/xfs/xfs_trans_ail.c:671 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 6645: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] kmem_cache_alloc_noprof+0x121/0x2f0 mm/slub.c:4007 xfs_inode_item_init+0x24/0xc0 fs/xfs/xfs_inode_item.c:838 xfs_trans_ijoin+0xfc/0x160 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_trans_alloc_inode+0x1d6/0x3a0 fs/xfs/xfs_trans.c:1213 xfs_attr_add_fork+0x1bb/0x330 fs/xfs/libxfs/xfs_attr.c:966 xfs_attr_set+0xb6d/0xe10 fs/xfs/libxfs/xfs_attr.c:1029 xfs_attr_change+0x373/0x500 fs/xfs/xfs_xattr.c:113 xfs_xattr_set+0x164/0x240 fs/xfs/xfs_xattr.c:170 __vfs_setxattr+0x173/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x350 fs/xattr.c:321 do_setxattr+0x146/0x170 fs/xattr.c:629 setxattr+0x15d/0x180 fs/xattr.c:652 __do_sys_fsetxattr fs/xattr.c:708 [inline] __se_sys_fsetxattr fs/xattr.c:697 [inline] __x64_sys_fsetxattr+0x261/0x310 fs/xattr.c:697 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 16: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:579 poison_slab_object+0xf7/0x160 mm/kasan/common.c:240 __kasan_slab_free+0x32/0x50 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2195 [inline] slab_free mm/slub.c:4436 [inline] kmem_cache_free+0x12f/0x3a0 mm/slub.c:4511 xfs_inode_free_callback+0x159/0x240 fs/xfs/xfs_icache.c:146 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0x828/0x16b0 kernel/rcu/tree.c:2809 handle_softirqs+0x216/0x8f0 kernel/softirq.c:554 run_ksoftirqd kernel/softirq.c:928 [inline] run_ksoftirqd+0x3a/0x60 kernel/softirq.c:920 smpboot_thread_fn+0x661/0xa10 kernel/smpboot.c:164 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff88806c70ecd0 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff88806c70ecd0, ffff88806c70edd8) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88806c70e148 pfn:0x6c70e flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000000 ffff888019fe3dc0 dead000000000122 0000000000000000 raw: ffff88806c70e148 00000000800c0008 00000001ffffefff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x152c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 5567, tgid 5523 (syz-executor.3), ts 103916528785, free_ts 92870401633 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x136a/0x2df0 mm/page_alloc.c:3402 __alloc_pages_noprof+0x22b/0x2460 mm/page_alloc.c:4660 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x56/0x110 mm/slub.c:2264 allocate_slab mm/slub.c:2427 [inline] new_slab+0x84/0x260 mm/slub.c:2480 ___slab_alloc+0xdac/0x1870 mm/slub.c:3666 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3756 __slab_alloc_node mm/slub.c:3809 [inline] slab_alloc_node mm/slub.c:3988 [inline] kmem_cache_alloc_noprof+0x2a7/0x2f0 mm/slub.c:4007 xfs_inode_item_init+0x24/0xc0 fs/xfs/xfs_inode_item.c:838 xfs_trans_ijoin+0xfc/0x160 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_init_new_inode+0x881/0x1870 fs/xfs/xfs_inode.c:881 xfs_create+0x900/0x1020 fs/xfs/xfs_inode.c:1102 xfs_generic_create+0x6ff/0x940 fs/xfs/xfs_iops.c:202 lookup_open.isra.0+0x10a1/0x13c0 fs/namei.c:3505 open_last_lookups fs/namei.c:3574 [inline] path_openat+0x92f/0x29f0 fs/namei.c:3804 do_filp_open+0x1dc/0x430 fs/namei.c:3834 page last free pid 4535 tgid 4535 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0x64a/0xe40 mm/page_alloc.c:2565 __put_partials+0x14c/0x170 mm/slub.c:2994 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] __do_kmalloc_node mm/slub.c:4120 [inline] __kmalloc_noprof+0x19d/0x410 mm/slub.c:4134 kmalloc_noprof include/linux/slab.h:664 [inline] tomoyo_realpath_from_path+0xb9/0x720 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x273/0x450 security/tomoyo/file.c:822 security_inode_getattr+0xf4/0x160 security/security.c:2269 vfs_getattr fs/stat.c:173 [inline] vfs_fstat+0x53/0xd0 fs/stat.c:198 vfs_fstatat+0x134/0x150 fs/stat.c:300 __do_sys_newfstatat+0xa6/0x130 fs/stat.c:468 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88806c70ec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88806c70ec80: fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb >ffff88806c70ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806c70ed80: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff88806c70ee00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================