syzbot


INFO: task hung in bch2_fsync

Status: auto-obsoleted due to no activity on 2024/10/16 23:00
Subsystems: fs mm
[Documentation on labels]
First crash: 232d, last: 194d

Sample crash report:
INFO: task syz.2.81:5679 blocked for more than 143 seconds.
      Not tainted 6.10.0-syzkaller-05505-gb1bc554e009e #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.2.81        state:D stack:17328 pid:5679  tgid:5635  ppid:5091   flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5188 [inline]
 __schedule+0x17ae/0x4a10 kernel/sched/core.c:6529
 __schedule_loop kernel/sched/core.c:6606 [inline]
 schedule+0x14b/0x320 kernel/sched/core.c:6621
 io_schedule+0x8d/0x110 kernel/sched/core.c:7401
 folio_wait_bit_common+0x882/0x12b0 mm/filemap.c:1307
 folio_wait_writeback+0xe7/0x1e0 mm/page-writeback.c:3162
 __filemap_fdatawait_range+0x181/0x410 mm/filemap.c:532
 file_write_and_wait_range+0x1fa/0x290 mm/filemap.c:792
 bch2_fsync+0x93/0x130 fs/bcachefs/fs-io.c:197
 generic_write_sync include/linux/fs.h:2816 [inline]
 bch2_buffered_write fs/bcachefs/fs-io-buffered.c:1128 [inline]
 bch2_write_iter+0x262e/0x2840 fs/bcachefs/fs-io-buffered.c:1136
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xa72/0xc90 fs/read_write.c:590
 ksys_write+0x1a0/0x2c0 fs/read_write.c:643
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7d78f75b59
RSP: 002b:00007f7d789de048 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f7d79104110 RCX: 00007f7d78f75b59
RDX: 0000000000000011 RSI: 00000000200002c0 RDI: 0000000000000004
RBP: 00007f7d78fe4e5d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007f7d79104110 R15: 00007fff9e224288
 </TASK>

Showing all locks held in the system:
1 lock held by pool_workqueue_/3:
 #0: ffffffff8e33b3b8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:328 [inline]
 #0: ffffffff8e33b3b8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x451/0x830 kernel/rcu/tree_exp.h:958
1 lock held by khungtaskd/31:
 #0: ffffffff8e335fe0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:327 [inline]
 #0: ffffffff8e335fe0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:839 [inline]
 #0: ffffffff8e335fe0 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x2a0 kernel/locking/lockdep.c:6613
11 locks held by kworker/u8:4/62:
 #0: ffff88801aece948 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3206 [inline]
 #0: ffff88801aece948 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3312
 #1: ffffc900015d7d00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3207 [inline]
 #1: ffffc900015d7d00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3312
 #2: ffff888079c080e0 (&type->s_umount_key#66){++++}-{3:3}, at: super_trylock_shared+0x22/0xf0 fs/super.c:562
 #3: ffff88806a1042d8 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_lock_acquire include/linux/srcu.h:151 [inline]
 #3: ffff88806a1042d8 (&c->btree_trans_barrier){.+.+}-{0:0}, at: srcu_read_lock include/linux/srcu.h:250 [inline]
 #3: ffff88806a1042d8 (&c->btree_trans_barrier){.+.+}-{0:0}, at: __bch2_trans_get+0x7f8/0xe40 fs/bcachefs/btree_iter.c:3193
 #4: ffff88806a11ec78 (&wp->lock){+.+.}-{3:3}, at: bch2_trans_mutex_lock_norelock fs/bcachefs/alloc_foreground.c:43 [inline]
 #4: ffff88806a11ec78 (&wp->lock){+.+.}-{3:3}, at: writepoint_find fs/bcachefs/alloc_foreground.c:1311 [inline]
 #4: ffff88806a11ec78 (&wp->lock){+.+.}-{3:3}, at: bch2_alloc_sectors_start_trans+0x8cd/0x1f60 fs/bcachefs/alloc_foreground.c:1410
 #5: ffff8880b943e818 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:560
 #6: ffff8880b9428948 (&per_cpu_ptr(group->pcpu, cpu)->seq){-.-.}-{0:0}, at: psi_task_switch+0x441/0x770 kernel/sched/psi.c:989
 #7: ffff8880b942a718 (&base->lock){-.-.}-{2:2}, at: lock_timer_base+0x112/0x240 kernel/time/timer.c:1051
 #8: ffff88805d800478 (&dev->mutex){....}-{3:3}, at: bch2_btree_path_traverse_cached+0x48d/0xd50
 #9: ffff888060227870 (&dev->mutex){....}-{3:3}, at: six_trylock_type fs/bcachefs/six.h:207 [inline]
 #9: ffff888060227870 (&dev->mutex){....}-{3:3}, at: btree_node_lock fs/bcachefs/btree_locking.h:288 [inline]
 #9: ffff888060227870 (&dev->mutex){....}-{3:3}, at: btree_path_lock_root fs/bcachefs/btree_iter.c:757 [inline]
 #9: ffff888060227870 (&dev->mutex){....}-{3:3}, at: bch2_btree_path_traverse_one+0xa44/0x2930 fs/bcachefs/btree_iter.c:1177
 #10: ffff888060227870 (&dev->mutex){....}-{3:3}, at: six_trylock_type fs/bcachefs/six.h:207 [inline]
 #10: ffff888060227870 (&dev->mutex){....}-{3:3}, at: btree_node_lock fs/bcachefs/btree_locking.h:288 [inline]
 #10: ffff888060227870 (&dev->mutex){....}-{3:3}, at: btree_path_lock_root fs/bcachefs/btree_iter.c:757 [inline]
 #10: ffff888060227870 (&dev->mutex){....}-{3:3}, at: bch2_btree_path_traverse_one+0xa44/0x2930 fs/bcachefs/btree_iter.c:1177
4 locks held by kworker/u8:8/2449:
 #0: ffff888015edb148 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3206 [inline]
 #0: ffff888015edb148 ((wq_completion)netns){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3312
 #1: ffffc90009047d00 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3207 [inline]
 #1: ffffc90009047d00 (net_cleanup_work){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3312
 #2: ffffffff8f5d6210 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0x16a/0xcc0 net/core/net_namespace.c:594
 #3: ffffffff8f5e2d88 (rtnl_mutex){+.+.}-{3:3}, at: ieee80211_unregister_hw+0x55/0x2c0 net/mac80211/main.c:1662
2 locks held by getty/4843:
 #0: ffff88802ac3b0a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc900031332f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6b5/0x1e10 drivers/tty/n_tty.c:2211
3 locks held by kworker/0:3/5099:
 #0: ffff888015080948 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3206 [inline]
 #0: ffff888015080948 ((wq_completion)events){+.+.}-{0:0}, at: process_scheduled_works+0x90a/0x1830 kernel/workqueue.c:3312
 #1: ffffc900043b7d00 ((linkwatch_work).work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3207 [inline]
 #1: ffffc900043b7d00 ((linkwatch_work).work){+.+.}-{0:0}, at: process_scheduled_works+0x945/0x1830 kernel/workqueue.c:3312
 #2: ffffffff8f5e2d88 (rtnl_mutex){+.+.}-{3:3}, at: linkwatch_event+0xe/0x60 net/core/link_watch.c:276
9 locks held by syz.2.81/5636:
9 locks held by syz.2.81/5678:
2 locks held by syz.2.81/5679:
 #0: ffff88807bca3c48 (&f->f_pos_lock){+.+.}-{3:3}, at: __fdget_pos+0x24e/0x310 fs/file.c:1191
 #1: ffff888079c08420 (sb_writers#19){.+.+}-{0:0}, at: file_start_write include/linux/fs.h:2876 [inline]
 #1: ffff888079c08420 (sb_writers#19){.+.+}-{0:0}, at: vfs_write+0x227/0xc90 fs/read_write.c:586
1 lock held by syz-executor/7310:
 #0: ffffffff8f5e2d88 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:79 [inline]
 #0: ffffffff8f5e2d88 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x6e6/0xcf0 net/core/rtnetlink.c:6644
1 lock held by syz-executor/7330:
 #0: ffffffff8f5e2d88 (rtnl_mutex){+.+.}-{3:3}, at: __tun_chr_ioctl+0x48f/0x2400 drivers/net/tun.c:3117
1 lock held by syz.1.270/7334:
 #0: ffffffff8e33b3b8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:328 [inline]
 #0: ffffffff8e33b3b8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x451/0x830 kernel/rcu/tree_exp.h:958

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

NMI backtrace for cpu 0
CPU: 0 PID: 31 Comm: khungtaskd Not tainted 6.10.0-syzkaller-05505-gb1bc554e009e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 nmi_cpu_backtrace+0x49c/0x4d0 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x198/0x320 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:162 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:223 [inline]
 watchdog+0xfde/0x1020 kernel/hung_task.c:379
 kthread+0x2f0/0x390 kernel/kthread.c:389
 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 1 Comm: init Not tainted 6.10.0-syzkaller-05505-gb1bc554e009e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
RIP: 0010:debug_lockdep_rcu_enabled+0xd/0x40 kernel/rcu/update.c:320
Code: f5 90 0f 0b 90 90 90 eb c6 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 31 c0 83 3d df c0 28 04 00 <74> 1e 83 3d 16 f2 28 04 00 74 15 65 48 8b 0c 25 40 d5 03 00 31 c0
RSP: 0018:ffffc900000676b8 EFLAGS: 00000202
RAX: 0000000000000000 RBX: 00007f96bd1323da RCX: 0000000000000001
RDX: dffffc0000000000 RSI: ffffffff8bcadaa0 RDI: ffffffff8c1f86e0
RBP: 0000000000000001 R08: ffffffff92fa25c7 R09: 1ffffffff25f44b8
R10: dffffc0000000000 R11: fffffbfff25f44b9 R12: ffff8880162e0000
R13: ffffffff818201e0 R14: 0000000000000001 R15: 00007f96bd1323da
FS:  00007f96bcfda380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f81ef43f440 CR3: 000000002f5aa000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 rcu_read_lock include/linux/rcupdate.h:840 [inline]
 is_bpf_text_address+0x4f/0x2a0 kernel/bpf/core.c:767
 kernel_text_address+0xa7/0xe0 kernel/extable.c:125
 __kernel_text_address+0xd/0x40 kernel/extable.c:79
 unwind_get_return_address+0x5d/0xc0 arch/x86/kernel/unwind_orc.c:369
 arch_stack_walk+0x125/0x1b0 arch/x86/kernel/stacktrace.c:26
 stack_trace_save+0x118/0x1d0 kernel/stacktrace.c:122
 kasan_save_stack mm/kasan/common.c:47 [inline]
 kasan_save_track+0x3f/0x80 mm/kasan/common.c:68
 unpoison_slab_object mm/kasan/common.c:312 [inline]
 __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slub.c:3940 [inline]
 slab_alloc_node mm/slub.c:4002 [inline]
 kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4009
 locks_alloc_lock fs/locks.c:275 [inline]
 fcntl_setlk+0xab/0x10a0 fs/locks.c:2405
 do_fcntl+0x661/0x1730 fs/fcntl.c:398
 __do_sys_fcntl fs/fcntl.c:492 [inline]
 __se_sys_fcntl+0xd2/0x1c0 fs/fcntl.c:477
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f96bd1323da
Code: f0 ff ff 77 0e 83 7c 24 f8 02 8b 44 24 fc 75 32 f7 d8 c3 48 8b 15 3e 6a 0d 00 f7 d8 64 89 02 83 c8 ff c3 b8 48 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 10 48 8b 15 1f 6a 0d 00 f7 d8 64 89 02 48 83
RSP: 002b:00007fff8df493b0 EFLAGS: 00000293 ORIG_RAX: 0000000000000048
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f96bd1323da
RDX: 00007fff8df49410 RSI: 0000000000000007 RDI: 0000000000000003
RBP: 0000000000000000 R08: 00007fff8df49430 R09: 0000000000000000
R10: 0000000000000008 R11: 0000000000000293 R12: 0000000000000003
R13: 00007fff8df49430 R14: 0000000000000002 R15: 0000000000001c94
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/18 22:56 upstream b1bc554e009e 71884c12 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in bch2_fsync
2024/06/10 19:27 upstream 83a7eefedc9b 048c640a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in bch2_fsync
* Struck through repros no longer work on HEAD.