From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabian Frederick , Alexander Viro , Andrew Morton , Linus Torvalds Subject: [PATCH 3.14 100/228] fs/affs/super.c: bugfix / double free Date: Wed, 4 Jun 2014 16:22:09 -0700 Message-Id: <20140604232351.257138624@linuxfoundation.org> In-Reply-To: <20140604232347.966798903@linuxfoundation.org> References: <20140604232347.966798903@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fabian Frederick commit d353efd02357a74753cd45f367a2d3d357fd6904 upstream. Commit 842a859db26b ("affs: use ->kill_sb() to simplify ->put_super() and failure exits of ->mount()") adds .kill_sb which frees sbi but doesn't remove sbi free in case of parse_options error causing double free+random crash. Signed-off-by: Fabian Frederick Cc: Alexander Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/affs/super.c | 2 -- 1 file changed, 2 deletions(-) --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -336,8 +336,6 @@ static int affs_fill_super(struct super_ &blocksize,&sbi->s_prefix, sbi->s_volume, &mount_flags)) { printk(KERN_ERR "AFFS: Error parsing options\n"); - kfree(sbi->s_prefix); - kfree(sbi); return -EINVAL; } /* N.B. after this point s_prefix must be released */