================================================================== 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 ffff88803cf0c030 by task xfsaild/loop0/13727 CPU: 0 PID: 13727 Comm: xfsaild/loop0 Not tainted 6.3.0-syzkaller-11025-g89d77f71f493 #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 13666: 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:3416 [inline] open_last_lookups fs/namei.c:3484 [inline] path_openat+0x13df/0x3170 fs/namei.c:3712 do_filp_open+0x234/0x490 fs/namei.c:3742 do_sys_openat2+0x13f/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_creat fs/open.c:1448 [inline] __se_sys_creat fs/open.c:1442 [inline] __x64_sys_creat+0x123/0x160 fs/open.c:1442 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 8523: 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 ffff88803cf0c000 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff88803cf0c000, ffff88803cf0c108) The buggy address belongs to the physical page: page:ffffea0000f3c300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3cf0c flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff888013ff4280 ffffea0000e06ac0 0000000000000002 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 10170, tgid 10169 (syz-executor.5), ts 399898689373, free_ts 397647109988 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1722 prep_new_page mm/page_alloc.c:1729 [inline] get_page_from_freelist+0x321c/0x33a0 mm/page_alloc.c:3493 __alloc_pages+0x255/0x670 mm/page_alloc.c:4759 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_create+0x8ce/0x1240 fs/xfs/xfs_inode.c:1023 xfs_generic_create+0x491/0xd70 fs/xfs/xfs_iops.c:199 lookup_open fs/namei.c:3416 [inline] open_last_lookups fs/namei.c:3484 [inline] path_openat+0x13df/0x3170 fs/namei.c:3712 do_filp_open+0x234/0x490 fs/namei.c:3742 do_sys_openat2+0x13f/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_creat fs/open.c:1448 [inline] __se_sys_creat fs/open.c:1442 [inline] __x64_sys_creat+0x123/0x160 fs/open.c:1442 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:2555 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2650 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_node_track_caller+0xa5/0x230 mm/slab_common.c:986 kstrdup+0x3a/0x70 mm/util.c:62 smack_inode_init_security+0x3e0/0x4a0 security/smack/smack_lsm.c:963 security_inode_init_security+0x162/0x3f0 security/security.c:1619 __ext4_new_inode+0x341c/0x42e0 fs/ext4/ialloc.c:1322 ext4_symlink+0x38d/0xb30 fs/ext4/namei.c:3372 vfs_symlink+0x12f/0x2a0 fs/namei.c:4398 do_symlinkat+0x201/0x610 fs/namei.c:4424 __do_sys_symlinkat fs/namei.c:4440 [inline] __se_sys_symlinkat fs/namei.c:4437 [inline] __x64_sys_symlinkat+0x99/0xb0 fs/namei.c:4437 Memory state around the buggy address: ffff88803cf0bf00: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ffff88803cf0bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88803cf0c000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803cf0c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803cf0c100: fb fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb ==================================================================