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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 11 Jul 2014 11:04:52 +0200 (CEST)
From:	Lukáš Czerner <lczerner@...hat.com>
To:	Xiaoguang Wang <wangxg.fnst@...fujitsu.com>
cc:	linux-ext4@...r.kernel.org, tytso@....edu
Subject: Re: [PATCH v2] ext4: fix wrong size computation in
 ext4_mb_normalize_request()

On Fri, 11 Jul 2014, Xiaoguang Wang wrote:

> Date: Fri, 11 Jul 2014 16:34:20 +0800
> From: Xiaoguang Wang <wangxg.fnst@...fujitsu.com>
> To: linux-ext4@...r.kernel.org
> Cc: tytso@....edu, lczerner@...hat.com,
>     Xiaoguang Wang <wangxg.fnst@...fujitsu.com>
> Subject: [PATCH v2] ext4: fix wrong size computation in
>     ext4_mb_normalize_request()
> 
> As the member fe_len defined in struct ext4_free_extent is expressed as
> number of clusters, the variable "size" computation is wrong, we need to
> first translate fe_len to block number, then to bytes.
> 
> Signed-off-by: Xiaoguang Wang <wangxg.fnst@...fujitsu.com>
> ---
>  fs/ext4/mballoc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 7f72f50..975a35e 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -3076,7 +3076,8 @@ ext4_mb_normalize_request(struct ext4_allocation_context *ac,
>  		size = 8 * 1024 * 1024;
>  	} else {
>  		start_off = (loff_t)ac->ac_o_ex.fe_logical << bsbits;
> -		size	  = ac->ac_o_ex.fe_len << bsbits;
> +		size	  = (loff_t)EXT4_C2B(EXT4_SB(ac->ac_sb),
> +				     ac->ac_o_ex.fe_len) << bsbits;

The indentation is wrong, otherwise it looks good.

Thanks!

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


>  	}
>  	size = size >> bsbits;
>  	start = start_off >> bsbits;
> 
--
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