================================================================== 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:1986 Read of size 4 at addr ffff8880554751b8 by task kworker/0:5/5313 CPU: 0 UID: 0 PID: 5313 Comm: kworker/0:5 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:1986 fserror_worker+0x230/0x350 fs/fserror.c:69 process_one_work kernel/workqueue.c:3275 [inline] process_scheduled_works+0xaec/0x17a0 kernel/workqueue.c:3358 worker_thread+0xa50/0xfc0 kernel/workqueue.c:3439 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:245 Allocated by task 5315: 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:4459 [inline] slab_alloc_node mm/slub.c:4788 [inline] kmem_cache_alloc_lru_noprof+0x2b8/0x640 mm/slub.c:4807 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:211 [inline] ovl_lookup_single+0x32f/0xea0 fs/overlayfs/namei.c:255 ovl_lookup_layer+0x377/0x450 fs/overlayfs/namei.c:360 ovl_lookup_layers fs/overlayfs/namei.c:1163 [inline] ovl_lookup+0x9b0/0x1c80 fs/overlayfs/namei.c:1398 __lookup_slow+0x2b7/0x410 fs/namei.c:1916 lookup_slow+0x53/0x70 fs/namei.c:1933 walk_component fs/namei.c:2279 [inline] lookup_last fs/namei.c:2780 [inline] path_lookupat+0x3f5/0x8c0 fs/namei.c:2804 filename_lookup+0x256/0x5d0 fs/namei.c:2833 kern_path+0x3d/0x150 fs/namei.c:3040 lookup_bdev+0xc8/0x290 block/bdev.c:1221 quotactl_block fs/quota/quota.c:877 [inline] __do_sys_quotactl fs/quota/quota.c:955 [inline] __se_sys_quotactl+0x269/0x9e0 fs/quota/quota.c:917 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 4692: 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:2670 [inline] slab_free mm/slub.c:6082 [inline] kmem_cache_free+0x180/0x610 mm/slub.c:6212 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 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0x5f/0x150 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1056 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 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:211 [inline] ovl_lookup_single+0x32f/0xea0 fs/overlayfs/namei.c:255 ovl_lookup_layer+0x377/0x450 fs/overlayfs/namei.c:360 ovl_lookup_layers fs/overlayfs/namei.c:1163 [inline] ovl_lookup+0x9b0/0x1c80 fs/overlayfs/namei.c:1398 __lookup_slow+0x2b7/0x410 fs/namei.c:1916 lookup_slow+0x53/0x70 fs/namei.c:1933 walk_component fs/namei.c:2279 [inline] lookup_last fs/namei.c:2780 [inline] path_lookupat+0x3f5/0x8c0 fs/namei.c:2804 filename_lookup+0x256/0x5d0 fs/namei.c:2833 kern_path+0x3d/0x150 fs/namei.c:3040 lookup_bdev+0xc8/0x290 block/bdev.c:1221 quotactl_block fs/quota/quota.c:877 [inline] __do_sys_quotactl fs/quota/quota.c:955 [inline] __se_sys_quotactl+0x269/0x9e0 fs/quota/quota.c:917 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 ffff888055474f00 which belongs to the cache xfs_inode of size 1784 The buggy address is located 696 bytes inside of freed 1784-byte region [ffff888055474f00, ffff8880554755f8) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888055475e00 pfn:0x55474 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888055477c01 flags: 0x4fff00000000240(workingset|head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000240 ffff888031757000 ffffea0001551210 ffff888031756288 raw: ffff888055475e00 0000000800080004 00000000f5000000 ffff888055477c01 head: 04fff00000000240 ffff888031757000 ffffea0001551210 ffff888031756288 head: ffff888055475e00 0000000800080004 00000000f5000000 ffff888055477c01 head: 04fff00000000002 ffffea0001551d01 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 5315, tgid 5314 (syz.0.0), ts 85276374035, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x231/0x280 mm/page_alloc.c:1883 prep_new_page mm/page_alloc.c:1891 [inline] get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3956 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5244 alloc_slab_page mm/slub.c:3238 [inline] allocate_slab+0x77/0x660 mm/slub.c:3411 new_slab mm/slub.c:3469 [inline] refill_objects+0x331/0x3c0 mm/slub.c:7091 refill_sheaf mm/slub.c:2787 [inline] __pcs_replace_empty_main+0x2b9/0x620 mm/slub.c:4536 alloc_from_pcs mm/slub.c:4639 [inline] slab_alloc_node mm/slub.c:4773 [inline] kmem_cache_alloc_lru_noprof+0x37c/0x640 mm/slub.c:4807 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 fs/xfs/xfs_inode.c:600 [inline] xfs_create_tmpfile+0x309/0x610 fs/xfs/xfs_inode.c:829 xfs_rename_alloc_whiteout fs/xfs/xfs_inode.c:2094 [inline] xfs_rename+0x3db/0x1970 fs/xfs/xfs_inode.c:2167 xfs_vn_rename+0x2c7/0x3b0 fs/xfs/xfs_iops.c:499 vfs_rename+0xa96/0xeb0 fs/namei.c:6026 ovl_do_rename_rd fs/overlayfs/overlayfs.h:364 [inline] ovl_check_rename_whiteout fs/overlayfs/super.c:598 [inline] ovl_make_workdir fs/overlayfs/super.c:717 [inline] ovl_get_workdir fs/overlayfs/super.c:840 [inline] ovl_fill_super_creds fs/overlayfs/super.c:1453 [inline] ovl_fill_super+0x4677/0x5e60 fs/overlayfs/super.c:1567 vfs_get_super fs/super.c:1327 [inline] get_tree_nodev+0xbb/0x150 fs/super.c:1346 vfs_get_tree+0x92/0x2a0 fs/super.c:1754 page_owner free stack trace missing Memory state around the buggy address: ffff888055475080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888055475100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888055475180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888055475200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888055475280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================