================================================================== BUG: KASAN: slab-use-after-free in xfs_inode_item_push+0x293/0x2e0 fs/xfs/xfs_inode_item.c:743 Read of size 8 at addr ffff88805d5317e0 by task xfsaild/loop4/7973 CPU: 1 PID: 7973 Comm: xfsaild/loop4 Not tainted 6.9.0-rc4-next-20240418-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 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:743 xfsaild_push_item fs/xfs/xfs_trans_ail.c:414 [inline] xfsaild_push fs/xfs/xfs_trans_ail.c:486 [inline] xfsaild+0xd98/0x28b0 fs/xfs/xfs_trans_ail.c:671 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 7933: 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:3897 [inline] slab_alloc_node mm/slub.c:3957 [inline] kmem_cache_alloc_noprof+0x135/0x290 mm/slub.c:3964 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:838 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_create+0xa1f/0x1320 fs/xfs/xfs_inode.c:1095 xfs_generic_create+0x495/0xd70 fs/xfs/xfs_iops.c:199 lookup_open fs/namei.c:3505 [inline] open_last_lookups fs/namei.c:3574 [inline] path_openat+0x1425/0x3280 fs/namei.c:3804 do_filp_open+0x235/0x490 fs/namei.c:3834 do_sys_openat2+0x13e/0x1d0 fs/open.c:1405 do_sys_open fs/open.c:1420 [inline] __do_sys_open fs/open.c:1428 [inline] __se_sys_open fs/open.c:1424 [inline] __x64_sys_open+0x225/0x270 fs/open.c:1424 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 7052: 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:2190 [inline] slab_free mm/slub.c:4393 [inline] kmem_cache_free+0x145/0x340 mm/slub.c:4468 xfs_inode_free_callback+0x152/0x1d0 fs/xfs/xfs_icache.c:146 rcu_do_batch kernel/rcu/tree.c:2565 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2839 __do_softirq+0x2c6/0x980 kernel/softirq.c:554 The buggy address belongs to the object at ffff88805d5317b0 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff88805d5317b0, ffff88805d5318b8) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805d531290 pfn:0x5d531 anon flags: 0xfff80000000000(node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffefff(slab) raw: 00fff80000000000 ffff888017fd8dc0 0000000000000000 0000000000000001 raw: ffff88805d531290 00000000800c0009 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 6952, tgid -1238395686 (syz-executor.1), ts 6953, free_ts 162280167470 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1476 prep_new_page mm/page_alloc.c:1484 [inline] get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3446 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4704 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2259 allocate_slab+0x5a/0x2e0 mm/slub.c:2422 new_slab mm/slub.c:2475 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3624 __slab_alloc+0x58/0xa0 mm/slub.c:3714 __slab_alloc_node mm/slub.c:3767 [inline] slab_alloc_node mm/slub.c:3945 [inline] kmem_cache_alloc_noprof+0x1c1/0x290 mm/slub.c:3964 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:838 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_init_new_inode+0xd7e/0x10b0 fs/xfs/xfs_inode.c:878 xfs_qm_qino_alloc+0x4c2/0x9b0 fs/xfs/xfs_qm.c:800 xfs_qm_init_quotainos+0x78d/0x8a0 fs/xfs/xfs_qm.c:1607 xfs_qm_init_quotainfo+0x138/0x1120 fs/xfs/xfs_qm.c:643 xfs_qm_mount_quotas+0x9b/0x630 fs/xfs/xfs_qm.c:1475 xfs_mountfs+0x1849/0x1eb0 fs/xfs/xfs_mount.c:963 page last free pid 51 tgid 51 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1096 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2609 discard_slab mm/slub.c:2521 [inline] __put_partials+0xeb/0x130 mm/slub.c:2989 put_cpu_partial+0x17c/0x250 mm/slub.c:3064 __slab_free+0x2ea/0x3d0 mm/slub.c:4263 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:3897 [inline] slab_alloc_node mm/slub.c:3957 [inline] kmalloc_trace_noprof+0x132/0x2b0 mm/slub.c:4104 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] __devlink_health_reporter_create net/devlink/health.c:118 [inline] devl_health_reporter_create+0x163/0x3b0 net/devlink/health.c:200 nsim_dev_health_init+0x42/0x2d0 drivers/net/netdevsim/health.c:182 nsim_dev_reload_create drivers/net/netdevsim/dev.c:1486 [inline] nsim_dev_reload_up+0x425/0x8e0 drivers/net/netdevsim/dev.c:985 devlink_reload+0x473/0x870 net/devlink/dev.c:474 devlink_pernet_pre_exit+0x1f3/0x440 net/devlink/core.c:509 ops_pre_exit_list net/core/net_namespace.c:160 [inline] cleanup_net+0x615/0xcc0 net/core/net_namespace.c:617 process_one_work kernel/workqueue.c:3218 [inline] process_scheduled_works+0xa2c/0x1830 kernel/workqueue.c:3299 worker_thread+0x86d/0xd70 kernel/workqueue.c:3380 Memory state around the buggy address: ffff88805d531680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805d531700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc >ffff88805d531780: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb ^ ffff88805d531800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805d531880: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc 00 ==================================================================