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, 17 Feb 2012 21:18:26 +0100 (CET)
From:	Lukas Czerner <lczerner@...hat.com>
To:	"Theodore Ts'o" <tytso@....edu>
cc:	Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 1/2] e2image: fix logic bug which could cause a raw image
 not to be extended

On Fri, 17 Feb 2012, Theodore Ts'o wrote:

> If the size of the last "hole" in the raw file was an exact multiple
> of a megabyte, then we wouldn't write a null at the end of the file in
> order to extend the size of the raw image to correspond with the file
> system size.  Thanks to Lukas Czerner for suggesting the fix, and
> Phillip Susi for pointing out the problem.
> 
> Signed-off-by: "Theodore Ts'o" <tytso@....edu>
> ---
>  misc/e2image.c |    7 +++----
>  1 files changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/misc/e2image.c b/misc/e2image.c
> index d888e5a..3cb92fe 100644
> --- a/misc/e2image.c
> +++ b/misc/e2image.c
> @@ -504,10 +504,9 @@ static void output_meta_data_blocks(ext2_filsys fs, int fd)
>  				continue;
>  			}
>  			sparse += fs->blocksize;
> -			if (sparse >= 1024*1024) {
> -
> -				write_block(fd, 0, sparse, 0, 0);
> -				sparse = 0;
> +			if (sparse > 1024*1024) {
> +				write_block(fd, 0, 1024*1024, 0, 0);
> +				sparse -= 1024*1024;
>  			}
>  		}
>  	}
> 

Looks good, thanks!

-Lukas
--
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