All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ntfs3: Fix memory leak in ntfs_fill_super()
@ 2022-09-14 11:16 Siddh Raman Pant
  0 siblings, 0 replies; only message in thread
From: Siddh Raman Pant @ 2022-09-14 11:16 UTC (permalink / raw)
  To: Konstantin Komarov
  Cc: ntfs3, linux-kernel, syzbot+9d67170b20e8f94351c8, stable

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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-14 11:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 11:16 [PATCH] ntfs3: Fix memory leak in ntfs_fill_super() Siddh Raman Pant

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.