syzbot


INFO: task hung in do_rmdir

Status: fixed on 2025/01/30 02:24
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+49a471f4ff67c7c5776c@syzkaller.appspotmail.com
Fix commit: 28c21f0ac529 exfat: fix the infinite loop in exfat_readdir()
First crash: 166d, last: 143d
Fix bisection: fixed by (bisect log) :
commit 28c21f0ac5293a4bf19b3e0e32005d6dd31a6c17
Author: Yuezhang Mo <Yuezhang.Mo@sony.com>
Date: Fri Dec 13 05:08:37 2024 +0000

  exfat: fix the infinite loop in exfat_readdir()

  
Bug presence (2)
Date Name Commit Repro Result
2024/12/02 linux-5.15.y (ToT) 0a51d2d4527b C [report] INFO: task hung in do_rmdir
2024/12/02 upstream (ToT) e70140ba0d2b C Didn't crash
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream INFO: task hung in do_rmdir (5) ext4 nilfs 5 855d 1022d 0/28 auto-obsoleted due to no activity on 2023/04/25 17:21
upstream INFO: task hung in do_rmdir (3) fs 10 1536d 1611d 0/28 auto-closed as invalid on 2021/06/01 08:24
linux-4.19 INFO: task hung in do_rmdir 1 1039d 1039d 0/1 auto-obsoleted due to no activity on 2022/11/10 04:55
android-49 INFO: task hung in do_rmdir 1 2561d 2561d 0/3 auto-closed as invalid on 2019/02/22 12:59
upstream INFO: task hung in do_rmdir (4) fs 1 1195d 1195d 0/28 auto-closed as invalid on 2022/05/08 10:41
upstream INFO: task hung in do_rmdir (2) exfat 3 2319d 2454d 0/28 closed as dup on 2018/09/11 15:01
upstream INFO: task hung in do_rmdir (6) bcachefs C error inconclusive 45 4d13h 204d 0/28 upstream: reported C repro on 2024/10/25 00:44
upstream INFO: task hung in do_rmdir fs 1 2608d 2608d 0/28 closed as invalid on 2018/03/27 11:14
Last patch testing requests (3)
Created Duration User Patch Repo Result
2024/12/25 08:08 12m retest repro linux-5.15.y report log
2024/12/25 08:08 15m retest repro linux-5.15.y report log
2024/12/25 08:08 1h01m retest repro linux-5.15.y report log

Sample crash report:
INFO: task syz-executor399:4184 blocked for more than 143 seconds.
      Not tainted 5.15.173-syzkaller #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor399 state:D stack:28304 pid: 4184 ppid:  4180 flags:0x00004006
Call Trace:
 <TASK>
 context_switch kernel/sched/core.c:5027 [inline]
 __schedule+0x12c4/0x45b0 kernel/sched/core.c:6373
 schedule+0x11b/0x1f0 kernel/sched/core.c:6456
 rwsem_down_write_slowpath+0xf0c/0x16a0 kernel/locking/rwsem.c:1165
 inode_lock_nested include/linux/fs.h:824 [inline]
 do_rmdir+0x225/0x670 fs/namei.c:4197
 __do_sys_rmdir fs/namei.c:4229 [inline]
 __se_sys_rmdir fs/namei.c:4227 [inline]
 __x64_sys_rmdir+0x45/0x50 fs/namei.c:4227
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fa081143789
RSP: 002b:00007fa0810df218 EFLAGS: 00000246 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 00007fa0811cb6d8 RCX: 00007fa081143789
RDX: 00007fa08111cef6 RSI: 0000000000000000 RDI: 00000000200000c0
RBP: 00007fa0811cb6d0 R08: 00007ffc0eda4f77 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa08119707e
R13: 00007fa0811970e0 R14: 0030656c69662f2e R15: 0031656c69662f2e
 </TASK>

Showing all locks held in the system:
1 lock held by khungtaskd/27:
 #0: ffffffff8cb1fc60 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
2 locks held by getty/3933:
 #0: ffff88802cc37098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:252
 #1: ffffc90002cd62e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x6af/0x1db0 drivers/tty/n_tty.c:2158
3 locks held by syz-executor399/4182:
2 locks held by syz-executor399/4184:
 #0: ffff88802b62c460 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3b/0x80 fs/namespace.c:377
 #1: ffff8880701a82b0 (&sb->s_type->i_mutex_key#15/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:824 [inline]
 #1: ffff8880701a82b0 (&sb->s_type->i_mutex_key#15/1){+.+.}-{3:3}, at: do_rmdir+0x225/0x670 fs/namei.c:4197

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

NMI backtrace for cpu 0
CPU: 0 PID: 27 Comm: khungtaskd Not tainted 5.15.173-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 nmi_cpu_backtrace+0x46a/0x4a0 lib/nmi_backtrace.c:111
 nmi_trigger_cpumask_backtrace+0x181/0x2a0 lib/nmi_backtrace.c:62
 trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
 check_hung_uninterruptible_tasks kernel/hung_task.c:210 [inline]
 watchdog+0xe72/0xeb0 kernel/hung_task.c:295
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
 </TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 4182 Comm: syz-executor399 Not tainted 5.15.173-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:exfat_ent_get+0x1f8/0x400 fs/exfat/fatent.c:104
Code: e8 7d 91 a8 ff 42 0f b6 44 25 00 84 c0 0f 85 b7 01 00 00 41 8b 1f 48 89 df 48 c7 c6 20 5d cd 8c e8 2d 35 43 ff b8 ff ff ff ff <48> 39 c3 4c 8b 74 24 08 74 5b 83 fb f7 0f 84 ae 00 00 00 85 db 0f
RSP: 0018:ffffc9000313f788 EFLAGS: 00000246
RAX: 00000000ffffffff RBX: 0000000000000005 RCX: 000000000000008b
RDX: 0000000000000003 RSI: ffffffff8ccd5d20 RDI: 0000000000000005
RBP: 1ffff92000627f38 R08: 0000000000000005 R09: ffffffff823d42d3
R10: 0000000000000003 R11: ffff88802328d940 R12: dffffc0000000000
R13: 0000000000000005 R14: ffff88807016e000 R15: ffffc9000313f9c0
FS:  00007fa0811006c0(0000) GS:ffff8880b8f00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000562fd5893600 CR3: 00000000768b7000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <NMI>
 </NMI>
 <TASK>
 exfat_readdir fs/exfat/dir.c:184 [inline]
 exfat_iterate+0xda2/0x34a0 fs/exfat/dir.c:258
 iterate_dir+0x224/0x570
 __do_sys_getdents fs/readdir.c:286 [inline]
 __se_sys_getdents+0x1e8/0x4c0 fs/readdir.c:271
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fa081143789
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:00007fa081100218 EFLAGS: 00000246 ORIG_RAX: 000000000000004e
RAX: ffffffffffffffda RBX: 00007fa0811cb6c8 RCX: 00007fa081143789
RDX: 00000000000000b6 RSI: 0000000020001fc0 RDI: 0000000000000004
RBP: 00007fa0811cb6c0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa08119707e
R13: 00007fa0811970e0 R14: 0030656c69662f2e R15: 0031656c69662f2e
 </TASK>

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/02 08:49 linux-5.15.y 0a51d2d4527b 68914665 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan INFO: task hung in do_rmdir
2024/12/02 06:57 linux-5.15.y 0a51d2d4527b 68914665 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan INFO: task hung in do_rmdir
2024/12/02 05:02 linux-5.15.y 0a51d2d4527b 68914665 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan INFO: task hung in do_rmdir
2024/12/02 10:53 linux-5.15.y 0a51d2d4527b 68914665 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan INFO: task hung in do_rmdir
2024/12/02 03:08 linux-5.15.y 0a51d2d4527b 68914665 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan INFO: task hung in do_rmdir
* Struck through repros no longer work on HEAD.