syzbot


INFO: task hung in do_truncate (2)

Status: upstream: reported C repro on 2020/06/11 04:48
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+18b2ab4c697021ee8369@syzkaller.appspotmail.com
First crash: 1381d, last: 56d
Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: WARNING in sysfs_warn_dup (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit dfefd226b0bf7c435a58d75a0ce2f9273b9825f6
Author: Alexey Dobriyan <adobriyan@gmail.com>
Date: Tue Dec 15 03:15:03 2020 +0000

  mm: cleanup kstrto*() usage

  
Discussions (1)
Title Replies (including bot) Last reply
INFO: task hung in do_truncate (2) 1 (3) 2023/05/01 18:59
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 INFO: task hung in do_truncate 1 365d 365d 0/3 auto-obsoleted due to no activity on 2023/07/17 23:13
linux-5.15 INFO: task hung in do_truncate (2) 1 213d 213d 0/3 auto-obsoleted due to no activity on 2023/11/27 08:00
upstream INFO: task hung in do_truncate ext4 C 7 1950d 2113d 0/26 closed as dup on 2018/09/08 15:38
Last patch testing requests (4)
Created Duration User Patch Repo Result
2024/01/16 08:45 19m retest repro upstream OK log
2023/08/22 03:38 44m retest repro upstream OK log
2023/03/17 13:32 20m retest repro upstream report log
2022/10/03 14:30 18m retest repro upstream report log
Fix bisection attempts (6)
Created Duration User Patch Repo Result
2021/01/07 02:56 4h05m bisect fix upstream job log (1)
2020/12/06 23:59 29m bisect fix upstream job log (0) log
2020/11/05 01:48 27m bisect fix upstream job log (0) log
2020/10/06 01:19 28m bisect fix upstream job log (0) log
2020/08/26 04:50 26m bisect fix upstream job log (0) log
2020/07/26 07:30 29m bisect fix upstream job log (0) log

Sample crash report:
INFO: task syz-executor251:5090 blocked for more than 143 seconds.
      Not tainted 6.7.0-rc8-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor251 state:D stack:25712 pid:5090  tgid:5087  ppid:5081   flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5376 [inline]
 __schedule+0x1961/0x4ab0 kernel/sched/core.c:6688
 __schedule_loop kernel/sched/core.c:6763 [inline]
 schedule+0x149/0x260 kernel/sched/core.c:6778
 schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6835
 rwsem_down_write_slowpath+0xeea/0x13b0 kernel/locking/rwsem.c:1178
 __down_write_common+0x1aa/0x200 kernel/locking/rwsem.c:1306
 inode_lock include/linux/fs.h:802 [inline]
 do_truncate+0x20c/0x300 fs/open.c:64
 handle_truncate fs/namei.c:3280 [inline]
 do_open fs/namei.c:3626 [inline]
 path_openat+0x29e1/0x3290 fs/namei.c:3779
 do_filp_open+0x234/0x490 fs/namei.c:3809
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_creat fs/open.c:1528 [inline]
 __se_sys_creat fs/open.c:1522 [inline]
 __x64_sys_creat+0x123/0x160 fs/open.c:1522
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f7b946ac409
RSP: 002b:00007f7b94669218 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f7b947345e8 RCX: 00007f7b946ac409
RDX: 00007f7b946ac409 RSI: 0000000000000000 RDI: 0000000020000080
RBP: 00007f7b947345e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7b947000c0
R13: 0000000020002600 R14: 0030656c69662f2e R15: 0032656c69662f2e
 </TASK>
INFO: task syz-executor251:5101 blocked for more than 144 seconds.
      Not tainted 6.7.0-rc8-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor251 state:D stack:24208 pid:5101  tgid:5098  ppid:5077   flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5376 [inline]
 __schedule+0x1961/0x4ab0 kernel/sched/core.c:6688
 __schedule_loop kernel/sched/core.c:6763 [inline]
 schedule+0x149/0x260 kernel/sched/core.c:6778
 schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6835
 rwsem_down_write_slowpath+0xeea/0x13b0 kernel/locking/rwsem.c:1178
 __down_write_common+0x1aa/0x200 kernel/locking/rwsem.c:1306
 inode_lock include/linux/fs.h:802 [inline]
 process_measurement+0x450/0x21c0 security/integrity/ima/ima_main.c:248
 ima_file_check+0xf1/0x170 security/integrity/ima/ima_main.c:557
 do_open fs/namei.c:3624 [inline]
 path_openat+0x2897/0x3290 fs/namei.c:3779
 do_filp_open+0x234/0x490 fs/namei.c:3809
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_creat fs/open.c:1528 [inline]
 __se_sys_creat fs/open.c:1522 [inline]
 __x64_sys_creat+0x123/0x160 fs/open.c:1522
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f7b946ac409
RSP: 002b:00007f7b94669218 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f7b947345e8 RCX: 00007f7b946ac409
RDX: 00007f7b946ac409 RSI: 0000000000000000 RDI: 0000000020000080
RBP: 00007f7b947345e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7b947000c0
R13: 0000000020002600 R14: 0030656c69662f2e R15: 0032656c69662f2e
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/29:
 #0: ffffffff8d92dae0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:301 [inline]
 #0: ffffffff8d92dae0 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:747 [inline]
 #0: ffffffff8d92dae0 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x2a0 kernel/locking/lockdep.c:6614
4 locks held by kworker/u4:5/1038:
 #0: ffff888142649d38 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2602 [inline]
 #0: ffff888142649d38 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0x825/0x1420 kernel/workqueue.c:2700
 #1: ffffc90005107d20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2602 [inline]
 #1: ffffc90005107d20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x825/0x1420 kernel/workqueue.c:2700
 #2: ffff8880767a80e0 (&type->s_umount_key#46){++++}-{3:3}, at: super_trylock_shared+0x22/0xf0 fs/super.c:610
 #3: ffff8880767a60e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_write_inode+0x69/0x120 fs/exfat/inode.c:96
4 locks held by kworker/u4:6/1079:
 #0: ffff888142649d38 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2602 [inline]
 #0: ffff888142649d38 ((wq_completion)writeback){+.+.}-{0:0}, at: process_scheduled_works+0x825/0x1420 kernel/workqueue.c:2700
 #1: ffffc900051d7d20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2602 [inline]
 #1: ffffc900051d7d20 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_scheduled_works+0x825/0x1420 kernel/workqueue.c:2700
 #2: ffff8880273480e0 (&type->s_umount_key#46){++++}-{3:3}, at: super_trylock_shared+0x22/0xf0 fs/super.c:610
 #3: ffff88801e9de0e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_write_inode+0x69/0x120 fs/exfat/inode.c:96
2 locks held by getty/4810:
 #0: ffff88814cb680a0 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x25/0x70 drivers/tty/tty_ldisc.c:243
 #1: ffffc900015a72f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6b4/0x1e10 drivers/tty/n_tty.c:2201
5 locks held by syz-executor251/5079:
2 locks held by syz-executor251/5090:
 #0: ffff8880767a8418 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:404
 #1: ffff888074deb6b0 (&sb->s_type->i_mutex_key#14){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline]
 #1: ffff888074deb6b0 (&sb->s_type->i_mutex_key#14){+.+.}-{3:3}, at: do_truncate+0x20c/0x300 fs/open.c:64
2 locks held by syz-executor251/5101:
 #0: ffff888027348418 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:404
 #1: ffff888074dea9b0 (&sb->s_type->i_mutex_key#14){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline]
 #1: ffff888074dea9b0 (&sb->s_type->i_mutex_key#14){+.+.}-{3:3}, at: process_measurement+0x450/0x21c0 security/integrity/ima/ima_main.c:248
5 locks held by syz-executor251/5103:
1 lock held by syz-executor251/19007:
 #0: ffff8880b983c358 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2a/0x140 kernel/sched/core.c:558

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

NMI backtrace for cpu 1
CPU: 1 PID: 29 Comm: khungtaskd Not tainted 6.7.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 nmi_cpu_backtrace+0x498/0x4d0 lib/nmi_backtrace.c:113
 nmi_trigger_cpumask_backtrace+0x198/0x310 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:160 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:222 [inline]
 watchdog+0xfaf/0xff0 kernel/hung_task.c:379
 kthread+0x2d3/0x370 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
 </TASK>
Sending NMI from CPU 1 to CPUs 0:
NMI backtrace for cpu 0
CPU: 0 PID: 5103 Comm: syz-executor251 Not tainted 6.7.0-rc8-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
RIP: 0010:__exfat_free_cluster+0x393/0x990 fs/exfat/fatent.c:192
Code: ff 83 7c 24 1c 00 0f 95 c3 44 8b 7c 24 0c 44 89 ff 44 89 f6 e8 9e 1f 29 ff 45 39 f7 0f 94 c0 20 d8 75 03 45 89 f7 3c 01 75 0c <e8> 08 1e 29 ff 31 db e9 a3 00 00 00 48 b8 00 00 00 00 00 fc ff df
RSP: 0018:ffffc90003e7f4a0 EFLAGS: 00000246
RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000009
RDX: ffff888073cc5940 RSI: 000000000003029a RDI: 000000000003029a
RBP: ffffc90003e7f5b8 R08: ffffffff82655bd2 R09: 1ffff1100e9d7dd0
R10: dffffc0000000000 R11: ffffed100e9d7dd1 R12: 0000000000000009
R13: 000000003029a200 R14: 000000000003029a R15: 000000000003029a
FS:  00007f7b946696c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7b8c268000 CR3: 0000000077b46000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 exfat_free_cluster+0x77/0xd0 fs/exfat/fatent.c:232
 __exfat_truncate+0x692/0x9b0 fs/exfat/file.c:187
 exfat_truncate+0xdb/0x330 fs/exfat/file.c:211
 exfat_setattr+0xa8b/0xdd0 fs/exfat/file.c:313
 notify_change+0xb99/0xe60 fs/attr.c:499
 do_truncate+0x220/0x300 fs/open.c:66
 handle_truncate fs/namei.c:3280 [inline]
 do_open fs/namei.c:3626 [inline]
 path_openat+0x29e1/0x3290 fs/namei.c:3779
 do_filp_open+0x234/0x490 fs/namei.c:3809
 do_sys_openat2+0x13e/0x1d0 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_creat fs/open.c:1528 [inline]
 __se_sys_creat fs/open.c:1522 [inline]
 __x64_sys_creat+0x123/0x160 fs/open.c:1522
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0x45/0x110 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x63/0x6b
RIP: 0033:0x7f7b946ac409
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 81 18 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7b94669218 EFLAGS: 00000246 ORIG_RAX: 0000000000000055
RAX: ffffffffffffffda RBX: 00007f7b947345e8 RCX: 00007f7b946ac409
RDX: 00007f7b946ac409 RSI: 0000000000000000 RDI: 0000000020000080
RBP: 00007f7b947345e0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f7b947000c0
R13: 0000000020002600 R14: 0030656c69662f2e R15: 0032656c69662f2e
 </TASK>
INFO: NMI handler (nmi_cpu_backtrace_handler) took too long to run: 1.328 msecs

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/01/02 03:35 upstream 610a9b8f49fb fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs INFO: task hung in do_truncate
2020/06/07 04:44 upstream 7ae77150d94d e6b89e4e .config console log report syz C ci-upstream-kasan-gce-root
2024/01/23 07:42 upstream 5d9248eed480 1c0ecc51 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in do_truncate
2024/01/23 07:41 upstream 610347effc2e 1c0ecc51 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root INFO: task hung in do_truncate
2023/09/28 04:41 upstream 633b47cb009d c2ab1e5d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in do_truncate
2023/04/18 04:44 upstream 6a8f57ae2eb0 436577a9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in do_truncate
2022/12/07 12:41 upstream 8ed710da2873 d88f3abb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs INFO: task hung in do_truncate
2021/12/28 16:13 upstream a8ad9a2434dc 6b3c5e64 .config console log report info ci-upstream-kasan-gce-smack-root INFO: task hung in do_truncate
2021/08/26 10:47 upstream 73f3af7b4611 b599f2fc .config console log report info ci-upstream-kasan-gce-selinux-root INFO: task hung in do_truncate
2021/07/30 02:35 upstream 7e96bf476270 c585c7b0 .config console log report info ci-upstream-kasan-gce-smack-root INFO: task hung in do_truncate
2021/07/19 23:00 upstream 2734d6c1b1a0 bc48c9ab .config console log report info ci-upstream-kasan-gce-selinux-root INFO: task hung in do_truncate
2021/07/01 23:36 upstream e04360a2ea01 658ebc66 .config console log report info ci-upstream-kasan-gce-selinux-root INFO: task hung in do_truncate
2023/06/26 04:53 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci e40939bbfc68 09ffe269 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 INFO: task hung in do_truncate
2023/03/19 05:30 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci fe15c26ee26e 7939252e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 INFO: task hung in do_truncate
* Struck through repros no longer work on HEAD.