linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: affs: fix a memroy leak in affs_remount
@ 2019-09-30  3:21 Navid Emamdoost
  2019-09-30  6:02 ` [PATCH] fs: affs: fix a memory " Markus Elfring
  0 siblings, 1 reply; 12+ messages in thread
From: Navid Emamdoost @ 2019-09-30  3:21 UTC (permalink / raw)
  Cc: emamd001, kjlu, smccaman, Navid Emamdoost, David Sterba,
	Thomas Gleixner, Al Viro, Kees Cook, Deepa Dinamani,
	Gustavo A. R. Silva, linux-fsdevel, linux-kernel

In affs_remount if data is provided it is duplicated into new_opts. But
this is not actually used later! The allocated memory for new_opts is
only released if pare_options fail. This commit adds release for
new_opts.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 fs/affs/super.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/affs/super.c b/fs/affs/super.c
index cc463ae47c12..1d38fdbc5148 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -598,6 +598,8 @@ affs_remount(struct super_block *sb, int *flags, char *data)
 	memcpy(sbi->s_volume, volume, 32);
 	spin_unlock(&sbi->symlink_lock);
 
+	kfree(new_opts);
+
 	if ((bool)(*flags & SB_RDONLY) == sb_rdonly(sb))
 		return 0;
 
-- 
2.17.1


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

end of thread, other threads:[~2019-10-30 11:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30  3:21 [PATCH] fs: affs: fix a memroy leak in affs_remount Navid Emamdoost
2019-09-30  6:02 ` [PATCH] fs: affs: fix a memory " Markus Elfring
2019-09-30 21:01   ` [PATCH v2] " Navid Emamdoost
2019-10-01  8:30     ` Markus Elfring
2019-10-01 17:34       ` Navid Emamdoost
2019-10-02  5:09         ` [v2] " Markus Elfring
2019-10-02  5:09         ` Markus Elfring
2019-10-02  9:22     ` [PATCH v2] " David Sterba
2019-10-02 16:59       ` Navid Emamdoost
2019-10-02 21:52       ` [PATCH v3] " Navid Emamdoost
2019-10-30 11:44         ` David Sterba
2019-09-30 21:01   ` [PATCH] " Navid Emamdoost

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