do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 ================================================================== BUG: KASAN: use-after-free in f2fs_truncate_data_blocks_range+0x81f/0xf90 fs/f2fs/file.c:562 Read of size 4 at addr ffff8881ddc71000 by task syz-executor.2/5281 CPU: 0 PID: 5281 Comm: syz-executor.2 Not tainted 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 f2fs_truncate_data_blocks_range+0x81f/0xf90 fs/f2fs/file.c:562 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Allocated by task 5271: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 __kmalloc_node include/linux/slab.h:422 [inline] kmalloc_node include/linux/slab.h:599 [inline] kvmalloc_node+0x7e/0xf0 mm/util.c:596 kvmalloc include/linux/mm.h:759 [inline] f2fs_kvmalloc fs/f2fs/f2fs.h:3201 [inline] f2fs_kvzalloc fs/f2fs/f2fs.h:3207 [inline] init_free_nid_cache fs/f2fs/node.c:3187 [inline] f2fs_build_node_manager+0x8fd/0x1d80 fs/f2fs/node.c:3220 f2fs_fill_super+0x5c7f/0x8310 fs/f2fs/super.c:4051 mount_bdev+0x22e/0x340 fs/super.c:1417 legacy_get_tree+0xdf/0x170 fs/fs_context.c:647 vfs_get_tree+0x85/0x260 fs/super.c:1547 do_new_mount+0x292/0x570 fs/namespace.c:2843 do_mount+0x688/0xe10 fs/namespace.c:3163 ksys_mount+0xc2/0xf0 fs/namespace.c:3372 __do_sys_mount fs/namespace.c:3386 [inline] __se_sys_mount fs/namespace.c:3383 [inline] __x64_sys_mount+0xb1/0xc0 fs/namespace.c:3383 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 559: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1b5/0x270 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kfree+0x123/0x370 mm/slub.c:4071 f2fs_destroy_node_manager+0xd12/0xff0 fs/f2fs/node.c:3293 f2fs_put_super+0x7a8/0xcd0 fs/f2fs/super.c:1495 generic_shutdown_super+0x120/0x2a0 fs/super.c:464 kill_block_super+0x7a/0xe0 fs/super.c:1444 kill_f2fs_super+0x2f9/0x3c0 fs/f2fs/super.c:4355 deactivate_locked_super+0xa8/0x110 fs/super.c:335 deactivate_super+0x1e2/0x2a0 fs/super.c:366 cleanup_mnt+0x44e/0x500 fs/namespace.c:1102 task_work_run+0x140/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x190/0x1a0 arch/x86/entry/common.c:163 prepare_exit_to_usermode+0x199/0x200 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 The buggy address belongs to the object at ffff8881ddc71000 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff8881ddc71000, ffff8881ddc71040) The buggy address belongs to the page: page:ffffea0007771c40 refcount:1 mapcount:0 mapping:ffff8881f5c03180 index:0x0 flags: 0x8000000000000200(slab) raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881f5c03180 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4891 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc+0x19b/0x2e0 mm/slub.c:3909 __kmalloc_node include/linux/slab.h:422 [inline] kmalloc_node include/linux/slab.h:599 [inline] kvmalloc_node+0x7e/0xf0 mm/util.c:596 kvmalloc include/linux/mm.h:759 [inline] f2fs_kvmalloc fs/f2fs/f2fs.h:3201 [inline] f2fs_kvzalloc fs/f2fs/f2fs.h:3207 [inline] init_free_nid_cache fs/f2fs/node.c:3187 [inline] f2fs_build_node_manager+0x8fd/0x1d80 fs/f2fs/node.c:3220 f2fs_fill_super+0x5c7f/0x8310 fs/f2fs/super.c:4051 mount_bdev+0x22e/0x340 fs/super.c:1417 legacy_get_tree+0xdf/0x170 fs/fs_context.c:647 vfs_get_tree+0x85/0x260 fs/super.c:1547 do_new_mount+0x292/0x570 fs/namespace.c:2843 do_mount+0x688/0xe10 fs/namespace.c:3163 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x297/0x380 mm/page_alloc.c:3085 free_unref_page_list+0x10a/0x590 mm/page_alloc.c:3154 release_pages+0xad8/0xb20 mm/swap.c:842 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:189 [inline] tlb_flush_mmu mm/mmu_gather.c:196 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:277 unmap_region+0x31c/0x370 mm/mmap.c:2641 __do_munmap+0x649/0x850 mm/mmap.c:2870 __vm_munmap mm/mmap.c:2893 [inline] __do_sys_munmap mm/mmap.c:2919 [inline] __se_sys_munmap+0x11d/0x1a0 mm/mmap.c:2915 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881ddc70f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881ddc70f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881ddc71000: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8881ddc71080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881ddc71100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== F2FS-fs (loop2): access invalid blkaddr:3720814080 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:4294936705 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:127 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:2147484000 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:559 CPU: 1 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:3026190689 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:3720814208 CPU: 1 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:4294936705 CPU: 1 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:127 CPU: 1 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): Inconsistent error blkaddr:5271, sit bitmap:0 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 __is_bitmap_valid fs/f2fs/checkpoint.c:164 [inline] f2fs_is_valid_blkaddr+0xc2d/0x1380 fs/f2fs/checkpoint.c:206 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:2147484000 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:559 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:3026190689 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:3720812672 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:4294936705 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:127 CPU: 0 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): Inconsistent error blkaddr:5271, sit bitmap:0 CPU: 1 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 __is_bitmap_valid fs/f2fs/checkpoint.c:164 [inline] f2fs_is_valid_blkaddr+0xc2d/0x1380 fs/f2fs/checkpoint.c:206 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:2147484000 CPU: 1 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:559 CPU: 1 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): access invalid blkaddr:3026190689 CPU: 1 PID: 5281 Comm: syz-executor.2 Tainted: G B 5.4.233-syzkaller-00003-gf423d52eea72 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 f2fs_is_valid_blkaddr+0xc79/0x1380 fs/f2fs/checkpoint.c:203 f2fs_truncate_data_blocks_range+0x66f/0xf90 fs/f2fs/file.c:580 truncate_dnode fs/f2fs/node.c:907 [inline] f2fs_truncate_inode_blocks+0x779/0x1390 fs/f2fs/node.c:1117 f2fs_do_truncate_blocks+0x614/0xac0 fs/f2fs/file.c:708 f2fs_truncate_blocks fs/f2fs/file.c:736 [inline] f2fs_truncate+0x275/0x540 fs/f2fs/file.c:780 f2fs_setattr+0x9a4/0x1040 fs/f2fs/file.c:944 notify_change+0xbaf/0xe40 fs/attr.c:338 do_truncate+0x1ed/0x2d0 fs/open.c:64 handle_truncate fs/namei.c:3083 [inline] do_last fs/namei.c:3501 [inline] path_openat+0x2de2/0x3480 fs/namei.c:3614 do_filp_open+0x20b/0x450 fs/namei.c:3644 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 F2FS-fs (loop2): Inconsistent i_blocks, ino:8, iblocks:0, sectors:296 F2FS-fs (loop2): dec_valid_node_count: inconsistent i_blocks, ino:8, iblocks:0