Hello,
syzbot found the following issue on:
HEAD commit: f9ff5644bcc0 Merge tag 'hsi-for-6.2' of git://git.kernel.o..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15a7ad1b880000
kernel config: https://syzkaller.appspot.com/x/.config?x=c163713cf9186fe7
dashboard link: https://syzkaller.appspot.com/bug?extid=2f73ed585f115e98aee8
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11d6fe00480000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15d2fc63880000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/95eb66f6b569/disk-f9ff5644.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/fb05e1a5a9de/vmlinux-f9ff5644.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e2f1f698973a/bzImage-f9ff5644.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/b52ba015912a/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: [email protected]
INFO: task kworker/u4:1:11 blocked for more than 143 seconds.
Not tainted 6.1.0-syzkaller-13139-gf9ff5644bcc0 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u4:1 state:D stack:18424 pid:11 ppid:2 flags:0x00004000
Workqueue: writeback wb_workfn (flush-7:2)
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5244 [inline]
__schedule+0x995/0xe20 kernel/sched/core.c:6555
schedule+0xcb/0x190 kernel/sched/core.c:6631
schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6690
__mutex_lock_common+0xe4f/0x26e0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
write_inode fs/fs-writeback.c:1451 [inline]
__writeback_single_inode+0x4d6/0x670 fs/fs-writeback.c:1663
writeback_sb_inodes+0x812/0x1050 fs/fs-writeback.c:1889
__writeback_inodes_wb+0x11d/0x260 fs/fs-writeback.c:1960
wb_writeback+0x440/0x7b0 fs/fs-writeback.c:2065
wb_check_background_flush fs/fs-writeback.c:2131 [inline]
wb_do_writeback fs/fs-writeback.c:2219 [inline]
wb_workfn+0xb3f/0xef0 fs/fs-writeback.c:2246
process_one_work+0x877/0xdb0 kernel/workqueue.c:2289
worker_thread+0xb14/0x1330 kernel/workqueue.c:2436
kthread+0x266/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
INFO: task kworker/u4:2:34 blocked for more than 144 seconds.
Not tainted 6.1.0-syzkaller-13139-gf9ff5644bcc0 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u4:2 state:D stack:17088 pid:34 ppid:2 flags:0x00004000
Workqueue: writeback wb_workfn (flush-7:1)
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5244 [inline]
__schedule+0x995/0xe20 kernel/sched/core.c:6555
schedule+0xcb/0x190 kernel/sched/core.c:6631
schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6690
__mutex_lock_common+0xe4f/0x26e0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
write_inode fs/fs-writeback.c:1451 [inline]
__writeback_single_inode+0x4d6/0x670 fs/fs-writeback.c:1663
writeback_sb_inodes+0x812/0x1050 fs/fs-writeback.c:1889
__writeback_inodes_wb+0x11d/0x260 fs/fs-writeback.c:1960
wb_writeback+0x440/0x7b0 fs/fs-writeback.c:2065
wb_check_background_flush fs/fs-writeback.c:2131 [inline]
wb_do_writeback fs/fs-writeback.c:2219 [inline]
wb_workfn+0xb3f/0xef0 fs/fs-writeback.c:2246
process_one_work+0x877/0xdb0 kernel/workqueue.c:2289
worker_thread+0xb14/0x1330 kernel/workqueue.c:2436
kthread+0x266/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
INFO: task kworker/u4:5:1065 blocked for more than 145 seconds.
Not tainted 6.1.0-syzkaller-13139-gf9ff5644bcc0 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u4:5 state:D stack:22144 pid:1065 ppid:2 flags:0x00004000
Workqueue: writeback wb_workfn (flush-7:4)
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5244 [inline]
__schedule+0x995/0xe20 kernel/sched/core.c:6555
schedule+0xcb/0x190 kernel/sched/core.c:6631
schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6690
__mutex_lock_common+0xe4f/0x26e0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
write_inode fs/fs-writeback.c:1451 [inline]
__writeback_single_inode+0x4d6/0x670 fs/fs-writeback.c:1663
writeback_sb_inodes+0x812/0x1050 fs/fs-writeback.c:1889
__writeback_inodes_wb+0x11d/0x260 fs/fs-writeback.c:1960
wb_writeback+0x440/0x7b0 fs/fs-writeback.c:2065
wb_check_background_flush fs/fs-writeback.c:2131 [inline]
wb_do_writeback fs/fs-writeback.c:2219 [inline]
wb_workfn+0xb3f/0xef0 fs/fs-writeback.c:2246
process_one_work+0x877/0xdb0 kernel/workqueue.c:2289
worker_thread+0xb14/0x1330 kernel/workqueue.c:2436
kthread+0x266/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
INFO: task kworker/u4:0:5140 blocked for more than 145 seconds.
Not tainted 6.1.0-syzkaller-13139-gf9ff5644bcc0 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u4:0 state:D stack:21824 pid:5140 ppid:2 flags:0x00004000
Workqueue: writeback wb_workfn (flush-7:0)
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5244 [inline]
__schedule+0x995/0xe20 kernel/sched/core.c:6555
schedule+0xcb/0x190 kernel/sched/core.c:6631
schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6690
__mutex_lock_common+0xe4f/0x26e0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
write_inode fs/fs-writeback.c:1451 [inline]
__writeback_single_inode+0x4d6/0x670 fs/fs-writeback.c:1663
writeback_sb_inodes+0x812/0x1050 fs/fs-writeback.c:1889
__writeback_inodes_wb+0x11d/0x260 fs/fs-writeback.c:1960
wb_writeback+0x440/0x7b0 fs/fs-writeback.c:2065
wb_check_background_flush fs/fs-writeback.c:2131 [inline]
wb_do_writeback fs/fs-writeback.c:2219 [inline]
wb_workfn+0xb3f/0xef0 fs/fs-writeback.c:2246
process_one_work+0x877/0xdb0 kernel/workqueue.c:2289
worker_thread+0xb14/0x1330 kernel/workqueue.c:2436
kthread+0x266/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
INFO: task kworker/u4:3:5145 blocked for more than 146 seconds.
Not tainted 6.1.0-syzkaller-13139-gf9ff5644bcc0 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u4:3 state:D stack:22144 pid:5145 ppid:2 flags:0x00004000
Workqueue: writeback wb_workfn (flush-7:3)
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5244 [inline]
__schedule+0x995/0xe20 kernel/sched/core.c:6555
schedule+0xcb/0x190 kernel/sched/core.c:6631
schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6690
__mutex_lock_common+0xe4f/0x26e0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
write_inode fs/fs-writeback.c:1451 [inline]
__writeback_single_inode+0x4d6/0x670 fs/fs-writeback.c:1663
writeback_sb_inodes+0x812/0x1050 fs/fs-writeback.c:1889
__writeback_inodes_wb+0x11d/0x260 fs/fs-writeback.c:1960
wb_writeback+0x440/0x7b0 fs/fs-writeback.c:2065
wb_check_background_flush fs/fs-writeback.c:2131 [inline]
wb_do_writeback fs/fs-writeback.c:2219 [inline]
wb_workfn+0xb3f/0xef0 fs/fs-writeback.c:2246
process_one_work+0x877/0xdb0 kernel/workqueue.c:2289
worker_thread+0xb14/0x1330 kernel/workqueue.c:2436
kthread+0x266/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
INFO: task kworker/u4:4:5146 blocked for more than 147 seconds.
Not tainted 6.1.0-syzkaller-13139-gf9ff5644bcc0 #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u4:4 state:D stack:22144 pid:5146 ppid:2 flags:0x00004000
Workqueue: writeback wb_workfn (flush-7:5)
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5244 [inline]
__schedule+0x995/0xe20 kernel/sched/core.c:6555
schedule+0xcb/0x190 kernel/sched/core.c:6631
schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6690
__mutex_lock_common+0xe4f/0x26e0 kernel/locking/mutex.c:679
__mutex_lock kernel/locking/mutex.c:747 [inline]
mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:799
exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
write_inode fs/fs-writeback.c:1451 [inline]
__writeback_single_inode+0x4d6/0x670 fs/fs-writeback.c:1663
writeback_sb_inodes+0x812/0x1050 fs/fs-writeback.c:1889
__writeback_inodes_wb+0x11d/0x260 fs/fs-writeback.c:1960
wb_writeback+0x440/0x7b0 fs/fs-writeback.c:2065
wb_check_background_flush fs/fs-writeback.c:2131 [inline]
wb_do_writeback fs/fs-writeback.c:2219 [inline]
wb_workfn+0xb3f/0xef0 fs/fs-writeback.c:2246
process_one_work+0x877/0xdb0 kernel/workqueue.c:2289
worker_thread+0xb14/0x1330 kernel/workqueue.c:2436
kthread+0x266/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
Showing all locks held in the system:
4 locks held by kworker/u4:1/11:
#0: ffff8881451dc938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7f2/0xdb0
#1: ffffc90000107d00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x831/0xdb0 kernel/workqueue.c:2264
#2: ffff88802bc260e0 (&type->s_umount_key#42){.+.+}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:415
#3: ffff888079e060e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
1 lock held by rcu_tasks_kthre/12:
#0: ffffffff8d326e50 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x30/0xd00 kernel/rcu/tasks.h:507
1 lock held by rcu_tasks_trace/13:
#0: ffffffff8d327650 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x30/0xd00 kernel/rcu/tasks.h:507
1 lock held by khungtaskd/28:
#0: ffffffff8d326c80 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x0/0x30
4 locks held by kworker/u4:2/34:
#0: ffff8881451dc938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7f2/0xdb0
#1: ffffc90000ab7d00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x831/0xdb0 kernel/workqueue.c:2264
#2: ffff888022bd40e0 (&type->s_umount_key#42){.+.+}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:415
#3: ffff88807a1c40e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
4 locks held by kworker/u4:5/1065:
#0: ffff8881451dc938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7f2/0xdb0
#1: ffffc900056dfd00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x831/0xdb0 kernel/workqueue.c:2264
#2: ffff8880756600e0 (&type->s_umount_key#42){.+.+}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:415
#3: ffff88802b40c0e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
2 locks held by getty/4750:
#0: ffff888028235098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x21/0x70 drivers/tty/tty_ldisc.c:244
#1: ffffc900015902f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x53b/0x1650 drivers/tty/n_tty.c:2177
6 locks held by syz-executor402/5133:
6 locks held by syz-executor402/5134:
6 locks held by syz-executor402/5135:
6 locks held by syz-executor402/5136:
6 locks held by syz-executor402/5137:
6 locks held by syz-executor402/5138:
4 locks held by kworker/u4:0/5140:
#0: ffff8881451dc938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7f2/0xdb0
#1: ffffc90003effd00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x831/0xdb0 kernel/workqueue.c:2264
#2: ffff8880756620e0 (&type->s_umount_key#42){.+.+}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:415
#3: ffff88807f4ae0e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
4 locks held by kworker/u4:3/5145:
#0: ffff8881451dc938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7f2/0xdb0
#1: ffffc90003f1fd00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x831/0xdb0 kernel/workqueue.c:2264
#2: ffff8880757220e0 (&type->s_umount_key#42){.+.+}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:415
#3: ffff88802b6100e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
4 locks held by kworker/u4:4/5146:
#0: ffff8881451dc938 ((wq_completion)writeback){+.+.}-{0:0}, at: process_one_work+0x7f2/0xdb0
#1: ffffc90003f3fd00 ((work_completion)(&(&wb->dwork)->work)){+.+.}-{0:0}, at: process_one_work+0x831/0xdb0 kernel/workqueue.c:2264
#2: ffff88802bda60e0 (&type->s_umount_key#42){.+.+}-{3:3}, at: trylock_super+0x1b/0xf0 fs/super.c:415
#3: ffff88807bd960e0 (&sbi->s_lock){+.+.}-{3:3}, at: exfat_write_inode+0x65/0x110 fs/exfat/inode.c:93
=============================================
NMI backtrace for cpu 0
CPU: 0 PID: 28 Comm: khungtaskd Not tainted 6.1.0-syzkaller-13139-gf9ff5644bcc0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1b1/0x290 lib/dump_stack.c:106
nmi_cpu_backtrace+0x46f/0x4f0 lib/nmi_backtrace.c:111
nmi_trigger_cpumask_backtrace+0x1ba/0x420 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+0xcd5/0xd20 kernel/hung_task.c:377
kthread+0x266/0x300 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308
</TASK>
Sending NMI from CPU 0 to CPUs 1:
NMI backtrace for cpu 1
CPU: 1 PID: 5133 Comm: syz-executor402 Not tainted 6.1.0-syzkaller-13139-gf9ff5644bcc0 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:is_valid_cluster fs/exfat/exfat_fs.h:413 [inline]
RIP: 0010:exfat_clear_bitmap+0x85/0x5b0 fs/exfat/balloc.c:171
Code: e8 30 e2 84 ff 4c 8b 3b bf 01 00 00 00 44 89 e6 e8 40 4a 2f ff 41 83 fc 01 0f 86 cb 01 00 00 49 8d 5f 08 48 89 d8 48 c1 e8 03 <42> 8a 04 28 84 c0 0f 85 78 03 00 00 8b 1b 89 df 44 89 e6 e8 93 47
RSP: 0018:ffffc90003b1f838 EFLAGS: 00000a02
RAX: 1ffff1100fe95c01 RBX: ffff88807f4ae008 RCX: 0000000000000000
RDX: ffff88801f718000 RSI: 000000003c2e4184 RDI: 0000000000000001
RBP: ffff888075662000 R08: ffffffff825c8fa0 R09: ffffed100e7265b4
R10: ffffed100e7265b4 R11: 1ffff1100e7265b3 R12: 000000003c2e4184
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff88807f4ae000
FS: 000055555561c300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055d87a197600 CR3: 000000007e2a5000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
__exfat_free_cluster+0x470/0x9c0 fs/exfat/fatent.c:192
exfat_free_cluster+0x73/0xc0 fs/exfat/fatent.c:232
__exfat_truncate+0x67e/0x980 fs/exfat/file.c:184
exfat_evict_inode+0xce/0x270 fs/exfat/inode.c:624
evict+0x2a4/0x620 fs/inode.c:664
__dentry_kill+0x3b1/0x5b0 fs/dcache.c:607
dentry_kill+0xbb/0x290
dput+0x1f3/0x410 fs/dcache.c:913
do_renameat2+0xabf/0x12d0 fs/namei.c:4932
__do_sys_rename fs/namei.c:4976 [inline]
__se_sys_rename fs/namei.c:4974 [inline]
__x64_sys_rename+0x82/0x90 fs/namei.c:4974
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fe1e540ea79
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff21223158 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe1e540ea79
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 0000000000000000 R08: 00007fff21223180 R09: 00007fff21223180
R10: 00007fff21223030 R11: 0000000000000246 R12: 00007fe1e53cd890
R13: 00007fff212231b0 R14: 00007fff21223190 R15: 0000000000000000
</TASK>
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at [email protected].
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches
syzbot has bisected this issue to:
commit 907fa893258ba6076f5fff32900a461decb9e8c5
Author: Namjae Jeon <[email protected]>
Date: Thu May 21 23:10:10 2020 +0000
exfat: add the dummy mount options to be backward compatible with staging/exfat
bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=138aca9ae80000
start commit: f9ff5644bcc0 Merge tag 'hsi-for-6.2' of git://git.kernel.o..
git tree: upstream
final oops: https://syzkaller.appspot.com/x/report.txt?x=104aca9ae80000
console output: https://syzkaller.appspot.com/x/log.txt?x=178aca9ae80000
kernel config: https://syzkaller.appspot.com/x/.config?x=c163713cf9186fe7
dashboard link: https://syzkaller.appspot.com/bug?extid=2f73ed585f115e98aee8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11d6fe00480000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15d2fc63880000
Reported-by: [email protected]
Fixes: 907fa893258b ("exfat: add the dummy mount options to be backward compatible with staging/exfat")
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
For archival purposes, forwarding an incoming command email to
[email protected].
***
Subject: task hung in exfat_write_inode
Author: [email protected]
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f9ff5644bcc0
diff --git a/fs/exfat/file.c b/fs/exfat/file.c
index bfdfafe00993..a3ace4fc555c 100644
--- a/fs/exfat/file.c
+++ b/fs/exfat/file.c
@@ -116,6 +116,7 @@ int __exfat_truncate(struct inode *inode)
exfat_chain_set(&clu, ei->start_clu, num_clusters_phys, ei->flags);
+ mutex_unlock(&sbi->s_lock);
if (i_size_read(inode) > 0) {
/*
* Truncate FAT chain num_clusters after the first cluster
@@ -134,8 +135,10 @@ int __exfat_truncate(struct inode *inode)
} else {
while (num_clusters > 0) {
last_clu = clu.dir;
+ mutex_lock(&sbi->s_lock);
if (exfat_get_next_cluster(sb, &(clu.dir)))
return -EIO;
+ mutex_unlock(&sbi->s_lock);
num_clusters--;
clu.size--;
@@ -160,6 +163,7 @@ int __exfat_truncate(struct inode *inode)
* __exfat_write_inode() is called for directory entry, bitmap
* and FAT to be written in a same writeback.
*/
+ mutex_unlock(&sbi->s_lock);
if (__exfat_write_inode(inode, inode_needs_sync(inode)))
return -EIO;
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
WARNING: bad unlock balance in __exfat_truncate
=====================================
WARNING: bad unlock balance detected!
6.1.0-syzkaller-11044-gf9ff5644bcc0-dirty #0 Not tainted
-------------------------------------
syz-executor.1/5525 is trying to release lock (&sbi->s_lock) at:
[<ffffffff8247908a>] __exfat_truncate+0x45a/0x7f0 fs/exfat/file.c:163
but there are no more locks to release!
other info that might help us debug this:
4 locks held by syz-executor.1/5525:
#0: ffff88802a1e4460 (sb_writers#14){.+.+}-{0:0}, at: do_renameat2+0x3eb/0xd20 fs/namei.c:4866
#1: ffff88802a1e4748 (&type->s_vfs_rename_key#2){+.+.}-{3:3}, at: lock_rename+0x58/0x280 fs/namei.c:2994
#2: ffff88806489b970 (&sb->s_type->i_mutex_key#21/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline]
#2: ffff88806489b970 (&sb->s_type->i_mutex_key#21/1){+.+.}-{3:3}, at: lock_rename+0xa4/0x280 fs/namei.c:2998
#3: ffff88806489d9b0 (&sb->s_type->i_mutex_key#21/2){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline]
#3: ffff88806489d9b0 (&sb->s_type->i_mutex_key#21/2){+.+.}-{3:3}, at: lock_rename+0xd8/0x280 fs/namei.c:2999
stack backtrace:
CPU: 1 PID: 5525 Comm: syz-executor.1 Not tainted 6.1.0-syzkaller-11044-gf9ff5644bcc0-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x100/0x178 lib/dump_stack.c:106
print_unlock_imbalance_bug include/trace/events/lock.h:69 [inline]
__lock_release kernel/locking/lockdep.c:5345 [inline]
lock_release.cold+0x49/0x4e kernel/locking/lockdep.c:5688
__mutex_unlock_slowpath+0xa3/0x640 kernel/locking/mutex.c:907
__exfat_truncate+0x45a/0x7f0 fs/exfat/file.c:163
exfat_evict_inode+0x263/0x340 fs/exfat/inode.c:624
evict+0x2ed/0x6b0 fs/inode.c:664
iput_final fs/inode.c:1747 [inline]
iput.part.0+0x5ea/0x8c0 fs/inode.c:1773
iput+0x5c/0x80 fs/inode.c:1763
dentry_unlink_inode+0x292/0x430 fs/dcache.c:401
__dentry_kill+0x3b8/0x640 fs/dcache.c:607
dentry_kill fs/dcache.c:745 [inline]
dput+0x6aa/0xf70 fs/dcache.c:913
do_renameat2+0x46a/0xd20 fs/namei.c:4932
__do_sys_rename fs/namei.c:4976 [inline]
__se_sys_rename fs/namei.c:4974 [inline]
__x64_sys_rename+0x81/0xa0 fs/namei.c:4974
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f464c67cb29
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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:00007f464361e0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f464c79c050 RCX: 00007f464c67cb29
RDX: 0000000000000000 RSI: 0000000020000080 RDI: 0000000020000040
RBP: 00007f464c6c847a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007f464c79c050 R15: 00007ffd9781fcc8
</TASK>
Tested on:
commit: f9ff5644 Merge tag 'hsi-for-6.2' of git://git.kernel.o..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1140c364e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1bf08f50e8fff9ad
dashboard link: https://syzkaller.appspot.com/bug?extid=2f73ed585f115e98aee8
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=12aa5254e80000
For archival purposes, forwarding an incoming command email to
[email protected].
***
Subject: task hung in exfat_write_inode
Author: [email protected]
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f9ff5644bcc0
diff --git a/fs/exfat/file.c b/fs/exfat/file.c
index bfdfafe00993..a3ace4fc555c 100644
--- a/fs/exfat/file.c
+++ b/fs/exfat/file.c
@@ -116,6 +116,7 @@ int __exfat_truncate(struct inode *inode)
exfat_chain_set(&clu, ei->start_clu, num_clusters_phys, ei->flags);
+ mutex_unlock(&sbi->s_lock);
if (i_size_read(inode) > 0) {
/*
* Truncate FAT chain num_clusters after the first cluster
@@ -134,8 +135,10 @@ int __exfat_truncate(struct inode *inode)
} else {
while (num_clusters > 0) {
last_clu = clu.dir;
+ mutex_lock(&sbi->s_lock);
if (exfat_get_next_cluster(sb, &(clu.dir)))
return -EIO;
+ mutex_unlock(&sbi->s_lock);
num_clusters--;
clu.size--;
@@ -160,6 +163,7 @@ int __exfat_truncate(struct inode *inode)
* __exfat_write_inode() is called for directory entry, bitmap
* and FAT to be written in a same writeback.
*/
+ mutex_lock(&sbi->s_lock);
if (__exfat_write_inode(inode, inode_needs_sync(inode)))
return -EIO;
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: rcu detected stall in corrupted
rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { P5347 } 2683 jiffies s: 2905 root: 0x0/T
rcu: blocking rcu_node structures (internal RCU debug):
Tested on:
commit: f9ff5644 Merge tag 'hsi-for-6.2' of git://git.kernel.o..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=14c0c364e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1bf08f50e8fff9ad
dashboard link: https://syzkaller.appspot.com/bug?extid=2f73ed585f115e98aee8
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=12485f62e80000
For archival purposes, forwarding an incoming command email to
[email protected].
***
Subject: task hung in exfat_write_inode
Author: [email protected]
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f9ff5644bcc0
diff --git a/fs/exfat/file.c b/fs/exfat/file.c
index bfdfafe00993..4bdcdf126a21 100644
--- a/fs/exfat/file.c
+++ b/fs/exfat/file.c
@@ -132,14 +132,18 @@ int __exfat_truncate(struct inode *inode)
clu.dir += num_clusters;
clu.size -= num_clusters;
} else {
+ mutex_unlock(&sbi->s_lock);
while (num_clusters > 0) {
last_clu = clu.dir;
+ mutex_lock(&sbi->s_lock);
if (exfat_get_next_cluster(sb, &(clu.dir)))
return -EIO;
+ mutex_unlock(&sbi->s_lock);
num_clusters--;
clu.size--;
}
+ mutex_lock(&sbi->s_lock);
}
} else {
ei->flags = ALLOC_NO_FAT_CHAIN;
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: rcu detected stall in corrupted
rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { P5342 } 2662 jiffies s: 2933 root: 0x0/T
rcu: blocking rcu_node structures (internal RCU debug):
Tested on:
commit: f9ff5644 Merge tag 'hsi-for-6.2' of git://git.kernel.o..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1292be28e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1bf08f50e8fff9ad
dashboard link: https://syzkaller.appspot.com/bug?extid=2f73ed585f115e98aee8
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=124a528ce80000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f9ff5644bcc0
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index 56b870d9cc0d..a40e0f5ca67c 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -149,7 +149,7 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
{
struct super_block *sb = inode->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb);
- int cur_cmap_i, next_cmap_i;
+ int cur_cmap_i, next_cmap_i, ei = 0;
unsigned int num_clusters = 0;
unsigned int clu;
@@ -176,8 +176,11 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
if (p_chain->flags == ALLOC_NO_FAT_CHAIN) {
unsigned int last_cluster = p_chain->dir + p_chain->size - 1;
+ printk("b dir: %u, s: %u, nc: %u\n", p_chain->dir, p_chain->size, num_clusters);
do {
bool sync = false;
+ if (ei > 100)
+ break;
if (clu < last_cluster)
next_cmap_i =
@@ -192,12 +195,17 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
exfat_clear_bitmap(inode, clu, (sync && IS_DIRSYNC(inode)));
clu++;
num_clusters++;
+ ei++;
} while (num_clusters < p_chain->size);
+ printk("e dir: %u, s: %u, nc: %u, e: %d\n", p_chain->dir, p_chain->size, num_clusters, ei);
} else {
+ printk("b2 dir: %u, s: %u, nc: %u\n", p_chain->dir, p_chain->size, num_clusters);
do {
bool sync = false;
unsigned int n_clu = clu;
int err = exfat_get_next_cluster(sb, &n_clu);
+ if (ei > 100)
+ break;
if (err || n_clu == EXFAT_EOF_CLUSTER)
sync = true;
@@ -213,10 +221,12 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
exfat_clear_bitmap(inode, clu, (sync && IS_DIRSYNC(inode)));
clu = n_clu;
num_clusters++;
+ ei++;
if (err)
goto dec_used_clus;
} while (clu != EXFAT_EOF_CLUSTER);
+ printk("e2 dir: %u, s: %u, nc: %u, e: %d\n", p_chain->dir, p_chain->size, num_clusters, ei);
}
dec_used_clus:
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: rcu detected stall in corrupted
rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { P5348 } 2631 jiffies s: 2881 root: 0x0/T
rcu: blocking rcu_node structures (internal RCU debug):
Tested on:
commit: f9ff5644 Merge tag 'hsi-for-6.2' of git://git.kernel.o..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=110d6fb6e80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1bf08f50e8fff9ad
dashboard link: https://syzkaller.appspot.com/bug?extid=2f73ed585f115e98aee8
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=17028ec9e80000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f9ff5644bcc0
diff --git a/fs/exfat/fatent.c b/fs/exfat/fatent.c
index 56b870d9cc0d..2908eb82fe68 100644
--- a/fs/exfat/fatent.c
+++ b/fs/exfat/fatent.c
@@ -149,7 +149,7 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
{
struct super_block *sb = inode->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb);
- int cur_cmap_i, next_cmap_i;
+ int cur_cmap_i, next_cmap_i, ei = 0;
unsigned int num_clusters = 0;
unsigned int clu;
@@ -176,8 +176,11 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
if (p_chain->flags == ALLOC_NO_FAT_CHAIN) {
unsigned int last_cluster = p_chain->dir + p_chain->size - 1;
+ printk("b dir: %u, s: %u, nc: %u\n", p_chain->dir, p_chain->size, num_clusters);
do {
bool sync = false;
+ if (ei > 100)
+ break;
if (clu < last_cluster)
next_cmap_i =
@@ -192,12 +195,17 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
exfat_clear_bitmap(inode, clu, (sync && IS_DIRSYNC(inode)));
clu++;
num_clusters++;
+ ei++;
} while (num_clusters < p_chain->size);
+ printk("e dir: %u, s: %u, nc: %u, e: %d\n", p_chain->dir, p_chain->size, num_clusters, ei);
} else {
+ printk("b2 dir: %u, s: %u, nc: %u\n", p_chain->dir, p_chain->size, num_clusters);
do {
bool sync = false;
unsigned int n_clu = clu;
int err = exfat_get_next_cluster(sb, &n_clu);
+ if (ei > 100)
+ break;
if (err || n_clu == EXFAT_EOF_CLUSTER)
sync = true;
@@ -213,10 +221,12 @@ static int __exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain
exfat_clear_bitmap(inode, clu, (sync && IS_DIRSYNC(inode)));
clu = n_clu;
num_clusters++;
+ ei++;
if (err)
goto dec_used_clus;
} while (clu != EXFAT_EOF_CLUSTER);
+ printk("e2 dir: %u, s: %u, nc: %u, e: %d\n", p_chain->dir, p_chain->size, num_clusters, ei);
}
dec_used_clus:
@@ -229,8 +239,10 @@ int exfat_free_cluster(struct inode *inode, struct exfat_chain *p_chain)
int ret = 0;
mutex_lock(&EXFAT_SB(inode->i_sb)->bitmap_lock);
+ printk("i: %p, %s\n", inode, __func__);
ret = __exfat_free_cluster(inode, p_chain);
mutex_unlock(&EXFAT_SB(inode->i_sb)->bitmap_lock);
+ printk("r: %d, i: %p, %s\n", ret, inode, __func__);
return ret;
}
Hello,
syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: rcu detected stall in corrupted
rcu: INFO: rcu_preempt detected expedited stalls on CPUs/tasks: { P5341 } 2673 jiffies s: 2901 root: 0x0/T
rcu: blocking rcu_node structures (internal RCU debug):
Tested on:
commit: f9ff5644 Merge tag 'hsi-for-6.2' of git://git.kernel.o..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=1555014ee80000
kernel config: https://syzkaller.appspot.com/x/.config?x=1bf08f50e8fff9ad
dashboard link: https://syzkaller.appspot.com/bug?extid=2f73ed585f115e98aee8
compiler: gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
patch: https://syzkaller.appspot.com/x/patch.diff?x=1056bb4ee80000