[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190930032200.30474-1-navid.emamdoost@gmail.com>
Date:   Sun, 29 Sep 2019 22:21:57 -0500
From:   Navid Emamdoost <navid.emamdoost@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     emamd001@....edu, kjlu@....edu, smccaman@....edu,
        Navid Emamdoost <navid.emamdoost@...il.com>,
        David Sterba <dsterba@...e.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Al Viro <viro@...iv.linux.org.uk>,
        Kees Cook <keescook@...omium.org>,
        Deepa Dinamani <deepa.kernel@...il.com>,
        "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] fs: affs: fix a memroy leak in affs_remount
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@...il.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
Powered by blists - more mailing lists
 
