================================================================== 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 ffff888078790928 by task xfsaild/loop5/17615 CPU: 1 PID: 17615 Comm: xfsaild/loop5 Not tainted 6.3.0-syzkaller-12728-g348551ddaf31 #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 17546: 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 5033: 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 ffff8880787908f8 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff8880787908f8, ffff888078790a00) The buggy address belongs to the physical page: page:ffffea0001e1e400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888078790148 pfn:0x78790 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000200 ffff8881406e4000 ffffea00007773c0 0000000000000004 raw: ffff888078790148 00000000800c0008 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 7482, tgid 7479 (syz-executor.5), ts 317369954693, free_ts 316354026966 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: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 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 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+0x157/0x350 mm/slub.c:3496 __alloc_skb+0x181/0x420 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1288 [inline] alloc_skb_with_frags+0xa8/0x750 net/core/skbuff.c:6370 sock_alloc_send_pskb+0x919/0xa50 net/core/sock.c:2729 unix_dgram_sendmsg+0x5b5/0x2050 net/unix/af_unix.c:1944 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] __sys_sendto+0x475/0x630 net/socket.c:2144 __do_sys_sendto net/socket.c:2156 [inline] __se_sys_sendto net/socket.c:2152 [inline] __x64_sys_sendto+0xde/0xf0 net/socket.c:2152 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 Memory state around the buggy address: ffff888078790800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078790880: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa >ffff888078790900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078790980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078790a00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================