ci2 starts bisection 2022-11-10 03:13:07.90086431 +0000 UTC m=+4932.037244185 bisecting fixing commit since 493ffd6605b2d3d4dc7008ab927dba319f36671f building syzkaller on 5bcf0c31a14edd29532df8af88f246446873fe93 ensuring issue is reproducible on original commit 493ffd6605b2d3d4dc7008ab927dba319f36671f testing commit 493ffd6605b2d3d4dc7008ab927dba319f36671f gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c14be4a1341d05eca93f74c811420a35c397eefb37d08c78e1accf49483028d5 all runs: crashed: KASAN: use-after-free Read in move_expired_inodes testing current HEAD f67dd6ce0723ad013395f20a3f79d8a437d3f455 testing commit f67dd6ce0723ad013395f20a3f79d8a437d3f455 gcc compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 9ccda9e8ba8fe025ee1dfb85a216af3251d83cad5ddc8ad96fe07c68ba2abdae all runs: crashed: KASAN: use-after-free Read in move_expired_inodes revisions tested: 2, total time: 40m45.842188673s (build: 33m52.567951702s, test: 6m22.995967044s) the crash still happens on HEAD commit msg: Merge tag 'slab-for-6.1-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab crash: KASAN: use-after-free Read in move_expired_inodes ================================================================== 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 ffff8880727f15a8 by task kworker/u4:3/267 CPU: 0 PID: 267 Comm: kworker/u4:3 Not tainted 6.1.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/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+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x1f0 mm/kasan/report.c:395 kasan_report+0xcd/0x100 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 arch/x86/entry/entry_64.S:306 Allocated by task 4148: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x3d/0x60 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc_lru+0x180/0x2e0 mm/slub.c:3429 alloc_inode_sb include/linux/fs.h:3117 [inline] fat_alloc_inode+0x20/0xb0 fs/fat/inode.c:750 alloc_inode fs/inode.c:259 [inline] new_inode_pseudo+0x56/0x180 fs/inode.c:1018 new_inode+0x1a/0x1b0 fs/inode.c:1046 fat_build_inode+0xf3/0x300 fs/fat/inode.c:603 vfat_create+0x1d5/0x2a0 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:3710 do_filp_open+0x256/0x4a0 fs/namei.c:3740 do_sys_openat2+0xfc/0x410 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_openat fs/open.c:1342 [inline] __se_sys_openat fs/open.c:1337 [inline] __x64_sys_openat+0x209/0x250 fs/open.c:1337 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 4165: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x3d/0x60 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:511 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1750 slab_free mm/slub.c:3661 [inline] kmem_cache_free+0x94/0x1d0 mm/slub.c:3683 rcu_do_batch kernel/rcu/tree.c:2250 [inline] rcu_core+0x9c1/0x1690 kernel/rcu/tree.c:2510 __do_softirq+0x277/0x738 kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x2b/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:481 call_rcu+0x163/0x9c0 kernel/rcu/tree.c:2798 __dentry_kill+0x334/0x4e0 fs/dcache.c:607 dentry_kill+0xbb/0x1e0 dput+0x16c/0x300 fs/dcache.c:913 __fput+0x4cd/0x710 fs/file_table.c:328 task_work_run+0x227/0x2b0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x124/0x150 kernel/entry/common.c:171 exit_to_user_mode_prepare+0xb2/0x140 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x26/0x60 kernel/entry/common.c:296 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 ffff8880727f12f0 which belongs to the cache fat_inode_cache of size 1488 The buggy address is located 696 bytes inside of 1488-byte region [ffff8880727f12f0, ffff8880727f18c0) The buggy address belongs to the physical page: page:ffffea0001c9fc00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x727f0 head:ffffea0001c9fc00 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff888016e6c601 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff88814691a640 raw: 0000000000000000 0000000080140014 00000001ffffffff ffff888016e6c601 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 4148, tgid 4147 (syz-executor.0), ts 82012685650, free_ts 9788879675 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4288 __alloc_pages+0x259/0x560 mm/page_alloc.c:5555 alloc_slab_page+0x70/0xf0 mm/slub.c:1794 allocate_slab+0x5e/0x4b0 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0x782/0xe20 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc_lru+0x233/0x2e0 mm/slub.c:3429 alloc_inode_sb include/linux/fs.h:3117 [inline] fat_alloc_inode+0x20/0xb0 fs/fat/inode.c:750 alloc_inode fs/inode.c:259 [inline] new_inode_pseudo+0x56/0x180 fs/inode.c:1018 new_inode+0x1a/0x1b0 fs/inode.c:1046 fat_fill_super+0x2d1f/0x44e0 fs/fat/inode.c:1847 mount_bdev+0x27a/0x370 fs/super.c:1401 legacy_get_tree+0xe4/0x170 fs/fs_context.c:610 vfs_get_tree+0x7b/0x220 fs/super.c:1531 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:1459 [inline] free_pcp_prepare+0x80c/0x8f0 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x7d/0x5f0 mm/page_alloc.c:3483 free_contig_range+0xa3/0x160 mm/page_alloc.c:9493 destroy_args+0xde/0x74e mm/debug_vm_pgtable.c:1031 debug_vm_pgtable+0x409/0x457 mm/debug_vm_pgtable.c:1354 do_one_initcall+0x170/0x380 init/main.c:1303 do_initcall_level+0x136/0x1bf init/main.c:1376 do_initcalls+0x46/0x76 init/main.c:1392 kernel_init_freeable+0x378/0x4ed init/main.c:1631 kernel_init+0x14/0x1a0 init/main.c:1519 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff8880727f1480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880727f1500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880727f1580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880727f1600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880727f1680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================