mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [syzbot] [f2fs?] kernel BUG in f2fs_put_super (6)
@ 2026-11-29  7:03 syzbot
  2026-11-30  3:37 ` syzbot
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2026-11-29  7:03 UTC (permalink / raw)
  To: chao, jaegeuk, linux-f2fs-devel, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    7cd8495c0f16 Merge tag 'io_uring-7.4-20261127' of git://gi..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15291b4d580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=ecf66ac0f0885fc5
dashboard link: https://syzkaller.appspot.com/bug?extid=467d56faa7809a907f05
compiler:       Debian clang version 22.1.8 (1~deb13u5), Debian LLD 22.1.8

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/6882ee450f0f/disk-7cd8495c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/2522d0f617b0/vmlinux-7cd8495c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/d7bf9f20704c/bzImage-7cd8495c.xz

The issue was bisected by AI to:

commit 2c8a4a28233482ad697db92d86da10fcb498eaf7
Author: Jaegeuk Kim <jaegeuk@kernel.org>
Date:   Tue Nov 14 01:46:38 2017 +0000

    f2fs: expose quota information in debugfs

reasoning:      https://syzkaller.appspot.com/ai_job?id=afdc04f1-1f8f-4df0-b173-64508745fa2f

AI-generated root cause summary:
In f2fs, sbi->nr_caches[F2FS_DIRTY_QDATA] is incremented in
inode_inc_dirty_pages() and decremented in inode_dec_dirty_pages() conditionally
on IS_NOQUOTA(inode) (S_NOQUOTA), which assumes S_NOQUOTA cannot change while an
inode has dirty folios. However, f2fs_quota_on() flushes dirty pages via
filemap_fdatawrite()/filemap_fdatawait() without holding inode_lock,
filemap_invalidate_lock, or denying concurrent writes/mmap faults before
dquot_quota_on() -> vfs_setup_quota_inode() sets S_NOQUOTA on the inode. A folio
dirtied during that window increments F2FS_DIRTY_DATA without incrementing
F2FS_DIRTY_QDATA, and when subsequently written back or invalidated (including
by sync_filesystem() inside dquot_load_quota_sb()) after S_NOQUOTA is set,
inode_dec_dirty_pages() decrements both F2FS_DIRTY_DATA and F2FS_DIRTY_QDATA,
driving F2FS_DIRTY_QDATA to -1 and triggering f2fs_bug_on(sbi, 1) in
f2fs_put_super().

full analysis:  https://syzkaller.appspot.com/x/ai_root_cause?x=467d56faa7809a907f05

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

The bisection result may be wrong.
If you agree with it, please also add:
Fixes: 2c8a4a282334 ("f2fs: expose quota information in debugfs")

F2FS-fs (loop2): detect filesystem reference count leak during umount, type: 2, count: -1, err: -5, cp_err: 1
------------[ cut here ]------------
kernel BUG at fs/f2fs/super.c:2084!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 1 UID: 0 PID: 9855 Comm: syz-executor Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:f2fs_put_super+0x145a/0x1460 fs/f2fs/super.c:2084
Code: c1 e8 03 83 e0 01 48 8b 7c 24 18 31 f6 48 c7 c2 20 54 df 8b 44 89 f9 4d 89 f0 44 8b 4c 24 28 50 e8 fb 21 fd ff 48 83 c4 08 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc900060df8c0 EFLAGS: 00010296
RAX: fdbdcb890ea42100 RBX: dffffc0000000000 RCX: fdbdcb890ea42100
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900060dfb38 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffff52000c1bea1 R12: ffff88802a8b8084
R13: ffff88802a8b8087 R14: ffffffffffffffff R15: 0000000000000002
FS:  00005555614a9500(0000) GS:ffff8881247f8000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f146c9d7000 CR3: 000000003c794000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 generic_shutdown_super+0x140/0x2d0 fs/super.c:723
 kill_block_super+0x44/0xa0 fs/super.c:1852
 kill_f2fs_super+0x3b5/0x700 fs/f2fs/super.c:5788
 deactivate_locked_super+0xbe/0x110 fs/super.c:558
 cleanup_mnt+0x204/0x2a0 fs/namespace.c:1396
 task_work_run+0x1d9/0x260 kernel/task_work.c:233
 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
 __exit_to_user_mode_loop kernel/entry/common.c:70 [inline]
 exit_to_user_mode_loop+0x204/0x770 kernel/entry/common.c:101
 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
 syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:343 [inline]
 do_syscall_64+0x336/0x540 arch/x86/entry/syscall_64.c:107
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8ead2aadc7
Code: a2 c7 05 2c 69 25 00 00 00 00 00 eb 96 e8 b1 13 00 00 90 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffd4e9e6048 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f8ead33955b RCX: 00007f8ead2aadc7
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffd4e9e6100
RBP: 00007ffd4e9e6100 R08: 00007ffd4e9e7100 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffd4e9e7190
R13: 00007f8ead33955b R14: 0000000000079cba R15: 00007ffd4e9e71d0
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:f2fs_put_super+0x145a/0x1460 fs/f2fs/super.c:2084
Code: c1 e8 03 83 e0 01 48 8b 7c 24 18 31 f6 48 c7 c2 20 54 df 8b 44 89 f9 4d 89 f0 44 8b 4c 24 28 50 e8 fb 21 fd ff 48 83 c4 08 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc900060df8c0 EFLAGS: 00010296
RAX: fdbdcb890ea42100 RBX: dffffc0000000000 RCX: fdbdcb890ea42100
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc900060dfb38 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffff52000c1bea1 R12: ffff88802a8b8084
R13: ffff88802a8b8087 R14: ffffffffffffffff R15: 0000000000000002
FS:  00005555614a9500(0000) GS:ffff8881247f8000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f146c9d7000 CR3: 000000003c794000 CR4: 00000000003526f0


---
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 syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#ai-bisection

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [syzbot] [f2fs?] kernel BUG in f2fs_put_super (6)
  2026-11-29  7:03 [syzbot] [f2fs?] kernel BUG in f2fs_put_super (6) syzbot
@ 2026-11-30  3:37 ` syzbot
  0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2026-11-30  3:37 UTC (permalink / raw)
  To: chao, jaegeuk, linux-f2fs-devel, linux-kernel, syzkaller-bugs

syzbot has found a reproducer for the following issue on:

HEAD commit:    4f069ab1ec24 Merge tag 'scsi-fixes' of git://git.kernel.or..
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1141707e580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=fc1834b4a2e3ba54
dashboard link: https://syzkaller.appspot.com/bug?extid=467d56faa7809a907f05
compiler:       Debian clang version 22.1.8 (1~deb13u5), Debian LLD 22.1.8
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13f858cd580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17f858cd580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/66ff8e791620/disk-4f069ab1.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/35a2aede79e4/vmlinux-4f069ab1.xz
kernel image: https://storage.googleapis.com/syzbot-assets/408f236d215b/bzImage-4f069ab1.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/d914a2a47804/mount_0.gz
  fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=11f858cd580000)

The issue was bisected by AI to:

commit 2c8a4a28233482ad697db92d86da10fcb498eaf7
Author: Jaegeuk Kim <jaegeuk@kernel.org>
Date:   Tue Nov 14 01:46:38 2017 +0000

    f2fs: expose quota information in debugfs

reasoning:      https://syzkaller.appspot.com/ai_job?id=afdc04f1-1f8f-4df0-b173-64508745fa2f

AI-generated root cause summary:
In f2fs, sbi->nr_caches[F2FS_DIRTY_QDATA] is incremented in
inode_inc_dirty_pages() and decremented in inode_dec_dirty_pages() conditionally
on IS_NOQUOTA(inode) (S_NOQUOTA), which assumes S_NOQUOTA cannot change while an
inode has dirty folios. However, f2fs_quota_on() flushes dirty pages via
filemap_fdatawrite()/filemap_fdatawait() without holding inode_lock,
filemap_invalidate_lock, or denying concurrent writes/mmap faults before
dquot_quota_on() -> vfs_setup_quota_inode() sets S_NOQUOTA on the inode. A folio
dirtied during that window increments F2FS_DIRTY_DATA without incrementing
F2FS_DIRTY_QDATA, and when subsequently written back or invalidated (including
by sync_filesystem() inside dquot_load_quota_sb()) after S_NOQUOTA is set,
inode_dec_dirty_pages() decrements both F2FS_DIRTY_DATA and F2FS_DIRTY_QDATA,
driving F2FS_DIRTY_QDATA to -1 and triggering f2fs_bug_on(sbi, 1) in
f2fs_put_super().

full analysis:  https://syzkaller.appspot.com/x/ai_root_cause?x=467d56faa7809a907f05

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

The bisection result may be wrong.
If you agree with it, please also add:
Fixes: 2c8a4a282334 ("f2fs: expose quota information in debugfs")

F2FS-fs (loop3): detect filesystem reference count leak during umount, type: 2, count: -1, err: -5, cp_err: 1
------------[ cut here ]------------
kernel BUG at fs/f2fs/super.c:2084!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 1 UID: 0 PID: 5626 Comm: syz-executor204 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:f2fs_put_super+0x145a/0x1460 fs/f2fs/super.c:2084
Code: c1 e8 03 83 e0 01 48 8b 7c 24 18 31 f6 48 c7 c2 60 54 df 8b 44 89 f9 4d 89 f0 44 8b 4c 24 28 50 e8 fb 21 fd ff 48 83 c4 08 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc90004ce7800 EFLAGS: 00010296
RAX: 4b622689e1bfa200 RBX: dffffc0000000000 RCX: 4b622689e1bfa200
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90004ce7a78 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffff5200099ce89 R12: ffff88803621c084
R13: ffff88803621c087 R14: ffffffffffffffff R15: 0000000000000002
FS:  000055558cad3400(0000) GS:ffff8881247fa000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffd8e1178fc CR3: 000000004635a000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 generic_shutdown_super+0x140/0x2d0 fs/super.c:723
 kill_block_super+0x44/0xa0 fs/super.c:1852
 kill_f2fs_super+0x3b5/0x700 fs/f2fs/super.c:5788
 deactivate_locked_super+0xbe/0x110 fs/super.c:558
 cleanup_mnt+0x204/0x2a0 fs/namespace.c:1396
 task_work_run+0x1d9/0x260 kernel/task_work.c:233
 ptrace_notify+0x258/0x290 kernel/signal.c:2598
 ptrace_report_syscall include/linux/ptrace.h:416 [inline]
 ptrace_report_syscall_exit+0x2d/0x50 include/linux/ptrace.h:477
 arch_ptrace_report_syscall_exit include/linux/entry-common.h:240 [inline]
 syscall_exit_work include/linux/entry-common.h:273 [inline]
 syscall_exit_to_user_mode_work include/linux/entry-common.h:304 [inline]
 syscall_exit_to_user_mode include/linux/entry-common.h:341 [inline]
 do_syscall_64+0x4c4/0x540 arch/x86/entry/syscall_64.c:107
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f13496c5717
Code: bf 41 4d 56 53 b8 9d 00 00 00 0f 05 83 f8 ea 75 a2 c7 05 b8 a3 0a 00 00 00 00 00 eb 96 e8 31 06 00 00 90 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 d0 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffd8e1178e8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000018830 RCX: 00007f13496c5717
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffd8e1179a0
RBP: 00007ffd8e1179a0 R08: 00007ffd8e1189a0 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000206 R12: 00007ffd8e118a50
R13: 000055558cad4760 R14: 431bde82d7b634db R15: 00007ffd8e1189f4
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:f2fs_put_super+0x145a/0x1460 fs/f2fs/super.c:2084
Code: c1 e8 03 83 e0 01 48 8b 7c 24 18 31 f6 48 c7 c2 60 54 df 8b 44 89 f9 4d 89 f0 44 8b 4c 24 28 50 e8 fb 21 fd ff 48 83 c4 08 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc90004ce7800 EFLAGS: 00010296
RAX: 4b622689e1bfa200 RBX: dffffc0000000000 RCX: 4b622689e1bfa200
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90004ce7a78 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffff5200099ce89 R12: ffff88803621c084
R13: ffff88803621c087 R14: ffffffffffffffff R15: 0000000000000002
FS:  000055558cad3400(0000) GS:ffff8881246fa000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055558cadc798 CR3: 000000004635a000 CR4: 00000000003526f0

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-30  3:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29  7:03 [syzbot] [f2fs?] kernel BUG in f2fs_put_super (6) syzbot
2026-11-30  3:37 ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®