[syzbot] [f2fs?] possible deadlock in f2fs_release_file

9 views
Skip to first unread message

syzbot

unread,
May 1, 2023, 1:07:00ā€ÆPM5/1/23
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 58390c8ce1bd Merge tag 'iommu-updates-v6.4' of git://git.k..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=17fc7ef7c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=5eadbf0d3c2ece89
dashboard link: https://syzkaller.appspot.com/bug?extid=e5b81eaab292e00e7d98
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/60130779f509/disk-58390c8c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/d7f0cdd29b71/vmlinux-58390c8c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/de415ad52ae4/bzImage-58390c8c.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e5b81e...@syzkaller.appspotmail.com

syz-executor.0: attempt to access beyond end of device
loop0: rw=2049, sector=77824, nr_sectors = 2048 limit=63271
syz-executor.0: attempt to access beyond end of device
loop0: rw=2049, sector=79872, nr_sectors = 2048 limit=63271
======================================================
WARNING: possible circular locking dependency detected
6.3.0-syzkaller-12049-g58390c8ce1bd #0 Not tainted
------------------------------------------------------
syz-executor.0/7526 is trying to acquire lock:
ffff8880366c9bd8 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:775 [inline]
ffff8880366c9bd8 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}, at: f2fs_release_file+0x9b/0x100 fs/f2fs/file.c:1866

but task is already holding lock:
ffff888037e0c448 (&sbi->node_write){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2087 [inline]
ffff888037e0c448 (&sbi->node_write){++++}-{3:3}, at: f2fs_write_single_data_page+0xa10/0x1d50 fs/f2fs/data.c:2842

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&sbi->node_write){++++}-{3:3}:
reacquire_held_locks+0x3aa/0x660 kernel/locking/lockdep.c:5216
__lock_release kernel/locking/lockdep.c:5405 [inline]
lock_release+0x36f/0x9d0 kernel/locking/lockdep.c:5711
up_write+0x79/0x580 kernel/locking/rwsem.c:1625
f2fs_write_checkpoint+0x13a4/0x1f90 fs/f2fs/checkpoint.c:1651
__write_checkpoint_sync fs/f2fs/checkpoint.c:1768 [inline]
__checkpoint_and_complete_reqs+0xda/0x3b0 fs/f2fs/checkpoint.c:1787
issue_checkpoint_thread+0xda/0x260 fs/f2fs/checkpoint.c:1818
kthread+0x2b8/0x350 kernel/kthread.c:379
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

-> #1 (&sbi->cp_rwsem){++++}-{3:3}:
lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5691
down_read+0x3d/0x50 kernel/locking/rwsem.c:1520
f2fs_down_read fs/f2fs/f2fs.h:2087 [inline]
f2fs_lock_op fs/f2fs/f2fs.h:2130 [inline]
f2fs_convert_inline_inode+0x578/0x800 fs/f2fs/inline.c:218
f2fs_setattr+0xb0c/0x1270 fs/f2fs/file.c:995
notify_change+0xc8b/0xf40 fs/attr.c:483
do_truncate+0x220/0x300 fs/open.c:66
do_sys_ftruncate+0x2e4/0x380 fs/open.c:194
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&sb->s_type->i_mutex_key#29){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3108 [inline]
check_prevs_add kernel/locking/lockdep.c:3227 [inline]
validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3842
__lock_acquire+0x1295/0x2000 kernel/locking/lockdep.c:5074
lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5691
down_write+0x3a/0x50 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:775 [inline]
f2fs_release_file+0x9b/0x100 fs/f2fs/file.c:1866
__fput+0x3b7/0x890 fs/file_table.c:321
task_work_run+0x24a/0x300 kernel/task_work.c:179
get_signal+0x1606/0x17e0 kernel/signal.c:2650
arch_do_signal_or_restart+0x91/0x670 arch/x86/kernel/signal.c:306
exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:297
do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

Chain exists of:
&sb->s_type->i_mutex_key#29 --> &sbi->cp_rwsem --> &sbi->node_write

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
rlock(&sbi->node_write);
lock(&sbi->cp_rwsem);
lock(&sbi->node_write);
lock(&sb->s_type->i_mutex_key#29);

*** DEADLOCK ***

1 lock held by syz-executor.0/7526:
#0: ffff888037e0c448 (&sbi->node_write){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2087 [inline]
#0: ffff888037e0c448 (&sbi->node_write){++++}-{3:3}, at: f2fs_write_single_data_page+0xa10/0x1d50 fs/f2fs/data.c:2842

stack backtrace:
CPU: 1 PID: 7526 Comm: syz-executor.0 Not tainted 6.3.0-syzkaller-12049-g58390c8ce1bd #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
check_noncircular+0x2fe/0x3b0 kernel/locking/lockdep.c:2188
check_prev_add kernel/locking/lockdep.c:3108 [inline]
check_prevs_add kernel/locking/lockdep.c:3227 [inline]
validate_chain+0x166b/0x58e0 kernel/locking/lockdep.c:3842
__lock_acquire+0x1295/0x2000 kernel/locking/lockdep.c:5074
lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5691
down_write+0x3a/0x50 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:775 [inline]
f2fs_release_file+0x9b/0x100 fs/f2fs/file.c:1866
__fput+0x3b7/0x890 fs/file_table.c:321
task_work_run+0x24a/0x300 kernel/task_work.c:179
get_signal+0x1606/0x17e0 kernel/signal.c:2650
arch_do_signal_or_restart+0x91/0x670 arch/x86/kernel/signal.c:306
exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x64/0x280 kernel/entry/common.c:297
do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f9fbc28c169
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f9fbd007168 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: fffffffffffffffb RBX: 00007f9fbc3abf80 RCX: 00007f9fbc28c169
RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000005
RBP: 00007f9fbc2e7ca1 R08: 0000000000000000 R09: 0000000000000003
R10: 0000000000001400 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc6d012c3f R14: 00007f9fbd007300 R15: 0000000000022000
</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 syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Jun 15, 2023, 4:39:09ā€ÆAM6/15/23
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: b6dad5178cea Merge tag 'nios2_fix_v6.4' of git://git.kerne..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=12510203280000
kernel config: https://syzkaller.appspot.com/x/.config?x=5bcee04c3b2a8237
dashboard link: https://syzkaller.appspot.com/bug?extid=e5b81eaab292e00e7d98
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10db66f7280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14577753280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/0ae77e66553b/disk-b6dad517.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5b2da4d23e74/vmlinux-b6dad517.xz
kernel image: https://storage.googleapis.com/syzbot-assets/23130b8e7a8a/bzImage-b6dad517.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/70b8358ae62a/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e5b81e...@syzkaller.appspotmail.com

loop4: rw=2049, sector=77824, nr_sectors = 3048 limit=63271
syz-executor110: attempt to access beyond end of device
loop4: rw=2049, sector=80872, nr_sectors = 1048 limit=63271
======================================================
WARNING: possible circular locking dependency detected
6.4.0-rc6-syzkaller-00037-gb6dad5178cea #0 Not tainted
------------------------------------------------------
syz-executor110/5218 is trying to acquire lock:
ffff88806676b660 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:775 [inline]
ffff88806676b660 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}, at: f2fs_release_file fs/f2fs/file.c:1866 [inline]
ffff88806676b660 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}, at: f2fs_release_file+0xca/0x100 fs/f2fs/file.c:1856

but task is already holding lock:
ffff88802100c448 (&sbi->node_write){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2087 [inline]
ffff88802100c448 (&sbi->node_write){++++}-{3:3}, at: f2fs_write_single_data_page+0x166e/0x19d0 fs/f2fs/data.c:2842

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&sbi->node_write){++++}-{3:3}:
__lock_release kernel/locking/lockdep.c:5419 [inline]
lock_release+0x33c/0x670 kernel/locking/lockdep.c:5725
up_write+0x2a/0x520 kernel/locking/rwsem.c:1625
f2fs_up_write fs/f2fs/f2fs.h:2122 [inline]
block_operations+0xca4/0xe80 fs/f2fs/checkpoint.c:1288
f2fs_write_checkpoint+0x5fa/0x4b40 fs/f2fs/checkpoint.c:1651
__write_checkpoint_sync fs/f2fs/checkpoint.c:1768 [inline]
__checkpoint_and_complete_reqs+0xea/0x350 fs/f2fs/checkpoint.c:1787
issue_checkpoint_thread+0xe3/0x250 fs/f2fs/checkpoint.c:1818
kthread+0x344/0x440 kernel/kthread.c:379
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308

-> #1 (&sbi->cp_rwsem){++++}-{3:3}:
down_read+0x9c/0x480 kernel/locking/rwsem.c:1520
f2fs_down_read fs/f2fs/f2fs.h:2087 [inline]
f2fs_lock_op fs/f2fs/f2fs.h:2130 [inline]
f2fs_convert_inline_inode+0x47b/0x8e0 fs/f2fs/inline.c:218
f2fs_preallocate_blocks fs/f2fs/file.c:4480 [inline]
f2fs_file_write_iter+0x1a1f/0x24d0 fs/f2fs/file.c:4712
call_write_iter include/linux/fs.h:1868 [inline]
do_iter_readv_writev+0x20b/0x3b0 fs/read_write.c:735
do_iter_write+0x185/0x7e0 fs/read_write.c:860
vfs_writev+0x1aa/0x670 fs/read_write.c:933
do_pwritev+0x1b6/0x270 fs/read_write.c:1030
__do_sys_pwritev2 fs/read_write.c:1089 [inline]
__se_sys_pwritev2 fs/read_write.c:1080 [inline]
__x64_sys_pwritev2+0xef/0x150 fs/read_write.c:1080
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd

-> #0 (&sb->s_type->i_mutex_key#17){+.+.}-{3:3}:
check_prev_add kernel/locking/lockdep.c:3113 [inline]
check_prevs_add kernel/locking/lockdep.c:3232 [inline]
validate_chain kernel/locking/lockdep.c:3847 [inline]
__lock_acquire+0x2fcd/0x5f30 kernel/locking/lockdep.c:5088
lock_acquire kernel/locking/lockdep.c:5705 [inline]
lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670
down_write+0x92/0x200 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:775 [inline]
f2fs_release_file fs/f2fs/file.c:1866 [inline]
f2fs_release_file+0xca/0x100 fs/f2fs/file.c:1856
__fput+0x27c/0xa90 fs/file_table.c:321
task_work_run+0x16f/0x270 kernel/task_work.c:179
get_signal+0x1c7/0x25b0 kernel/signal.c:2652
arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306
exit_to_user_mode_loop kernel/entry/common.c:168 [inline]
exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297
do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd

other info that might help us debug this:

Chain exists of:
&sb->s_type->i_mutex_key#17 --> &sbi->cp_rwsem --> &sbi->node_write

Possible unsafe locking scenario:

CPU0 CPU1
---- ----
rlock(&sbi->node_write);
lock(&sbi->cp_rwsem);
lock(&sbi->node_write);
lock(&sb->s_type->i_mutex_key#17);

*** DEADLOCK ***

1 lock held by syz-executor110/5218:
#0: ffff88802100c448 (&sbi->node_write){++++}-{3:3}, at: f2fs_down_read fs/f2fs/f2fs.h:2087 [inline]
#0: ffff88802100c448 (&sbi->node_write){++++}-{3:3}, at: f2fs_write_single_data_page+0x166e/0x19d0 fs/f2fs/data.c:2842

stack backtrace:
CPU: 1 PID: 5218 Comm: syz-executor110 Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
check_noncircular+0x25f/0x2e0 kernel/locking/lockdep.c:2188
check_prev_add kernel/locking/lockdep.c:3113 [inline]
check_prevs_add kernel/locking/lockdep.c:3232 [inline]
validate_chain kernel/locking/lockdep.c:3847 [inline]
__lock_acquire+0x2fcd/0x5f30 kernel/locking/lockdep.c:5088
lock_acquire kernel/locking/lockdep.c:5705 [inline]
lock_acquire+0x1b1/0x520 kernel/locking/lockdep.c:5670
down_write+0x92/0x200 kernel/locking/rwsem.c:1573
inode_lock include/linux/fs.h:775 [inline]
f2fs_release_file fs/f2fs/file.c:1866 [inline]
f2fs_release_file+0xca/0x100 fs/f2fs/file.c:1856
__fput+0x27c/0xa90 fs/file_table.c:321
task_work_run+0x16f/0x270 kernel/task_work.c:179
get_signal+0x1c7/0x25b0 kernel/signal.c:2652
arch_do_signal_or_restart+0x79/0x5c0 arch/x86/kernel/signal.c:306
exit_to_user_mode_loop kernel/entry/common.c:168 [inline]
exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297
do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f6b9a0179b9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 a1 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6b99fc32f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000148
RAX: fffffffffffffffb RBX: 00007f6b9a0a47a8 RCX: 00007f6b9a0179b9
RDX: 0000000000000001 RSI: 0000000020000240 RDI: 0000000000000004
RBP: 00007f6b9a0a47a0 R08: 0000000000000000 R09: 0000000000000003
R10: 0000000000001400 R11: 0000000000000246 R12: 00007f6b9a0a47ac
R13: 00007f6b9a071008 R14: 6f6f6c2f7665642f R15: 0000000000022000
</TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

Hillf Danton

unread,
Jun 17, 2023, 9:47:07ā€ÆAM6/17/23
to syzbot, linux-...@vger.kernel.org, syzkall...@googlegroups.com
On 15 Jun 2023 01:39:08 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: b6dad5178cea Merge tag 'nios2_fix_v6.4' of git://git.kerne..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=14577753280000

Pair lock with unlock.

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b6dad5178cea

--- x/fs/f2fs/data.c
+++ y/fs/f2fs/data.c
@@ -2833,18 +2833,21 @@ write:

/* Dentry/quota blocks are controlled by checkpoint */
if (S_ISDIR(inode->i_mode) || IS_NOQUOTA(inode)) {
+ int locked = 0;
/*
* We need to wait for node_write to avoid block allocation during
* checkpoint. This can only happen to quota writes which can cause
* the below discard race condition.
*/
- if (IS_NOQUOTA(inode))
+ if (IS_NOQUOTA(inode)) {
+ locked = 1;
f2fs_down_read(&sbi->node_write);
+ }

fio.need_lock = LOCK_DONE;
err = f2fs_do_write_data_page(&fio);

- if (IS_NOQUOTA(inode))
+ if (locked)
f2fs_up_read(&sbi->node_write);

goto done;
--

syzbot

unread,
Jun 17, 2023, 11:48:23ā€ÆAM6/17/23
to hda...@sina.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
INFO: task hung in user_get_super

INFO: task syz-executor272:7088 blocked for more than 143 seconds.
Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea-dirty #0
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:syz-executor272 state:D stack:29016 pid:7088 ppid:7046 flags:0x00000004
Call Trace:
<TASK>
context_switch kernel/sched/core.c:5343 [inline]
__schedule+0xc9a/0x5880 kernel/sched/core.c:6669
schedule+0xde/0x1a0 kernel/sched/core.c:6745
schedule_preempt_disabled+0x13/0x20 kernel/sched/core.c:6804
rwsem_down_write_slowpath+0x3e2/0x1220 kernel/locking/rwsem.c:1178
__down_write_common kernel/locking/rwsem.c:1306 [inline]
__down_write kernel/locking/rwsem.c:1315 [inline]
down_write+0x1d2/0x200 kernel/locking/rwsem.c:1574
user_get_super+0x230/0x310 fs/super.c:875
quotactl_block+0x26d/0x410 fs/quota/quota.c:890
__do_sys_quotactl fs/quota/quota.c:954 [inline]
__se_sys_quotactl fs/quota/quota.c:916 [inline]
__x64_sys_quotactl+0x32b/0x410 fs/quota/quota.c:916
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fb71dc27649
RSP: 002b:00007fb717697318 EFLAGS: 00000246 ORIG_RAX: 00000000000000b3
RAX: ffffffffffffffda RBX: 00007fb71dcb47b8 RCX: 00007fb71dc27649
RDX: 0000000000000000 RSI: 0000000020000080 RDI: ffffffff80000202
RBP: 00007fb71dcb47b0 R08: 00007fb717697700 R09: 0000000000000000
R10: 0000000020008040 R11: 0000000000000246 R12: 6f6f6c2f7665642f
R13: 00007ffe21a598bf R14: 00007fb717697400 R15: 0000000000022000
</TASK>

Showing all locks held in the system:
4 locks held by kworker/u4:0/10:
#0: ffff8880b993c5d8 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2f/0x120 kernel/sched/core.c:558
#1: ffff8880b9928848 (&per_cpu_ptr(group->pcpu, cpu)->seq){-.-.}-{0:0}, at: psi_task_switch+0x2de/0x950 kernel/sched/psi.c:996
#2: ffff888029ae4d40 (&wdev->mtx){+.+.}-{3:3}, at: sdata_lock net/mac80211/ieee80211_i.h:1129 [inline]
#2: ffff888029ae4d40 (&wdev->mtx){+.+.}-{3:3}, at: ieee80211_ibss_work+0x94/0x14a0 net/mac80211/ibss.c:1680
#3: ffffffff8c7990c0 (rcu_read_lock){....}-{1:2}, at: sdata_assert_lock net/mac80211/ieee80211_i.h:1146 [inline]
#3: ffffffff8c7990c0 (rcu_read_lock){....}-{1:2}, at: ieee80211_sta_active_ibss+0x86/0x390 net/mac80211/ibss.c:652
1 lock held by rcu_tasks_kthre/13:
#0: ffffffff8c7984b0 (rcu_tasks.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x31/0xd80 kernel/rcu/tasks.h:518
1 lock held by rcu_tasks_trace/14:
#0: ffffffff8c7981b0 (rcu_tasks_trace.tasks_gp_mutex){+.+.}-{3:3}, at: rcu_tasks_one_gp+0x31/0xd80 kernel/rcu/tasks.h:518
1 lock held by khungtaskd/27:
#0: ffffffff8c7990c0 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x55/0x340 kernel/locking/lockdep.c:6559
5 locks held by kworker/u4:2/40:
2 locks held by kworker/u4:5/2832:
#0: ffff8880b993c5d8 (&rq->__lock){-.-.}-{2:2}, at: raw_spin_rq_lock_nested+0x2f/0x120 kernel/sched/core.c:558
#1: ffff8880b9928848 (&per_cpu_ptr(group->pcpu, cpu)->seq){-.-.}-{0:0}, at: psi_task_switch+0x2de/0x950 kernel/sched/psi.c:996
2 locks held by getty/4753:
#0: ffff88802ce02098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x26/0x80 drivers/tty/tty_ldisc.c:243
#1: ffffc900015a02f0 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0xef4/0x13e0 drivers/tty/n_tty.c:2176
4 locks held by syz-executor.3/5377:
#0: ffff88807dae80e0 (&type->s_umount_key#50){+.+.}-{3:3}, at: deactivate_super+0xa9/0xd0 fs/super.c:361
#1: ffff888023ae4318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#1: ffff888023ae4318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_write_checkpoint+0x4a6/0x4b40 fs/f2fs/checkpoint.c:1638
#2: ffff888023ae43b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#2: ffff888023ae43b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_lock_all fs/f2fs/f2fs.h:2147 [inline]
#2: ffff888023ae43b0 (&sbi->cp_rwsem){++++}-{3:3}, at: block_operations+0x10d/0xe80 fs/f2fs/checkpoint.c:1219
#3: ffff888023ae4448 (&sbi->node_write){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#3: ffff888023ae4448 (&sbi->node_write){++++}-{3:3}, at: block_operations+0x8fe/0xe80 fs/f2fs/checkpoint.c:1267
4 locks held by syz-executor272/7043:
#0: ffff888065c100e0 (&type->s_umount_key#50){+.+.}-{3:3}, at: deactivate_super+0xa9/0xd0 fs/super.c:361
#1: ffff888049488318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#1: ffff888049488318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_write_checkpoint+0x4a6/0x4b40 fs/f2fs/checkpoint.c:1638
#2: ffff8880494883b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#2: ffff8880494883b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_lock_all fs/f2fs/f2fs.h:2147 [inline]
#2: ffff8880494883b0 (&sbi->cp_rwsem){++++}-{3:3}, at: block_operations+0x10d/0xe80 fs/f2fs/checkpoint.c:1219
#3: ffff888049488448 (&sbi->node_write){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#3: ffff888049488448 (&sbi->node_write){++++}-{3:3}, at: block_operations+0x8fe/0xe80 fs/f2fs/checkpoint.c:1267
4 locks held by syz-executor272/7044:
#0: ffff888032a700e0 (&type->s_umount_key#50){+.+.}-{3:3}, at: deactivate_super+0xa9/0xd0 fs/super.c:361
#1: ffff888017ad4318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#1: ffff888017ad4318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_write_checkpoint+0x4a6/0x4b40 fs/f2fs/checkpoint.c:1638
#2: ffff888017ad43b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#2: ffff888017ad43b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_lock_all fs/f2fs/f2fs.h:2147 [inline]
#2: ffff888017ad43b0 (&sbi->cp_rwsem){++++}-{3:3}, at: block_operations+0x10d/0xe80 fs/f2fs/checkpoint.c:1219
#3: ffff888017ad4448 (&sbi->node_write){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#3: ffff888017ad4448 (&sbi->node_write){++++}-{3:3}, at: block_operations+0x8fe/0xe80 fs/f2fs/checkpoint.c:1267
4 locks held by syz-executor272/7045:
#0: ffff88806a81e0e0 (&type->s_umount_key#50){+.+.}-{3:3}, at: deactivate_super+0xa9/0xd0 fs/super.c:361
#1: ffff8880762a8318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#1: ffff8880762a8318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_write_checkpoint+0x4a6/0x4b40 fs/f2fs/checkpoint.c:1638
#2: ffff8880762a83b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#2: ffff8880762a83b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_lock_all fs/f2fs/f2fs.h:2147 [inline]
#2: ffff8880762a83b0 (&sbi->cp_rwsem){++++}-{3:3}, at: block_operations+0x10d/0xe80 fs/f2fs/checkpoint.c:1219
#3: ffff8880762a8448 (&sbi->node_write){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#3: ffff8880762a8448 (&sbi->node_write){++++}-{3:3}, at: block_operations+0x8fe/0xe80 fs/f2fs/checkpoint.c:1267
4 locks held by syz-executor272/7047:
#0: ffff88807d2ec0e0 (&type->s_umount_key#50){+.+.}-{3:3}, at: deactivate_super+0xa9/0xd0 fs/super.c:361
#1: ffff88807fa84318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#1: ffff88807fa84318 (&sbi->cp_global_sem){+.+.}-{3:3}, at: f2fs_write_checkpoint+0x4a6/0x4b40 fs/f2fs/checkpoint.c:1638
#2: ffff88807fa843b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#2: ffff88807fa843b0 (&sbi->cp_rwsem){++++}-{3:3}, at: f2fs_lock_all fs/f2fs/f2fs.h:2147 [inline]
#2: ffff88807fa843b0 (&sbi->cp_rwsem){++++}-{3:3}, at: block_operations+0x10d/0xe80 fs/f2fs/checkpoint.c:1219
#3: ffff88807fa84448 (&sbi->node_write){++++}-{3:3}, at: f2fs_down_write fs/f2fs/f2fs.h:2112 [inline]
#3: ffff88807fa84448 (&sbi->node_write){++++}-{3:3}, at: block_operations+0x8fe/0xe80 fs/f2fs/checkpoint.c:1267
1 lock held by syz-executor272/7048:
#0: ffff8880763cc0e0 (&type->s_umount_key#50){+.+.}-{3:3}, at: deactivate_super+0xa9/0xd0 fs/super.c:361
1 lock held by syz-executor272/7088:
#0: ffff88807dae80e0 (&type->s_umount_key#50){+.+.}-{3:3}, at: user_get_super+0x230/0x310 fs/super.c:875

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

NMI backtrace for cpu 0
CPU: 0 PID: 27 Comm: khungtaskd Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x150 lib/dump_stack.c:106
nmi_cpu_backtrace+0x29c/0x350 lib/nmi_backtrace.c:113
nmi_trigger_cpumask_backtrace+0x2a4/0x300 lib/nmi_backtrace.c:62
trigger_all_cpu_backtrace include/linux/nmi.h:148 [inline]
check_hung_uninterruptible_tasks kernel/hung_task.c:222 [inline]
watchdog+0xe16/0x1090 kernel/hung_task.c:379
kthread+0x344/0x440 kernel/kthread.c:379
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: 2832 Comm: kworker/u4:5 Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Workqueue: bat_events batadv_nc_worker
RIP: 0010:preempt_count_sub+0x2b/0x150 kernel/sched/core.c:5839
Code: 0f 1e fa 48 c7 c0 00 84 df 91 53 89 fb 48 ba 00 00 00 00 00 fc ff df 48 89 c1 83 e0 07 48 c1 e9 03 83 c0 03 0f b6 14 11 38 d0 <7c> 08 84 d2 0f 85 e4 00 00 00 8b 0d 55 57 87 10 85 c9 75 1b 65 8b
RSP: 0018:ffffc9000b01fbf8 EFLAGS: 00000097
RAX: 0000000000000003 RBX: 0000000000000001 RCX: 1ffffffff23bf080
RDX: 0000000000000004 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffffffff89db728c R08: 0000000000000000 R09: ffffffff8e7a8957
R10: fffffbfff1cf512a R11: 0000000000000000 R12: ffff8880223017a8
R13: ffff888022300c80 R14: dffffc0000000000 R15: ffffffff89db7480
FS: 0000000000000000(0000) GS:ffff8880b9900000(0000) knlGS:00000000000000


Tested on:

commit: b6dad517 Merge tag 'nios2_fix_v6.4' of git://git.kerne..
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=14ef9b7f280000
kernel config: https://syzkaller.appspot.com/x/.config?x=ac246111fb601aec
dashboard link: https://syzkaller.appspot.com/bug?extid=e5b81eaab292e00e7d98
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=1339a97f280000

syzbot

unread,
Sep 29, 2023, 10:42:31ā€ÆPM9/29/23
to ch...@kernel.org, hda...@sina.com, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 5079e1c0c879311668b77075de3e701869804adf
Author: Chao Yu <ch...@kernel.org>
Date: Fri Jun 2 08:36:05 2023 +0000

f2fs: avoid dead loop in f2fs_issue_checkpoint()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=15f18a92680000
start commit: b6dad5178cea Merge tag 'nios2_fix_v6.4' of git://git.kerne..
git tree: upstream
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13c50e17280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15a9558b280000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: f2fs: avoid dead loop in f2fs_issue_checkpoint()

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Nov 1, 2023, 2:27:21ā€ÆPM11/1/23
to syzkall...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages