lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1302271343391.3310@localhost>
Date:	Wed, 27 Feb 2013 13:45:11 +0100 (CET)
From:	Lukáš Czerner <lczerner@...hat.com>
To:	Wei Yongjun <weiyj.lk@...il.com>
cc:	tytso@....edu, adilger.kernel@...ger.ca,
	yongjun_wei@...ndmicro.com.cn, linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: fix possible memory leak in ext4_remount()

On Wed, 27 Feb 2013, Wei Yongjun wrote:

> Date: Wed, 27 Feb 2013 13:18:53 +0800
> From: Wei Yongjun <weiyj.lk@...il.com>
> To: tytso@....edu, adilger.kernel@...ger.ca
> Cc: yongjun_wei@...ndmicro.com.cn, linux-ext4@...r.kernel.org
> Subject: [PATCH] ext4: fix possible memory leak in ext4_remount()
> 
> From: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
> 
> 'orig_data' is malloced in ext4_remount() and should be freed
> before leaving from the error handling cases, otherwise it will
> cause memory leak.

Good catch, thanks!

Reviewed-by: Lukas Czerner <lczerner@...hat.com>

> 
> Signed-off-by: Wei Yongjun <yongjun_wei@...ndmicro.com.cn>
> ---
>  fs/ext4/super.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 373d46c..8ae09e3 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4538,6 +4538,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
>  			if (!old_opts.s_qf_names[i]) {
>  				for (j = 0; j < i; j++)
>  					kfree(old_opts.s_qf_names[j]);
> +				kfree(orig_data);
>  				return -ENOMEM;
>  			}
>  		} else
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ