All of lore.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+6c000dea1a93b4f5905c@syzkaller.appspotmail.com>
To: chao@kernel.org, jaegeuk@kernel.org,
	 linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,  syzkaller-bugs@googlegroups.com
Subject: [f2fs-dev] [syzbot] [f2fs?] memory leak in f2fs_apply_options
Date: Thu, 29 Oct 2026 19:36:43 -0700	[thread overview]
Message-ID: <6ae402bb.0c1d3ab6.e3d48.006c.GAE@google.com> (raw)

Hello,

syzbot found the following issue on:

HEAD commit:    c339f4010dea Merge tag 'platform-drivers-x86-v7.4-1' of gi..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=15fbdd95580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=73ec643490576dec
dashboard link: https://syzkaller.appspot.com/bug?extid=6c000dea1a93b4f5905c
compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13c1448d580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/533212b95d17/disk-c339f401.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5cb62d3629c7/vmlinux-c339f401.xz
kernel image: https://storage.googleapis.com/syzbot-assets/12da5b4ca87c/bzImage-c339f401.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/546324936b23/mount_0.gz
  fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=17480929580000)

AI-generated root cause summary:
In F2FS, when remounting a filesystem with an empty journalled quota option
(such as 'usrjquota='), f2fs_apply_quota_options() overwrites
F2FS_OPTION(sbi).s_qf_names[i] with NULL without freeing the previously
allocated quota filename string. While __f2fs_remount() duplicates the existing
quota file names into org_mount_opt via kstrdup() at the start of remount and
frees them upon successful completion, this only frees the temporary backup
copy, leaving the original allocated string orphaned. This results in a kernel
heap memory leak on every remount that clears a journalled quota filename
option.

full analysis:  https://syzkaller.appspot.com/x/ai_root_cause?x=6c000dea1a93b4f5905c

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

BUG: memory leak
unreferenced object 0xffff888128b26a10 (size 8):
  comm "syz.0.17", pid 5977, jiffies 4294944034
  hex dump (first 8 bytes):
    66 32 66 73 00 00 00 00                          f2fs....
  backtrace (crc 49a76b1f):
    kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
    slab_post_alloc_hook mm/slub.c:4733 [inline]
    slab_alloc_node mm/slub.c:5033 [inline]
    __do_kmalloc_node mm/slub.c:5530 [inline]
    __kmalloc_node_track_caller_noprof+0x3e0/0x530 mm/slub.c:5662
    __kmemdup_nul mm/util.c:64 [inline]
    kstrdup+0x3c/0x80 mm/util.c:84
    f2fs_apply_quota_options fs/f2fs/super.c:1661 [inline]
    f2fs_apply_options+0x99c/0xb70 fs/f2fs/super.c:1804
    f2fs_fill_super+0xfc4/0x43f0 fs/f2fs/super.c:5288
    get_tree_bdev_flags+0x1c0/0x290 fs/super.c:1883
    vfs_get_tree+0x30/0x120 fs/super.c:1943
    fc_mount fs/namespace.c:1282 [inline]
    do_new_mount_fc fs/namespace.c:3910 [inline]
    do_new_mount fs/namespace.c:3986 [inline]
    path_mount+0x5a9/0x1580 fs/namespace.c:4337
    do_mount fs/namespace.c:4350 [inline]
    __do_sys_mount fs/namespace.c:4565 [inline]
    __se_sys_mount fs/namespace.c:4542 [inline]
    __x64_sys_mount+0x1a3/0x1e0 fs/namespace.c:4542
    do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
    do_syscall_64+0xe9/0x530 arch/x86/entry/syscall_64.c:84
    entry_SYSCALL_64_after_hwframe+0x77/0x7f

connection error: failed to recv *flatrpc.ExecutorMessageRawT: EOF


---
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.

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


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

                 reply	other threads:[~2026-10-30  2:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ae402bb.0c1d3ab6.e3d48.006c.GAE@google.com \
    --to=syzbot+6c000dea1a93b4f5905c@syzkaller.appspotmail.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.