[syzbot] [f2fs?] INFO: trying to register non-static key in f2fs_exist_written_data

2 views
Skip to first unread message

syzbot

unread,
May 8, 2026, 7:03:25 PM (12 hours ago) May 8
to ch...@kernel.org, jae...@kernel.org, linux-f2...@lists.sourceforge.net, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 9d0d467c3572 Add linux-next specific files for 20260504
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1654656a580000
kernel config: https://syzkaller.appspot.com/x/.config?x=ef1c15606892fce1
dashboard link: https://syzkaller.appspot.com/bug?extid=eec8f2693d71386bd600
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=157331ce580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=161b4a73980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/a19ae01a3069/disk-9d0d467c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/29f12fe616bd/vmlinux-9d0d467c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/eea74c667054/bzImage-9d0d467c.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/45693b275dc4/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=117331ce580000)

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

F2FS-fs (loop0): Image doesn't support compression
F2FS-fs (loop0): invalid crc value
F2FS-fs (loop0): invalid crc value
F2FS-fs (loop0): Failed to get valid F2FS checkpoint
INFO: trying to register non-static key.
The code is fine but needs lockdep annotation, or maybe
you didn't initialize this object before use?
turning off the locking correctness validator.
CPU: 1 UID: 0 PID: 5928 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
assign_lock_key+0x133/0x150 kernel/locking/lockdep.c:986
register_lock_class+0xcc/0x2e0 kernel/locking/lockdep.c:1301
__lock_acquire+0xad/0x2d10 kernel/locking/lockdep.c:5114
lock_acquire+0x106/0x350 kernel/locking/lockdep.c:5870
rt_spin_lock+0x83/0x400 kernel/locking/spinlock_rt.c:56
spin_lock include/linux/spinlock_rt.h:45 [inline]
f2fs_exist_written_data+0x53/0x90 fs/f2fs/checkpoint.c:787
f2fs_drop_inode+0xda/0xbf0 fs/f2fs/super.c:1852
iput_final fs/inode.c:1926 [inline]
iput+0x651/0xe80 fs/inode.c:2009
f2fs_fill_super+0x6047/0x7850 fs/f2fs/super.c:5461
get_tree_bdev_flags+0x431/0x4f0 fs/super.c:1694
vfs_get_tree+0x92/0x2a0 fs/super.c:1754
fc_mount fs/namespace.c:1193 [inline]
do_new_mount_fc fs/namespace.c:3758 [inline]
do_new_mount+0x341/0xd30 fs/namespace.c:3834
do_mount fs/namespace.c:4167 [inline]
__do_sys_mount fs/namespace.c:4383 [inline]
__se_sys_mount+0x31d/0x420 fs/namespace.c:4360
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f39fca4e04a
Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffcfe531b98 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffcfe531c20 RCX: 00007f39fca4e04a
RDX: 0000200000000140 RSI: 00002000000000c0 RDI: 00007ffcfe531be0
RBP: 0000200000000140 R08: 00007ffcfe531c20 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00002000000000c0
R13: 00007ffcfe531be0 R14: 0000000000005553 R15: 00002000000003c0
</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 report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

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.

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

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

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

syzbot

unread,
May 8, 2026, 9:05:25 PM (10 hours ago) May 8
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: [PATCH] f2fs: initialize ino_entry_info before checkpoint load
Author: karti...@gmail.com

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master



When f2fs_get_valid_checkpoint() fails during mount (e.g. due to an
invalid checkpoint CRC on a malformed image), f2fs_fill_super() takes
an error path that eventually calls iput() on the root inode. This
invokes f2fs_drop_inode() -> f2fs_exist_written_data(), which acquires
sbi->im[]->ino_lock. However, f2fs_init_ino_entry_info() has not run
yet at this point, so the spinlock is uninitialized and lockdep
complains:

F2FS-fs (loop0): invalid crc value
F2FS-fs (loop0): Failed to get valid F2FS checkpoint
INFO: trying to register non-static key.
The code is fine but needs lockdep annotation, or maybe
you didn't initialize this object before use?
...
f2fs_exist_written_data+0x53/0x90 fs/f2fs/checkpoint.c:787
f2fs_drop_inode+0xda/0xbf0 fs/f2fs/super.c:1852
iput+0x651/0xe80 fs/inode.c:2009
f2fs_fill_super+0x6047/0x7850 fs/f2fs/super.c:5461

Move f2fs_init_ino_entry_info() to before f2fs_get_valid_checkpoint()
so that sbi->im[] is always fully initialized before any error path
can trigger iput() -> f2fs_drop_inode(). The init function only
depends on raw superblock fields (BLKS_PER_SEG, F2FS_CP_PACKS,
NR_CURSEG_PERSIST_TYPE, __cp_payload), which are populated well
before checkpoint load, so the move is safe.

Reported-by: syzbot+eec8f2...@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=eec8f2693d71386bd600
Signed-off-by: Deepanshu Kartikey <karti...@gmail.com>
---
fs/f2fs/super.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index c6afdbd6e1cd..6a231a5b0d62 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -5140,6 +5140,13 @@ static int f2fs_fill_super(struct super_block *sb, struct fs_context *fc)
goto free_page_array_cache;
}

+ /*
+ * Initialize ino entry info early so f2fs_drop_inode ->
+ * f2fs_exist_written_data can safely take im->ino_lock if mount
+ * fails after this point and triggers iput on cleanup.
+ */
+ f2fs_init_ino_entry_info(sbi);
+
err = f2fs_get_valid_checkpoint(sbi);
if (err) {
f2fs_err(sbi, "Failed to get valid F2FS checkpoint");
@@ -5184,8 +5191,6 @@ static int f2fs_fill_super(struct super_block *sb, struct fs_context *fc)

f2fs_init_extent_cache_info(sbi);

- f2fs_init_ino_entry_info(sbi);
-
f2fs_init_fsync_node_info(sbi);

/* setup checkpoint request control and start checkpoint issue thread */
--
2.43.0

syzbot

unread,
May 8, 2026, 9:07:12 PM (10 hours ago) May 8
to linux-...@vger.kernel.org, syzkall...@googlegroups.com
For archival purposes, forwarding an incoming command email to
linux-...@vger.kernel.org, syzkall...@googlegroups.com.

***

Subject: [PATCH] f2fs: initialize ino_entry_info before checkpoint load
Author: karti...@gmail.com

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master


When f2fs_get_valid_checkpoint() fails during mount (e.g. due to an
invalid checkpoint CRC on a malformed image), f2fs_fill_super() takes
an error path that eventually calls iput() on the root inode. This
invokes f2fs_drop_inode() -> f2fs_exist_written_data(), which acquires
sbi->im[]->ino_lock. However, f2fs_init_ino_entry_info() has not run
yet at this point, so the spinlock is uninitialized and lockdep
complains:

F2FS-fs (loop0): invalid crc value
F2FS-fs (loop0): Failed to get valid F2FS checkpoint
INFO: trying to register non-static key.
The code is fine but needs lockdep annotation, or maybe
you didn't initialize this object before use?
...
f2fs_exist_written_data+0x53/0x90 fs/f2fs/checkpoint.c:787
f2fs_drop_inode+0xda/0xbf0 fs/f2fs/super.c:1852
iput+0x651/0xe80 fs/inode.c:2009
f2fs_fill_super+0x6047/0x7850 fs/f2fs/super.c:5461

syzbot

unread,
May 8, 2026, 10:33:03 PM (9 hours ago) May 8
to karti...@gmail.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+eec8f2...@syzkaller.appspotmail.com
Tested-by: syzbot+eec8f2...@syzkaller.appspotmail.com

Tested on:

commit: e98d21c1 Add linux-next specific files for 20260508
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=177f83ce580000
kernel config: https://syzkaller.appspot.com/x/.config?x=76d40e8423bfbf00
dashboard link: https://syzkaller.appspot.com/bug?extid=eec8f2693d71386bd600
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=126b2a73980000

Note: testing is done by a robot and is best-effort only.

syzbot

unread,
May 8, 2026, 10:45:03 PM (9 hours ago) May 8
to karti...@gmail.com, linux-...@vger.kernel.org, syzkall...@googlegroups.com
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+eec8f2...@syzkaller.appspotmail.com
Tested-by: syzbot+eec8f2...@syzkaller.appspotmail.com

Tested on:

commit: e98d21c1 Add linux-next specific files for 20260508
git tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=155571ce580000
kernel config: https://syzkaller.appspot.com/x/.config?x=76d40e8423bfbf00
dashboard link: https://syzkaller.appspot.com/bug?extid=eec8f2693d71386bd600
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
patch: https://syzkaller.appspot.com/x/patch.diff?x=11f783ce580000
Reply all
Reply to author
Forward
0 new messages