INFO: task kworker/u10:1:36 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u10:1   state:D stack:20792 pid:36    tgid:36    ppid:2      task_flags:0x4248060 flags:0x00004000
Workqueue: writeback wb_workfn (flush-bcachefs-94)
Call Trace:
 <TASK>
 __schedule+0x1798/0x4cc0
 schedule+0x165/0x360
 schedule_timeout+0x12b/0x270
 __closure_sync_timeout+0x282/0x3a0
 __bch2_wait_on_allocator+0x112/0x240
 __bch2_write+0x31ef/0x3900
 __bch2_writepage+0x1536/0x2790
 write_cache_pages+0x64/0x100
 bch2_writepages+0xf9/0x2d0
 do_writepages+0x32e/0x550
 __writeback_single_inode+0x145/0xff0
 writeback_sb_inodes+0x6c7/0x1010
 __writeback_inodes_wb+0x111/0x240
 wb_writeback+0x44f/0xaf0
 wb_workfn+0xaef/0xef0
 process_scheduled_works+0xae1/0x17b0
 worker_thread+0x8a0/0xda0
 kthread+0x711/0x8a0
 ret_from_fork+0x439/0x7d0
 ret_from_fork_asm+0x1a/0x30
 </TASK>
INFO: task syz.6.1116:14719 blocked for more than 143 seconds.
      Not tainted syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.6.1116      state:D stack:17448 pid:14719 tgid:14718 ppid:13759  task_flags:0x440140 flags:0x00004006
Call Trace:
 <TASK>
 __schedule+0x1798/0x4cc0
 schedule+0x165/0x360
 schedule_timeout+0x12b/0x270
 __closure_sync_timeout+0x282/0x3a0
 __bch2_wait_on_allocator+0x112/0x240
 __bch2_write+0x31ef/0x3900
 __bch2_writepage+0x1536/0x2790
 write_cache_pages+0x64/0x100
 bch2_writepages+0xf9/0x2d0
 do_writepages+0x32e/0x550
 file_write_and_wait_range+0x23e/0x340
 bch2_fsync+0x127/0x330
 bch2_write_iter+0x2822/0x2b90
 vfs_write+0x5c9/0xb30
 ksys_write+0x145/0x250
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f2d8038eba9
RSP: 002b:00007f2d8118d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f2d805d5fa0 RCX: 00007f2d8038eba9
RDX: 00000000ffffffb2 RSI: 0000200000000240 RDI: 0000000000000006
RBP: 00007f2d80411e19 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f2d805d6038 R14: 00007f2d805d5fa0 R15: 00007ffe377e34d8
 </TASK>

Showing all locks held in the system:
3 locks held by kworker/1:0/24:
 #0: ffff88801a480d48 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900001c7bc0 ((work_completion)(&data->fib_event_work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff88811ab75240 (&data->fib_lock){+.+.}-{4:4}, at: nsim_fib_event_work+0x26b/0x3180
1 lock held by khungtaskd/34:
 #0: ffffffff8e13a0e0 (rcu_read_lock){....}-{1:3}, at: debug_show_all_locks+0x2e/0x180
3 locks held by kworker/u10:1/36:
 #0: ffff88801afc7148 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc900006afbc0 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffff88802b5660e0 (&type->s_umount_key#52){++++}-{4:4}, at: super_trylock_shared+0x20/0xf0
2 locks held by getty/5679:
 #0: ffff8881076660a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70
 #1: ffffc900029062f0 (&ldata->atomic_read_lock){+.+.}-{4:4}, at: n_tty_read+0x43e/0x1400
3 locks held by kworker/1:5/7290:
 #0: ffff88801a480d48 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x9b4/0x17b0
 #1: ffffc90002f8fbc0 (key_gc_work){+.+.}-{0:0}, at: process_scheduled_works+0x9ef/0x17b0
 #2: ffffffff8e13fb78 (rcu_state.exp_mutex){+.+.}-{4:4}, at: synchronize_rcu_expedited+0x3b9/0x730
2 locks held by kworker/u8:5/7349:
 #0: ffff888136639f98 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140
 #1: ffff888136624008 (psi_seq){-.-.}-{0:0}, at: psi_task_switch+0x53/0x880
2 locks held by syz.6.1116/14719:
 #0: ffff88801f00c8f8 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x247/0x320
 #1: ffff88802b566428 (sb_writers#37){.+.+}-{0:0}, at: vfs_write+0x211/0xb30
2 locks held by syz-executor/16654:
2 locks held by syz-executor/16834:
1 lock held by syz-executor/19281:
 #0: ffffffff8e13fb78 (rcu_state.exp_mutex){+.+.}-{4:4}, at: synchronize_rcu_expedited+0x3b9/0x730
1 lock held by syz.6.1743/19492:
 #0: ffff88811c07f178 (&ima_iint_mutex_key[depth]){+.+.}-{4:4}, at: ima_file_free+0x16c/0x460
1 lock held by syz.6.1743/19493:
1 lock held by dhcpcd-run-hook/19573:

=============================================

NMI backtrace for cpu 0
CPU: 0 UID: 0 PID: 34 Comm: khungtaskd Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250
 nmi_cpu_backtrace+0x39e/0x3d0
 nmi_trigger_cpumask_backtrace+0x17a/0x300
 watchdog+0xf93/0xfe0
 kthread+0x711/0x8a0
 ret_from_fork+0x439/0x7d0
 ret_from_fork_asm+0x1a/0x30
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 UID: 0 PID: 19493 Comm: syz.6.1743 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:sha256_blocks_generic+0x7e3/0x1b70
Code: 31 c6 44 8b 84 9c 74 01 00 00 45 89 c2 41 c1 c2 19 45 89 c3 41 c1 c3 0e 45 31 d3 45 89 c2 41 c1 ea 03 44 03 8c 9c 94 01 00 00 <45> 31 da 45 01 d1 41 01 f1 44 89 8c 9c b0 01 00 00 89 fe c1 c6 0f
RSP: 0018:ffffc90002e0ef20 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 0000000000000030 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90002e0f258 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffc90002e0f3b0
R13: ffff888115b046bc R14: 0000000000000000 R15: ffffc90002e0f3a8
FS:  00007fd65a4c56c0(0000) GS:ffff8881a3c15000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffc7b5b4f48 CR3: 000000002198c000 CR4: 00000000000006f0
Call Trace:
 <TASK>
 __sha256_update+0xf7/0x150
 crypto_sha256_update+0x27/0x40
 ima_calc_file_hash+0x8a0/0x16f0
 ima_collect_measurement+0x428/0x8e0
 process_measurement+0x1121/0x1a40
 ima_file_mmap+0x1a2/0x1f0
 security_mmap_file+0x7a4/0xa60
 vm_mmap_pgoff+0x129/0x4d0
 ksys_mmap_pgoff+0x51f/0x760
 do_syscall_64+0xfa/0x3b0
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd65958eba9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fd65a4c5038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007fd6597d5fa0 RCX: 00007fd65958eba9
RDX: 00000000027ffff7 RSI: 0000000000600000 RDI: 0000200000000000
RBP: 00007fd659611e19 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000004012011 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd6597d6038 R14: 00007fd6597d5fa0 R15: 00007ffc7874ea28
 </TASK>
