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:   Sun, 5 Apr 2020 18:43:09 -0600
From:   Andreas Dilger <adilger@...ger.ca>
To:     Michael Forney <mforney@...rney.org>
Cc:     linux-ext4@...r.kernel.org
Subject: Re: [PATCH] libext2fs: avoid pointer arithmetic on `void *`

On Apr 4, 2020, at 10:53 PM, Michael Forney <mforney@...rney.org> wrote:
> 
> The pointer operand to the binary `+` operator must be to a complete
> object type.
> 
> Signed-off-by: Michael Forney <mforney@...rney.org>

Seems straight forward enough.  Not needed for GCC, but strictly correct.

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

> ---
> lib/ext2fs/csum.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/ext2fs/csum.c b/lib/ext2fs/csum.c
> index 8513d1ab..c2550365 100644
> --- a/lib/ext2fs/csum.c
> +++ b/lib/ext2fs/csum.c
> @@ -274,7 +274,7 @@ static errcode_t __get_dirent_tail(ext2_filsys fs,
> 		rec_len = translate(d->rec_len);
> 	}
> 
> -	if ((void *)d > ((void *)dirent + fs->blocksize))
> +	if ((char *)d > ((char *)dirent + fs->blocksize))
> 			return EXT2_ET_DIR_CORRUPTED;
> 	if (d != top)
> 		return EXT2_ET_DIR_NO_SPACE_FOR_CSUM;
> --
> 2.26.0
> 


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