syzbot


INFO: task hung in f2fs_file_open

Status: upstream: reported on 2024/09/15 07:12
Reported-by: syzbot+47569fec8a52510c22cd@syzkaller.appspotmail.com
First crash: 5d19h, last: 5d19h
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: task hung in f2fs_file_open f2fs 56 4d09h 5d17h 0/28 upstream: reported on 2024/09/15 09:45

Sample crash report:
INFO: task syz.4.174:4544 blocked for more than 143 seconds.
      Not tainted 6.1.110-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.4.174       state:D stack:27184 pid:4544  ppid:3904   flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5241 [inline]
 __schedule+0x143f/0x4570 kernel/sched/core.c:6558
 schedule+0xbf/0x180 kernel/sched/core.c:6634
 rwsem_down_write_slowpath+0xea1/0x14b0 kernel/locking/rwsem.c:1189
 inode_lock include/linux/fs.h:758 [inline]
 finish_preallocate_blocks fs/f2fs/file.c:545 [inline]
 f2fs_file_open+0xd8/0x370 fs/f2fs/file.c:597
 do_dentry_open+0x7f9/0x10f0 fs/open.c:882
 do_open fs/namei.c:3628 [inline]
 path_openat+0x2644/0x2e60 fs/namei.c:3785
 do_filp_open+0x230/0x480 fs/namei.c:3812
 do_sys_openat2+0x13b/0x4f0 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1345
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fc78937def9
RSP: 002b:00007fc7891ff038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fc789536058 RCX: 00007fc78937def9
RDX: 0000000000020242 RSI: 0000000020000380 RDI: ffffffffffffff9c
RBP: 00007fc7893f0b76 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fc789536058 R15: 00007ffe98c6a3b8
 </TASK>
INFO: task syz.4.174:4545 blocked for more than 144 seconds.
      Not tainted 6.1.110-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz.4.174       state:D stack:26040 pid:4545  ppid:3904   flags:0x00004004
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5241 [inline]
 __schedule+0x143f/0x4570 kernel/sched/core.c:6558
 schedule+0xbf/0x180 kernel/sched/core.c:6634
 rwsem_down_write_slowpath+0xea1/0x14b0 kernel/locking/rwsem.c:1189
 f2fs_down_write fs/f2fs/f2fs.h:2177 [inline]
 f2fs_issue_checkpoint+0x2d2/0x4d0 fs/f2fs/checkpoint.c:1864
 f2fs_create+0x862/0xa10 fs/f2fs/namei.c:377
 lookup_open fs/namei.c:3484 [inline]
 open_last_lookups fs/namei.c:3552 [inline]
 path_openat+0x12f1/0x2e60 fs/namei.c:3782
 do_filp_open+0x230/0x480 fs/namei.c:3812
 do_sys_openat2+0x13b/0x4f0 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1345
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fc78937def9
RSP: 002b:00007fc7891de038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007fc789536130 RCX: 00007fc78937def9
RDX: 000000000000275a RSI: 0000000020000240 RDI: ffffffffffffff9c
RBP: 00007fc7893f0b76 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007fc789536130 R15: 00007ffe98c6a3b8
 </TASK>

Showing all locks held in the system:
1 lock held by rcu_tasks_kthre/12:
 #0: ffffffff8d32b1d0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xe30 kernel/rcu/tasks.h:517
1 lock held by rcu_tasks_trace/13:
 #0: ffffffff8d32b9d0 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x29/0xe30 kernel/rcu/tasks.h:517
3 locks held by kworker/0:1/14:
 #0: ffff88814b2d8d38 ((wq_completion)ipv6_addrconf){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc90000137d20 ((work_completion)(&(&ifa->dad_work)->work)){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffffffff8e4f96e8 (rtnl_mutex){+.+.}-{3:3}, at: addrconf_dad_work+0xcc/0x16b0 net/ipv6/addrconf.c:4115
1 lock held by khungtaskd/27:
 #0: ffffffff8d32b000 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
 #0: ffffffff8d32b000 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
 #0: ffffffff8d32b000 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x51/0x290 kernel/locking/lockdep.c:6494
1 lock held by dhcpcd/3306:
 #0: ffffffff8e4f96e8 (rtnl_mutex){+.+.}-{3:3}, at: __netlink_dump_start+0x12e/0x6c0 net/netlink/af_netlink.c:2301
2 locks held by getty/3403:
 #0: ffff88814b583098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:244
 #1: ffffc900031262f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6a7/0x1db0 drivers/tty/n_tty.c:2198
3 locks held by kworker/u4:9/3758:
 #0: ffff888017c79138 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc900048e7d20 ((linkwatch_work).work){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffffffff8e4f96e8 (rtnl_mutex){+.+.}-{3:3}, at: linkwatch_event+0xa/0x50 net/core/link_watch.c:263
4 locks held by kworker/u4:10/3760:
 #0: ffff88801c66d138 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc90003dffd20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffff888019eea0e0 (&type->s_umount_key#89){++++}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:415
 #3: ffff88805686d140 (&sbi->gc_lock){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2177 [inline]
 #3: ffff88805686d140 (&sbi->gc_lock){+.+.}-{3:3}, at: f2fs_balance_fs+0x4fb/0x6c0 fs/f2fs/segment.c:428
3 locks held by kworker/1:8/3784:
 #0: ffff88814b2d8d38 ((wq_completion)ipv6_addrconf){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc900047efd20 ((work_completion)(&(&ifa->dad_work)->work)){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffffffff8e4f96e8 (rtnl_mutex){+.+.}-{3:3}, at: addrconf_dad_work+0xcc/0x16b0 net/ipv6/addrconf.c:4115
3 locks held by kworker/u4:14/4484:
6 locks held by syz.4.174/4515:
2 locks held by syz.4.174/4544:
 #0: ffff888019eea460 (sb_writers#19){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393
 #1: ffff888053c18150 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #1: ffff888053c18150 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: finish_preallocate_blocks fs/f2fs/file.c:545 [inline]
 #1: ffff888053c18150 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: f2fs_file_open+0xd8/0x370 fs/f2fs/file.c:597
3 locks held by syz.4.174/4545:
 #0: ffff888019eea460 (sb_writers#19){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:393
 #1: ffff888072349310 (&type->i_mutex_dir_key#9){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #1: ffff888072349310 (&type->i_mutex_dir_key#9){+.+.}-{3:3}, at: open_last_lookups fs/namei.c:3549 [inline]
 #1: ffff888072349310 (&type->i_mutex_dir_key#9){+.+.}-{3:3}, at: path_openat+0x7b6/0x2e60 fs/namei.c:3782
 #2: ffff88805686d140 (&sbi->gc_lock){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2177 [inline]
 #2: ffff88805686d140 (&sbi->gc_lock){+.+.}-{3:3}, at: f2fs_issue_checkpoint+0x2d2/0x4d0 fs/f2fs/checkpoint.c:1864
2 locks held by kworker/0:11/4607:
 #0: ffff888017c72138 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc9000354fd20 ((work_completion)(&rew->rew_work)){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
2 locks held by syz.4.187/5005:
 #0: ffff888019eea0e0 (&type->s_umount_key#89){++++}-{3:3}, at: iterate_supers+0xac/0x1e0 fs/super.c:755
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:362 [inline]
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x270/0xb10 fs/fs-writeback.c:2737
2 locks held by syz.2.313/5327:
 #0: ffff888019eea0e0 (&type->s_umount_key#89){++++}-{3:3}, at: iterate_supers+0xac/0x1e0 fs/super.c:755
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:362 [inline]
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x270/0xb10 fs/fs-writeback.c:2737
2 locks held by syz.1.338/5479:
 #0: ffff888019eea0e0 (&type->s_umount_key#89){++++}-{3:3}, at: iterate_supers+0xac/0x1e0 fs/super.c:755
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:362 [inline]
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x270/0xb10 fs/fs-writeback.c:2737
5 locks held by kworker/u4:19/5481:
 #0: ffff888017e1e938 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #1: ffffc90004f37d20 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work+0x7a9/0x11d0 kernel/workqueue.c:2267
 #2: ffffffff8e4ed390 (pernet_ops_rwsem){++++}-{3:3}, at: cleanup_net+0xf1/0xb60 net/core/net_namespace.c:566
 #3: ffffffff8e4f96e8 (rtnl_mutex){+.+.}-{3:3}, at: ip_tunnel_delete_nets+0xc9/0x330 net/ipv4/ip_tunnel.c:1148
 #4: ffffffff8d3305f8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:291 [inline]
 #4: ffffffff8d3305f8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x4f0/0x930 kernel/rcu/tree_exp.h:962
4 locks held by syz-executor/5591:
 #0: ffff88807e37a460 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x269/0xbc0 fs/read_write.c:580
 #1: ffff88805a5f1c88 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1e7/0x4f0 fs/kernfs/file.c:325
 #2: ffff888026474918 (kn->active#51){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x20b/0x4f0 fs/kernfs/file.c:326
 #3: ffffffff8de22aa8 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: new_device_store+0x1ad/0x800 drivers/net/netdevsim/bus.c:160
2 locks held by syz.0.369/5625:
 #0: ffff888019eea0e0 (&type->s_umount_key#89){++++}-{3:3}, at: iterate_supers+0xac/0x1e0 fs/super.c:755
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:362 [inline]
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x270/0xb10 fs/fs-writeback.c:2737
1 lock held by syz-executor/5639:
 #0: ffffffff8e4f96e8 (rtnl_mutex){+.+.}-{3:3}, at: rtnl_lock net/core/rtnetlink.c:74 [inline]
 #0: ffffffff8e4f96e8 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x7c1/0xff0 net/core/rtnetlink.c:6118
7 locks held by syz-executor/5681:
5 locks held by syz-executor/5705:
 #0: ffff88807e37a460 (sb_writers#8){.+.+}-{0:0}, at: vfs_write+0x269/0xbc0 fs/read_write.c:580
 #1: ffff888057ed4088 (&of->mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0x1e7/0x4f0 fs/kernfs/file.c:325
 #2: ffff888026474a00 (kn->active#50){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x20b/0x4f0 fs/kernfs/file.c:326
 #3: ffffffff8de22aa8 (nsim_bus_dev_list_lock){+.+.}-{3:3}, at: del_device_store+0xf8/0x480 drivers/net/netdevsim/bus.c:209
 #4: ffff88807bc6c0e8 (&dev->mutex){....}-{3:3}, at: device_lock include/linux/device.h:837 [inline]
 #4: ffff88807bc6c0e8 (&dev->mutex){....}-{3:3}, at: __device_driver_lock drivers/base/dd.c:1080 [inline]
 #4: ffff88807bc6c0e8 (&dev->mutex){....}-{3:3}, at: device_release_driver_internal+0xb6/0x880 drivers/base/dd.c:1283
2 locks held by syz.2.399/5811:
 #0: ffff888019eea0e0 (&type->s_umount_key#89){++++}-{3:3}, at: iterate_supers+0xac/0x1e0 fs/super.c:755
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: bdi_down_write_wb_switch_rwsem fs/fs-writeback.c:362 [inline]
 #1: ffff8881437547d0 (&bdi->wb_switch_rwsem){+.+.}-{3:3}, at: sync_inodes_sb+0x270/0xb10 fs/fs-writeback.c:2737
2 locks held by dhcpcd/5842:
 #0: ffff888057424410 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:758 [inline]
 #0: ffff888057424410 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: __sock_release net/socket.c:653 [inline]
 #0: ffff888057424410 (&sb->s_type->i_mutex_key#10){+.+.}-{3:3}, at: sock_close+0x98/0x230 net/socket.c:1400
 #1: ffffffff8d3305f8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: exp_funnel_lock kernel/rcu/tree_exp.h:323 [inline]
 #1: ffffffff8d3305f8 (rcu_state.exp_mutex){+.+.}-{3:3}, at: synchronize_rcu_expedited+0x360/0x930 kernel/rcu/tree_exp.h:962

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

NMI backtrace for cpu 0
CPU: 0 PID: 27 Comm: khungtaskd Not tainted 6.1.110-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 nmi_cpu_backtrace+0x4e1/0x560 lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x1ae/0x3f0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:220 [inline]
 watchdog+0xf88/0xfd0 kernel/hung_task.c:377
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 2527 Comm: kworker/u4:5 Not tainted 6.1.110-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Workqueue: bat_events batadv_nc_worker
RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:35 [inline]
RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline]
RIP: 0010:arch_local_irq_save arch/x86/include/asm/irqflags.h:106 [inline]
RIP: 0010:lock_release+0x17a/0xa20 kernel/locking/lockdep.c:5678
Code: eb 03 42 80 3c 3b 00 74 08 4c 89 f7 e8 ef 86 77 00 4c 89 6c 24 48 48 c7 84 24 b0 00 00 00 00 00 00 00 9c 8f 84 24 b0 00 00 00 <42> 80 3c 3b 00 74 08 4c 89 f7 e8 47 86 77 00 4c 8b ac 24 b0 00 00
RSP: 0018:ffffc9000a5c7ac0 EFLAGS: 00000246
RAX: 0000000000000000 RBX: 1ffff920014b8f6e RCX: ffffffff816aaa17
RDX: 0000000000000000 RSI: ffffffff8b5d6da0 RDI: ffffffff8b5d6d60
RBP: ffffc9000a5c7be8 R08: dffffc0000000000 R09: fffffbfff1d33c96
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffff920014b8f64
R13: ffffffff8a778d07 R14: ffffc9000a5c7b70 R15: dffffc0000000000
FS:  0000000000000000(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055e0f25c86d8 CR3: 000000000d08e000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 rcu_lock_release include/linux/rcupdate.h:355 [inline]
 rcu_read_unlock include/linux/rcupdate.h:824 [inline]
 batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:412 [inline]
 batadv_nc_worker+0x28c/0x610 net/batman-adv/network-coding.c:719
 process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
 worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
 kthread+0x28d/0x320 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/15 07:11 linux-6.1.y 5f55cad62cc9 08d8a733 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan INFO: task hung in f2fs_file_open
* Struck through repros no longer work on HEAD.