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: <49879FC2-50D1-4CA9-BF64-97192A25D95A@dilger.ca>
Date:   Sun, 3 Jun 2018 22:19:29 -0600
From:   Andreas Dilger <adilger@...ger.ca>
To:     Jan Kara <jack@...e.cz>
Cc:     Ted Tso <tytso@....edu>, linux-ext4@...r.kernel.org
Subject: Re: [PATCH 01/10] libext2fs: Fix possible inode count overflow when
 creating fs

On May 30, 2018, at 6:51 AM, Jan Kara <jack@...e.cz> wrote:
> 
> If blocks count is exactly 1<<32, then the code computing number of
> inode count in ext2fs_initialize() will overflow and set number of
> inodes to 0 (which will be later fixed up to EXT2_FIRST_INODE(super)+1).
> Fix the off-by-one bug in the check.
> 
> Signed-off-by: Jan Kara <jack@...e.cz>

Reviewed-by: Andreas Dilger <adilger@...ger.ca>

> ---
> lib/ext2fs/initialize.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
> index dbe798b27826..e1eff22eac33 100644
> --- a/lib/ext2fs/initialize.c
> +++ b/lib/ext2fs/initialize.c
> @@ -295,7 +295,7 @@ retry:
> 	i = fs->blocksize >= 4096 ? 1 : 4096 / fs->blocksize;
> 
> 	if (ext2fs_has_feature_64bit(super) &&
> -	    (ext2fs_blocks_count(super) / i) > (1ULL << 32))
> +	    (ext2fs_blocks_count(super) / i) >= (1ULL << 32))
> 		set_field(s_inodes_count, ~0U);
> 	else
> 		set_field(s_inodes_count, ext2fs_blocks_count(super) / i);
> --
> 2.13.6
> 


Cheers, Andreas






Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ