All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <kees@kernel.org>
To: Thorsten Blum <thorsten.blum@linux.dev>,
	Suman Kumar Chakraborty <suman.kumar.chakraborty@intel.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Nick Terrell <terrelln@fb.com>, David Sterba <dsterba@suse.com>,
	linux-hardening@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: zstd - replace zero-length array with flexible array member
Date: Thu, 3 Jul 2025 14:57:04 -0700	[thread overview]
Message-ID: <202507031448.C3DAD52@keescook> (raw)
In-Reply-To: <20250703171933.253654-2-thorsten.blum@linux.dev>

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@linux.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@kernel.org>

-Kees

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

-- 
Kees Cook

  reply	other threads:[~2025-07-03 21:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-03 17:19 [PATCH] crypto: zstd - replace zero-length array with flexible array member Thorsten Blum
2025-07-03 21:57 ` Kees Cook [this message]
2025-07-03 22:46   ` Thorsten Blum
2025-07-08 14:14 ` David Sterba
2025-07-10  8:18 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202507031448.C3DAD52@keescook \
    --to=kees@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsterba@suse.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=suman.kumar.chakraborty@intel.com \
    --cc=terrelln@fb.com \
    --cc=thorsten.blum@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.