================================================================== BUG: KASAN: slab-use-after-free in xfs_inode_item_push+0x28f/0x2e0 fs/xfs/xfs_inode_item.c:594 Read of size 8 at addr ffff88801e0f77e0 by task xfsaild/loop1/16809 CPU: 1 PID: 16809 Comm: xfsaild/loop1 Not tainted 6.3.0-syzkaller-13164-g78b421b6a7c6 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0x163/0x540 mm/kasan/report.c:462 kasan_report+0x176/0x1b0 mm/kasan/report.c:572 xfs_inode_item_push+0x28f/0x2e0 fs/xfs/xfs_inode_item.c:594 xfsaild_push_item fs/xfs/xfs_trans_ail.c:414 [inline] xfsaild_push fs/xfs/xfs_trans_ail.c:486 [inline] xfsaild+0xc70/0x25d0 fs/xfs/xfs_trans_ail.c:671 kthread+0x2b8/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 16739: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x66/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:711 slab_alloc_node mm/slub.c:3451 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc+0x11f/0x2e0 mm/slub.c:3475 kmem_cache_zalloc include/linux/slab.h:670 [inline] xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:687 xfs_trans_ijoin+0xbd/0xe0 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_create+0x921/0x1240 fs/xfs/xfs_inode.c:1035 xfs_generic_create+0x491/0xd70 fs/xfs/xfs_iops.c:199 lookup_open fs/namei.c:3492 [inline] open_last_lookups fs/namei.c:3560 [inline] path_openat+0x13df/0x3170 fs/namei.c:3788 do_filp_open+0x234/0x490 fs/namei.c:3818 do_sys_openat2+0x13f/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_open fs/open.c:1380 [inline] __se_sys_open fs/open.c:1376 [inline] __x64_sys_open+0x225/0x270 fs/open.c:1376 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 15: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:521 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] kmem_cache_free+0x297/0x520 mm/slub.c:3808 xfs_inode_free_callback+0x152/0x1d0 fs/xfs/xfs_icache.c:145 rcu_do_batch kernel/rcu/tree.c:2115 [inline] rcu_core+0x9d7/0x15f0 kernel/rcu/tree.c:2377 __do_softirq+0x2ab/0x908 kernel/softirq.c:571 The buggy address belongs to the object at ffff88801e0f77b0 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff88801e0f77b0, ffff88801e0f78b8) The buggy address belongs to the physical page: page:ffffea0000783dc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1e0f7 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff8880147e0dc0 dead000000000122 0000000000000000 raw: 0000000000000000 00000000800c000c 00000001ffffffff 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 0x112c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 12078, tgid 12077 (syz-executor.2), ts 475326448312, free_ts 472493387110 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0x321c/0x33a0 mm/page_alloc.c:3502 __alloc_pages+0x255/0x670 mm/page_alloc.c:4768 alloc_slab_page+0x6a/0x160 mm/slub.c:1851 allocate_slab mm/slub.c:1998 [inline] new_slab+0x84/0x2f0 mm/slub.c:2051 ___slab_alloc+0xa85/0x10a0 mm/slub.c:3192 __slab_alloc mm/slub.c:3291 [inline] __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:3475 kmem_cache_zalloc include/linux/slab.h:670 [inline] xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:687 xfs_trans_ijoin+0xbd/0xe0 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_init_new_inode+0xdf4/0x10a0 fs/xfs/xfs_inode.c:902 xfs_qm_qino_alloc+0x4ff/0xa30 fs/xfs/xfs_qm.c:790 xfs_qm_init_quotainos+0x789/0x8a0 fs/xfs/xfs_qm.c:1576 xfs_qm_init_quotainfo+0x11e/0x1280 fs/xfs/xfs_qm.c:643 xfs_qm_mount_quotas+0x9b/0x620 fs/xfs/xfs_qm.c:1444 xfs_mountfs+0x1865/0x1f10 fs/xfs/xfs_mount.c:959 xfs_fs_fill_super+0xfd7/0x1230 fs/xfs/xfs_super.c:1690 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1302 [inline] free_unref_page_prepare+0x903/0xa30 mm/page_alloc.c:2564 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2659 discard_slab mm/slub.c:2097 [inline] __unfreeze_partials+0x1b1/0x1f0 mm/slub.c:2636 put_cpu_partial+0x116/0x180 mm/slub.c:2712 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x23/0x70 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x68/0x3a0 mm/slab.h:711 slab_alloc_node mm/slub.c:3451 [inline] __kmem_cache_alloc_node+0x14c/0x290 mm/slub.c:3490 __do_kmalloc_node mm/slab_common.c:965 [inline] __kmalloc+0xa8/0x230 mm/slab_common.c:979 kmalloc include/linux/slab.h:563 [inline] tomoyo_realpath_from_path+0xcf/0x5e0 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x254/0x4e0 security/tomoyo/file.c:771 security_file_open+0x63/0xa0 security/security.c:2797 do_dentry_open+0x308/0x10f0 fs/open.c:907 do_open fs/namei.c:3636 [inline] path_openat+0x27b3/0x3170 fs/namei.c:3791 do_filp_open+0x234/0x490 fs/namei.c:3818 Memory state around the buggy address: ffff88801e0f7680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801e0f7700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc >ffff88801e0f7780: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb ^ ffff88801e0f7800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801e0f7880: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc 00 ==================================================================