================================================================== BUG: KASAN: slab-use-after-free in xfs_inode_item_push+0x293/0x2e0 fs/xfs/xfs_inode_item.c:775 Read of size 8 at addr ffff88805b146a70 by task xfsaild/loop1/17735 CPU: 0 UID: 0 PID: 17735 Comm: xfsaild/loop1 Not tainted 6.11.0-rc3-syzkaller-00156-gd7a5aa4b3c00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024 Call Trace: __dump_stack lib/dump_stack.c:93 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 xfs_inode_item_push+0x293/0x2e0 fs/xfs/xfs_inode_item.c:775 xfsaild_push_item fs/xfs/xfs_trans_ail.c:395 [inline] xfsaild_push fs/xfs/xfs_trans_ail.c:523 [inline] xfsaild+0x111a/0x2df0 fs/xfs/xfs_trans_ail.c:700 kthread+0x2f2/0x390 kernel/kthread.c:389 ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 17721: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4044 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:870 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_trans_alloc_dir+0x21e/0x750 fs/xfs/xfs_trans.c:1339 xfs_link+0x56e/0xd50 fs/xfs/xfs_inode.c:906 xfs_vn_link+0x1b8/0x2e0 fs/xfs/xfs_iops.c:391 vfs_link+0x4f7/0x690 fs/namei.c:4692 do_linkat+0x555/0x6f0 fs/namei.c:4762 __do_sys_link fs/namei.c:4796 [inline] __se_sys_link fs/namei.c:4794 [inline] __x64_sys_link+0x82/0x90 fs/namei.c:4794 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 17750: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2252 [inline] slab_free mm/slub.c:4473 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4548 xfs_inode_free_callback+0x152/0x1d0 fs/xfs/xfs_icache.c:145 rcu_do_batch kernel/rcu/tree.c:2569 [inline] rcu_core+0xaff/0x1830 kernel/rcu/tree.c:2843 handle_softirqs+0x2c6/0x970 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 The buggy address belongs to the object at ffff88805b146a40 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff88805b146a40, ffff88805b146b48) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805b1463d8 pfn:0x5b146 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000000 ffff88801b738a00 dead000000000122 0000000000000000 raw: ffff88805b1463d8 00000000800c0004 00000001fdffffff 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 5443, tgid 5443 (syz-executor), ts 228075461315, free_ts 144387438111 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1493 prep_new_page mm/page_alloc.c:1501 [inline] get_page_from_freelist+0x2e4c/0x2f10 mm/page_alloc.c:3442 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4700 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2321 allocate_slab+0x5a/0x2f0 mm/slub.c:2484 new_slab mm/slub.c:2537 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3723 __slab_alloc+0x58/0xa0 mm/slub.c:3813 __slab_alloc_node mm/slub.c:3866 [inline] slab_alloc_node mm/slub.c:4025 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4044 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:870 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_vn_update_time+0x3c6/0x600 fs/xfs/xfs_iops.c:1108 inode_update_time fs/inode.c:2016 [inline] touch_atime+0x27f/0x690 fs/inode.c:2089 file_accessed include/linux/fs.h:2485 [inline] iterate_dir+0x620/0x810 fs/readdir.c:111 __do_sys_getdents64 fs/readdir.c:407 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:392 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5566 tgid 5566 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1094 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2612 discard_slab mm/slub.c:2583 [inline] __put_partials+0xeb/0x130 mm/slub.c:3051 put_cpu_partial+0x17c/0x250 mm/slub.c:3126 __slab_free+0x2ea/0x3d0 mm/slub.c:4343 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3988 [inline] slab_alloc_node mm/slub.c:4037 [inline] __kmalloc_cache_noprof+0x132/0x2c0 mm/slub.c:4184 kmalloc_noprof include/linux/slab.h:681 [inline] kzalloc_noprof include/linux/slab.h:807 [inline] ref_tracker_alloc+0x14b/0x490 lib/ref_tracker.c:203 __netdev_tracker_alloc include/linux/netdevice.h:4047 [inline] netdev_tracker_alloc include/linux/netdevice.h:4059 [inline] netdev_get_by_index+0x7a/0xb0 net/core/dev.c:914 fib6_nh_init+0x1d8/0x2180 net/ipv6/route.c:3543 ip6_route_info_create+0x999/0x12b0 net/ipv6/route.c:3809 ip6_route_add+0x28/0x160 net/ipv6/route.c:3853 addrconf_prefix_route+0x314/0x4e0 net/ipv6/addrconf.c:2486 inet6_addr_add+0x627/0xb00 net/ipv6/addrconf.c:3063 inet6_rtm_newaddr+0x8a3/0xc90 net/ipv6/addrconf.c:5048 Memory state around the buggy address: ffff88805b146900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805b146980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805b146a00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff88805b146a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805b146b00: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ==================================================================