[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250610184146.GA1649@sol>
Date: Tue, 10 Jun 2025 11:41:46 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Kees Cook <kees@...nel.org>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
Ard Biesheuvel <ardb@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] crypto: Annotate crypto strings with nonstring
On Thu, May 29, 2025 at 10:31:17AM -0700, Kees Cook wrote:
> Annotate various keys, ivs, and other byte arrays with __nonstring so
> that static initializers will not complain about truncating the trailing
> NUL byte under GCC 15 with -Wunterminated-string-initialization enabled.
> Silences many warnings like:
>
> ../lib/crypto/aesgcm.c:642:27: warning: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (13 chars into 12 available) [-Wunterminated-string-initialization]
> 642 | .iv = "\xca\xfe\xba\xbe\xfa\xce\xdb\xad"
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Signed-off-by: Kees Cook <kees@...nel.org>
> ---
> Cc: Herbert Xu <herbert@...dor.apana.org.au>
> Cc: Eric Biggers <ebiggers@...gle.com>
> Cc: Ard Biesheuvel <ardb@...nel.org>
> Cc: "David S. Miller" <davem@...emloft.net>
> Cc: <linux-crypto@...r.kernel.org>
> ---
> lib/crypto/aescfb.c | 8 ++++----
> lib/crypto/aesgcm.c | 46 ++++++++++++++++++++++-----------------------
> 2 files changed, 27 insertions(+), 27 deletions(-)
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-fixes
Thanks!
- Eric
Powered by blists - more mailing lists