================================================================== BUG: KASAN: use-after-free in inode_dirtied_after fs/fs-writeback.c:1335 [inline] BUG: KASAN: use-after-free in move_expired_inodes+0x1b6/0x880 fs/fs-writeback.c:1367 Read of size 8 at addr ffff888071c815a8 by task kworker/u4:3/513 CPU: 1 PID: 513 Comm: kworker/u4:3 Not tainted 6.0.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: writeback wb_workfn (flush-7:0) Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x12a/0x1be lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:317 print_report+0x108/0x1f0 mm/kasan/report.c:433 kasan_report+0xc3/0xf0 mm/kasan/report.c:495 inode_dirtied_after fs/fs-writeback.c:1335 [inline] move_expired_inodes+0x1b6/0x880 fs/fs-writeback.c:1367 queue_io+0x22c/0x360 fs/fs-writeback.c:1427 wb_writeback+0x358/0x6b0 fs/fs-writeback.c:2042 wb_do_writeback fs/fs-writeback.c:2187 [inline] wb_workfn+0x3aa/0xd30 fs/fs-writeback.c:2227 process_one_work+0x7b9/0xc60 kernel/workqueue.c:2289 worker_thread+0x8ff/0xfe0 kernel/workqueue.c:2436 kthread+0x228/0x2a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 Allocated by task 4169: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] __kasan_slab_alloc+0xa3/0xd0 mm/kasan/common.c:470 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc_lru+0x175/0x2d0 mm/slub.c:3275 alloc_inode_sb include/linux/fs.h:3104 [inline] fat_alloc_inode+0x20/0xb0 fs/fat/inode.c:750 alloc_inode fs/inode.c:260 [inline] new_inode_pseudo+0x56/0x180 fs/inode.c:1019 new_inode+0x1a/0x1b0 fs/inode.c:1047 fat_build_inode+0xf3/0x300 fs/fat/inode.c:603 vfat_create+0x218/0x340 fs/fat/namei_vfat.c:776 lookup_open fs/namei.c:3413 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0xf05/0x27e0 fs/namei.c:3688 do_filp_open+0x256/0x4a0 fs/namei.c:3718 do_sys_openat2+0xfc/0x410 fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_sys_openat fs/open.c:1343 [inline] __se_sys_openat fs/open.c:1338 [inline] __x64_sys_openat+0x209/0x250 fs/open.c:1338 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 4185: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x60 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1780 slab_free mm/slub.c:3534 [inline] kmem_cache_free+0x95/0x1d0 mm/slub.c:3551 rcu_do_batch kernel/rcu/tree.c:2245 [inline] rcu_core+0x981/0x1610 kernel/rcu/tree.c:2505 __do_softirq+0x362/0x773 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x2b/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 call_rcu+0x163/0x970 kernel/rcu/tree.c:2793 __dentry_kill+0x334/0x4e0 fs/dcache.c:607 dentry_kill+0xbb/0x1e0 dput+0x16c/0x300 fs/dcache.c:913 __fput+0x421/0x650 fs/file_table.c:333 task_work_run+0xd6/0x160 kernel/task_work.c:177 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x124/0x150 kernel/entry/common.c:169 exit_to_user_mode_prepare+0xb2/0x140 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:294 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888071c812f0 which belongs to the cache fat_inode_cache of size 1488 The buggy address is located 696 bytes inside of 1488-byte region [ffff888071c812f0, ffff888071c818c0) The buggy address belongs to the physical page: page:ffffea0001c72000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x71c80 head:ffffea0001c72000 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff888020a89e01 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888018a52500 raw: 0000000000000000 0000000080140014 00000001ffffffff ffff888020a89e01 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 4169, tgid 4168 (syz-executor.0), ts 92561040437, free_ts 74789813625 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5515 alloc_slab_page+0x70/0xf0 mm/slub.c:1824 allocate_slab+0x5e/0x520 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x3ee/0xc40 mm/slub.c:3031 __slab_alloc mm/slub.c:3118 [inline] slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc_lru+0x225/0x2d0 mm/slub.c:3275 alloc_inode_sb include/linux/fs.h:3104 [inline] fat_alloc_inode+0x20/0xb0 fs/fat/inode.c:750 alloc_inode fs/inode.c:260 [inline] new_inode_pseudo+0x56/0x180 fs/inode.c:1019 new_inode+0x1a/0x1b0 fs/inode.c:1047 fat_fill_super+0x2d1f/0x44e0 fs/fat/inode.c:1847 mount_bdev+0x27a/0x370 fs/super.c:1400 legacy_get_tree+0xe4/0x170 fs/fs_context.c:610 vfs_get_tree+0x7b/0x220 fs/super.c:1530 do_new_mount+0x1df/0x930 fs/namespace.c:3040 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount+0x20f/0x2a0 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x7d/0x5f0 mm/page_alloc.c:3476 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] kmem_cache_alloc_trace+0x1de/0x310 mm/slub.c:3282 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] regulatory_hint_core net/wireless/reg.c:3238 [inline] restore_regulatory_settings+0xb6e/0x1820 net/wireless/reg.c:3572 crda_timeout_work+0x19/0x40 net/wireless/reg.c:540 process_one_work+0x7b9/0xc60 kernel/workqueue.c:2289 worker_thread+0x8ff/0xfe0 kernel/workqueue.c:2436 kthread+0x228/0x2a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 Memory state around the buggy address: ffff888071c81480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888071c81500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888071c81580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888071c81600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888071c81680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================