================================================================== 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 ffff888057a47408 by task xfsaild/loop5/26145 CPU: 0 PID: 26145 Comm: xfsaild/loop5 Not tainted 6.3.0-syzkaller-04626-g0cfd8703e7da #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:319 [inline] print_report+0x163/0x540 mm/kasan/report.c:430 kasan_report+0x176/0x1b0 mm/kasan/report.c:536 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+0x2b2/0x350 kernel/kthread.c:379 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 26098: 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:710 slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x11f/0x2e0 mm/slub.c:3476 kmem_cache_zalloc include/linux/slab.h:671 [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 26130: 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:3787 [inline] kmem_cache_free+0x297/0x520 mm/slub.c:3809 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 ffff888057a473d8 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff888057a473d8, ffff888057a474e0) The buggy address belongs to the physical page: page:ffffea00015e91c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888057a47520 pfn:0x57a47 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffff88801c328640 ffffea00015e62c0 0000000000000002 raw: ffff888057a47520 00000000800c000b 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 6413, tgid 6411 (syz-executor.2), ts 291690559981, free_ts 291501876952 prep_new_page mm/page_alloc.c:2553 [inline] get_page_from_freelist+0x3246/0x33c0 mm/page_alloc.c:4326 __alloc_pages+0x255/0x670 mm/page_alloc.c:5592 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:3193 __slab_alloc mm/slub.c:3292 [inline] __slab_alloc_node mm/slub.c:3345 [inline] slab_alloc_node mm/slub.c:3442 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:3476 kmem_cache_zalloc include/linux/slab.h:671 [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+0x622/0x8a0 fs/xfs/xfs_qm.c:1560 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+0xf94/0x11e0 fs/xfs/xfs_super.c:1677 get_tree_bdev+0x402/0x620 fs/super.c:1303 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1454 [inline] free_pcp_prepare mm/page_alloc.c:1504 [inline] free_unref_page_prepare+0xe2f/0xe70 mm/page_alloc.c:3388 free_unref_page+0x37/0x3f0 mm/page_alloc.c:3483 qlist_free_all+0x22/0x60 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x14b/0x160 mm/kasan/quarantine.c:294 __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:710 slab_alloc_node mm/slub.c:3452 [inline] slab_alloc mm/slub.c:3460 [inline] __kmem_cache_alloc_lru mm/slub.c:3467 [inline] kmem_cache_alloc+0x11f/0x2e0 mm/slub.c:3476 kmem_cache_zalloc include/linux/slab.h:671 [inline] jbd2_alloc_handle include/linux/jbd2.h:1602 [inline] new_handle fs/jbd2/transaction.c:476 [inline] jbd2__journal_start+0x148/0x5d0 fs/jbd2/transaction.c:503 __ext4_journal_start_sb+0x215/0x5a0 fs/ext4/ext4_jbd2.c:111 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0x92/0x110 fs/ext4/inode.c:6110 __mark_inode_dirty+0x305/0xd90 fs/fs-writeback.c:2424 generic_update_time fs/inode.c:1860 [inline] inode_update_time fs/inode.c:1873 [inline] touch_atime+0x3fe/0x680 fs/inode.c:1945 file_accessed include/linux/fs.h:2181 [inline] iterate_dir+0x488/0x570 fs/readdir.c:70 __do_sys_getdents64 fs/readdir.c:369 [inline] __se_sys_getdents64+0x20d/0x4f0 fs/readdir.c:354 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 Memory state around the buggy address: ffff888057a47300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057a47380: fb fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb >ffff888057a47400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057a47480: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff888057a47500: fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================