================================================================== BUG: KASAN: slab-use-after-free in inode_state_read_once include/linux/fs.h:884 [inline] BUG: KASAN: slab-use-after-free in iput+0x3a7/0xe80 fs/inode.c:1977 Read of size 4 at addr ffff8880481af738 by task kworker/0:4/5303 CPU: 0 UID: 0 PID: 5303 Comm: kworker/0:4 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Workqueue: events fserror_worker Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xba/0x230 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 inode_state_read_once include/linux/fs.h:884 [inline] iput+0x3a7/0xe80 fs/inode.c:1977 fserror_worker+0x230/0x350 fs/fserror.c:69 process_one_work kernel/workqueue.c:3257 [inline] process_scheduled_works+0xaec/0x17a0 kernel/workqueue.c:3340 worker_thread+0xda6/0x1360 kernel/workqueue.c:3421 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Allocated by task 5316: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_lru_noprof+0x35f/0x6c0 mm/slub.c:5282 xfs_inode_alloc+0x7e/0x710 fs/xfs/xfs_icache.c:97 xfs_iget_cache_miss fs/xfs/xfs_icache.c:635 [inline] xfs_iget+0xa85/0x2ce0 fs/xfs/xfs_icache.c:799 xfs_lookup+0x321/0x630 fs/xfs/xfs_inode.c:553 xfs_vn_lookup+0x130/0x200 fs/xfs/xfs_iops.c:327 __lookup_slow+0x2b7/0x410 fs/namei.c:1916 lookup_slow+0x53/0x70 fs/namei.c:1933 ovl_lookup_positive_unlocked fs/overlayfs/namei.c:210 [inline] ovl_lookup_single+0x32f/0xea0 fs/overlayfs/namei.c:254 ovl_lookup_layer+0x377/0x450 fs/overlayfs/namei.c:359 ovl_lookup_layers fs/overlayfs/namei.c:1103 [inline] ovl_lookup+0x5f2/0x1c80 fs/overlayfs/namei.c:1397 lookup_one_qstr_excl+0x131/0x360 fs/namei.c:1805 __start_renaming+0x1db/0x410 fs/namei.c:3862 filename_renameat2+0x38c/0x9c0 fs/namei.c:6119 __do_sys_renameat2 fs/namei.c:6173 [inline] __se_sys_renameat2+0x5a/0x2c0 fs/namei.c:6168 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 15: kasan_save_stack mm/kasan/common.c:57 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:78 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5c/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6674 [inline] kmem_cache_free+0x195/0x610 mm/slub.c:6789 rcu_do_batch kernel/rcu/tree.c:2617 [inline] rcu_core+0x7cd/0x1070 kernel/rcu/tree.c:2869 handle_softirqs+0x22a/0x7c0 kernel/softirq.c:622 run_ksoftirqd+0x36/0x60 kernel/softirq.c:1063 smpboot_thread_fn+0x541/0xa50 kernel/smpboot.c:160 kthread+0x388/0x470 kernel/kthread.c:467 ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Last potentially related work creation: kasan_save_stack+0x3e/0x60 mm/kasan/common.c:57 kasan_record_aux_stack+0xbd/0xd0 mm/kasan/generic.c:556 __call_rcu_common kernel/rcu/tree.c:3131 [inline] call_rcu+0xee/0x890 kernel/rcu/tree.c:3251 xfs_iget_cache_miss fs/xfs/xfs_icache.c:740 [inline] xfs_iget+0xb01/0x2ce0 fs/xfs/xfs_icache.c:799 xfs_lookup+0x321/0x630 fs/xfs/xfs_inode.c:553 xfs_vn_lookup+0x130/0x200 fs/xfs/xfs_iops.c:327 __lookup_slow+0x2b7/0x410 fs/namei.c:1916 lookup_slow+0x53/0x70 fs/namei.c:1933 ovl_lookup_positive_unlocked fs/overlayfs/namei.c:210 [inline] ovl_lookup_single+0x32f/0xea0 fs/overlayfs/namei.c:254 ovl_lookup_layer+0x377/0x450 fs/overlayfs/namei.c:359 ovl_lookup_layers fs/overlayfs/namei.c:1103 [inline] ovl_lookup+0x5f2/0x1c80 fs/overlayfs/namei.c:1397 lookup_one_qstr_excl+0x131/0x360 fs/namei.c:1805 __start_renaming+0x1db/0x410 fs/namei.c:3862 filename_renameat2+0x38c/0x9c0 fs/namei.c:6119 __do_sys_renameat2 fs/namei.c:6173 [inline] __se_sys_renameat2+0x5a/0x2c0 fs/namei.c:6168 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff8880481af480 which belongs to the cache xfs_inode of size 1784 The buggy address is located 696 bytes inside of freed 1784-byte region [ffff8880481af480, ffff8880481afb78) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x481ac head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff88803467d681 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff888000eeab40 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080080008 00000000f5000000 ffff88803467d681 head: 04fff00000000040 ffff888000eeab40 dead000000000122 0000000000000000 head: 0000000000000000 0000000080080008 00000000f5000000 ffff88803467d681 head: 04fff00000000002 ffffea0001206b01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Reclaimable, gfp_mask 0xd2050(__GFP_RECLAIMABLE|__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5316, tgid 5315 (syz.0.0), ts 75019169886, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x228/0x280 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5240 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab+0x86/0x3a0 mm/slub.c:3248 new_slab mm/slub.c:3302 [inline] ___slab_alloc+0xd90/0x1790 mm/slub.c:4656 __slab_alloc+0x65/0x100 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] kmem_cache_alloc_lru_noprof+0x3ed/0x6c0 mm/slub.c:5282 xfs_inode_alloc+0x7e/0x710 fs/xfs/xfs_icache.c:97 xfs_iget_cache_miss fs/xfs/xfs_icache.c:635 [inline] xfs_iget+0xa85/0x2ce0 fs/xfs/xfs_icache.c:799 xfs_icreate+0xbe/0x170 fs/xfs/xfs_inode.c:600 xfs_create+0x648/0xae0 fs/xfs/xfs_inode.c:721 xfs_generic_create+0x410/0xb30 fs/xfs/xfs_iops.c:216 xfs_vn_mkdir+0x37/0x50 fs/xfs/xfs_iops.c:309 vfs_mkdir+0x413/0x630 fs/namei.c:5233 filename_mkdirat+0x285/0x510 fs/namei.c:5266 page_owner free stack trace missing Memory state around the buggy address: ffff8880481af600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880481af680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880481af700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880481af780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880481af800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================