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: <202507031448.C3DAD52@keescook>
Date: Thu, 3 Jul 2025 14:57:04 -0700
From: Kees Cook <kees@...nel.org>
To: Thorsten Blum <thorsten.blum@...ux.dev>,
	Suman Kumar Chakraborty <suman.kumar.chakraborty@...el.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
	"David S. Miller" <davem@...emloft.net>,
	Nick Terrell <terrelln@...com>, David Sterba <dsterba@...e.com>,
	linux-hardening@...r.kernel.org, linux-crypto@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: zstd - replace zero-length array with flexible
 array member

On Thu, Jul 03, 2025 at 07:19:34PM +0200, Thorsten Blum wrote:
> Replace the deprecated zero-length array with a modern flexible array
> member in the struct zstd_ctx.

Oh, weird. This is a very recent change. This should include:

Fixes: f5ad93ffb541 ("crypto: zstd - convert to acomp")

> 
> No functional changes intended.
> 
> Link: https://github.com/KSPP/linux/issues/78
> Signed-off-by: Thorsten Blum <thorsten.blum@...ux.dev>
> ---
>  crypto/zstd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/crypto/zstd.c b/crypto/zstd.c
> index 657e0cf7b952..c489976c3e8b 100644
> --- a/crypto/zstd.c
> +++ b/crypto/zstd.c
> @@ -25,7 +25,7 @@ struct zstd_ctx {
>  	zstd_dctx *dctx;
>  	size_t wksp_size;
>  	zstd_parameters params;
> -	u8 wksp[0] __aligned(8);
> +	u8 wksp[] __aligned(8);

And likely, to use __counted_by(wksp_size)

I'm surprised checkpatch.pl didn't warn, but I guess the __aligned
confused the script?

Reviewed-by: Kees Cook <kees@...nel.org>

-Kees

>  };
>  
>  static DEFINE_MUTEX(zstd_stream_lock);
> -- 
> 2.50.0
> 
> 

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ