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]
Message-Id: <4423B081-F635-45FB-BFE3-0A75D8F5B0E0@dilger.ca>
Date:   Wed, 17 Nov 2021 13:26:13 -0700
From:   Andreas Dilger <adilger@...ger.ca>
To:     Adam Borowski <kilobyte@...band.pl>
Cc:     Theodore Ts'o <tytso@....edu>,
        linux-ext4 <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4: drop an always true check

On Nov 15, 2021, at 10:20 AM, Adam Borowski <kilobyte@...band.pl> wrote:
> 
> EXT_FIRST_INDEX(ptr) is ptr+12, which can't possibly be null; gcc-12
> warns about this.
> 
> Signed-off-by: Adam Borowski <kilobyte@...band.pl>

I was wondering if this was intending to check if path[depth].p_hdr was NULL,
but it is clear from the rest of the code that this could not be true, since
it is already being accessed earlier in the code, so this looks fine.

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

> ---
> fs/ext4/extents.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 0ecf819bf189..5aa279742da9 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -1496,8 +1496,7 @@ static int ext4_ext_search_left(struct inode *inode,
> 				EXT4_ERROR_INODE(inode,
> 				  "ix (%d) != EXT_FIRST_INDEX (%d) (depth %d)!",
> 				  ix != NULL ? le32_to_cpu(ix->ei_block) : 0,
> -				  EXT_FIRST_INDEX(path[depth].p_hdr) != NULL ?
> -		le32_to_cpu(EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block) : 0,
> +				  le32_to_cpu(EXT_FIRST_INDEX(path[depth].p_hdr)->ei_block),
> 				  depth);
> 				return -EFSCORRUPTED;
> 			}
> --
> 2.33.1
> 


Cheers, Andreas






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

Powered by blists - more mailing lists