From: Siddh Raman Pant <code@siddh.me>
To: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Cc: ntfs3 <ntfs3@lists.linux.dev>,
linux-kernel <linux-kernel@vger.kernel.org>,
syzbot+9d67170b20e8f94351c8@syzkaller.appspotmail.com,
stable@vger.kernel.org
Subject: [PATCH] ntfs3: Fix memory leak in ntfs_fill_super()
Date: Wed, 14 Sep 2022 16:46:43 +0530 [thread overview]
Message-ID: <20220914111643.14411-1-code@siddh.me> (raw)
Mount options ptr wasn't freed before putting the superblock in
ntfs_fill_super(), which resulted in a memory leak.
Bug report: https://syzkaller.appspot.com/bug?id=332ba47915d0e39e94b42a622f195f0804ecb67f
Fixes: 9b75450d6c58 ("fs/ntfs3: Fix memory leak if fill_super failed")
Reported-and-tested-by: syzbot+9d67170b20e8f94351c8@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org # 5.15
Signed-off-by: Siddh Raman Pant <code@siddh.me>
---
fs/ntfs3/super.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 47012c9bf505..c0e45f170701 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -1281,6 +1281,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
* Free resources here.
* ntfs_fs_free will be called with fc->s_fs_info = NULL
*/
+ put_mount_options(sbi->options);
put_ntfs(sbi);
sb->s_fs_info = NULL;
--
2.35.1
reply other threads:[~2022-09-14 11:17 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=20220914111643.14411-1-code@siddh.me \
--to=code@siddh.me \
--cc=almaz.alexandrovich@paragon-software.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=syzbot+9d67170b20e8f94351c8@syzkaller.appspotmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).