F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 INFO: task syz-executor.5:4592 blocked for more than 140 seconds. Not tainted 4.19.211-syzkaller #0 F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. audit: type=1804 audit(1677898776.400:682): pid=6485 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.5" name="/root/syzkaller-testdir3358969302/syzkaller.kuTk1z/22/bus" dev="sda1" ino=13907 res=1 syz-executor.5 D25008 4592 8168 0x00000004 Call Trace: F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 F2FS-fs (loop5): sanity_check_inode: inode (ino=8) has corrupted i_extra_isize: 36, max: 24 context_switch kernel/sched/core.c:2828 [inline] __schedule+0x887/0x2040 kernel/sched/core.c:3517 schedule+0x8d/0x1b0 kernel/sched/core.c:3561 schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:3619 __mutex_lock_common kernel/locking/mutex.c:1016 [inline] __mutex_lock+0x5f0/0x1190 kernel/locking/mutex.c:1078 f2fs_balance_fs+0x709/0xd80 fs/f2fs/segment.c:512 __write_data_page+0xab8/0x22d0 fs/f2fs/data.c:1975 f2fs_write_cache_pages+0x96e/0x13e0 fs/f2fs/data.c:2107 __f2fs_write_data_pages fs/f2fs/data.c:2217 [inline] f2fs_write_data_pages+0x498/0x1060 fs/f2fs/data.c:2244 syz-executor.2 (6498): drop_caches: 2 syz-executor.2 (6498): drop_caches: 2 do_writepages+0xe5/0x290 mm/page-writeback.c:2344 __filemap_fdatawrite_range+0x27d/0x350 mm/filemap.c:446 file_write_and_wait_range+0x93/0x100 mm/filemap.c:776 f2fs_do_sync_file+0x2eb/0x2550 fs/f2fs/file.c:228 f2fs_sync_file+0x136/0x190 fs/f2fs/file.c:334 vfs_fsync_range+0x13a/0x220 fs/sync.c:197 generic_write_sync include/linux/fs.h:2750 [inline] f2fs_file_write_iter+0x64b/0xbe0 fs/f2fs/file.c:3044 call_write_iter include/linux/fs.h:1821 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x51b/0x770 fs/read_write.c:487 vfs_write+0x1f3/0x540 fs/read_write.c:549 ksys_write+0x12b/0x2a0 fs/read_write.c:599 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f8fa94410f9 Code: Bad RIP value. RSP: 002b:00007f8fa79b3168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f8fa9560f80 RCX: 00007f8fa94410f9 RDX: 000000000208e24b RSI: 0000000020000040 RDI: 000000000000000a RBP: 00007f8fa949cae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc6e5b92bf R14: 00007f8fa79b3300 R15: 0000000000022000 Showing all locks held in the system: 1 lock held by khungtaskd/1565: #0: 000000009f1d575c (rcu_read_lock){....}, at: debug_show_all_locks+0x53/0x265 kernel/locking/lockdep.c:4441 1 lock held by in:imklog/7822: #0: 000000009da0341e (&f->f_pos_lock){+.+.}, at: __fdget_pos+0x26f/0x310 fs/file.c:767 4 locks held by kworker/u4:5/8679: #0: 00000000dae6216a ((wq_completion)"writeback"){+.+.}, at: process_one_work+0x767/0x1570 kernel/workqueue.c:2124 #1: 00000000169095f7 ((work_completion)(&(&wb->dwork)->work)){+.+.}, at: process_one_work+0x79c/0x1570 kernel/workqueue.c:2128 #2: 00000000434f1db3 (&type->s_umount_key#56){++++}, at: trylock_super+0x1d/0x100 fs/super.c:412 #3: 00000000858cd316 (&sbi->gc_mutex){+.+.}, at: f2fs_balance_fs+0x709/0xd80 fs/f2fs/segment.c:512 3 locks held by kworker/u4:9/11178: 1 lock held by syz-executor.2/25445: #0: 000000005c18e275 (rcu_preempt_state.exp_mutex){+.+.}, at: exp_funnel_lock kernel/rcu/tree_exp.h:297 [inline] #0: 000000005c18e275 (rcu_preempt_state.exp_mutex){+.+.}, at: _synchronize_rcu_expedited+0x4dc/0x6f0 kernel/rcu/tree_exp.h:667 4 locks held by syz-executor.5/4592: #0: 00000000a1362223 (&f->f_pos_lock){+.+.}, at: __fdget_pos+0x26f/0x310 fs/file.c:767 #1: 00000000742b972d (sb_writers#19){.+.+}, at: file_start_write include/linux/fs.h:2779 [inline] #1: 00000000742b972d (sb_writers#19){.+.+}, at: vfs_write+0x463/0x540 fs/read_write.c:548 #2: 000000008c20b483 (&sbi->writepages){+.+.}, at: __f2fs_write_data_pages fs/f2fs/data.c:2212 [inline] #2: 000000008c20b483 (&sbi->writepages){+.+.}, at: f2fs_write_data_pages+0x478/0x1060 fs/f2fs/data.c:2244 #3: 00000000858cd316 (&sbi->gc_mutex){+.+.}, at: f2fs_balance_fs+0x709/0xd80 fs/f2fs/segment.c:512 3 locks held by syz-executor.5/4628: ============================================= NMI backtrace for cpu 1 CPU: 1 PID: 1565 Comm: khungtaskd Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 nmi_cpu_backtrace.cold+0x63/0xa2 lib/nmi_backtrace.c:101 nmi_trigger_cpumask_backtrace+0x1a6/0x1f0 lib/nmi_backtrace.c:62 trigger_all_cpu_backtrace include/linux/nmi.h:146 [inline] check_hung_uninterruptible_tasks kernel/hung_task.c:203 [inline] watchdog+0x991/0xe60 kernel/hung_task.c:287 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Sending NMI from CPU 1 to CPUs 0: NMI backtrace for cpu 0 CPU: 0 PID: 4628 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023 RIP: 0010:gc_data_segment fs/f2fs/gc.c:917 [inline] RIP: 0010:do_garbage_collect fs/f2fs/gc.c:1109 [inline] RIP: 0010:f2fs_gc+0x240d/0x8c90 fs/f2fs/gc.c:1196 Code: 0f 85 66 4c 00 00 41 8b 9f 5c 0d 00 00 44 8b 34 24 89 df 44 89 f6 e8 42 76 4b fe 44 39 f3 0f 86 c7 0c 00 00 48 83 44 24 08 07 <83> 04 24 01 e9 d3 f4 ff ff e8 35 75 4b fe 48 8b 44 24 10 80 38 00 RSP: 0018:ffff88809996f4f8 EFLAGS: 00000286 RAX: 0000000000000002 RBX: 0000000000000200 RCX: ffffffff8317101e RDX: 00000000000000fb RSI: ffff8880aa46a5c0 RDI: 0000000000000004 RBP: dffffc0000000000 R08: ffff88809bc72cc8 R09: 0000000000000200 R10: 0000000000000004 R11: 0000000000000000 R12: 000000000000001f R13: 0000000000000020 R14: 00000000000000fb R15: ffff8880923a18c0 FS: 00007f8fa3592700(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020010601 CR3: 00000000480c7000 CR4: 00000000003406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 Call Trace: f2fs_balance_fs+0x71a/0xd80 fs/f2fs/segment.c:513 f2fs_setattr+0x5b6/0x12b0 fs/f2fs/file.c:852 notify_change+0x70b/0xfc0 fs/attr.c:334 do_truncate+0x134/0x1f0 fs/open.c:63 handle_truncate fs/namei.c:3009 [inline] do_last fs/namei.c:3427 [inline] path_openat+0x2308/0x2df0 fs/namei.c:3537 do_filp_open+0x18c/0x3f0 fs/namei.c:3567 do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f8fa94410f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f8fa3592168 EFLAGS: 00000246 ORIG_RAX: 0000000000000055 RAX: ffffffffffffffda RBX: 00007f8fa9561050 RCX: 00007f8fa94410f9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000040 RBP: 00007f8fa949cae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc6e5b92bf R14: 00007f8fa3592300 R15: 0000000000022000