From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
"Jason A . Donenfeld" <Jason@zx2c4.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
stable@vger.kernel.org
Subject: Re: [PATCH] crypto: aes - Fix conditions for selecting MAC dependencies
Date: Sun, 12 Jul 2026 22:15:29 -0400 [thread overview]
Message-ID: <20260713021529.GD4362@quark> (raw)
In-Reply-To: <20260709022954.45113-1-ebiggers@kernel.org>
On Wed, Jul 08, 2026 at 10:29:54PM -0400, Eric Biggers wrote:
> Starting in commit 7137cbf2b5c9 ("crypto: aes - Add cmac, xcbc, and
> cbcmac algorithms using library"), the aes module (CRYPTO_AES) supports
> CBC based MACs using the corresponding library functions.
>
> To avoid including unneeded functionality, that support honors the
> existing CRYPTO_CMAC, CRYPTO_XCBC, and CRYPTO_CCM kconfig options. The
> dependencies are selected if at least one of those is enabled.
>
> However, the select statements don't correctly handle the case where
> CRYPTO_AES=y and (for example) CRYPTO_CMAC=m. In that case the
> dependencies get selected at level 'm', due to how the kconfig language
> works. That causes a linker error.
>
> Fix this by changing the selection conditions to use '!= n'.
>
> A similar issue also exists for CRYPTO_LIB_AES's conditional selection
> of CRYPTO_LIB_UTILS. The same '!= n' would work, but instead just make
> CRYPTO_LIB_AES always select CRYPTO_LIB_UTILS. CRYPTO_LIB_UTILS is
> lightweight, and it's needed by most AES modes and many other things.
>
> Fixes: 7137cbf2b5c9 ("crypto: aes - Add cmac, xcbc, and cbcmac algorithms using library")
> Fixes: 309a7e514da7 ("lib/crypto: aes: Add support for CBC-based MACs")
> Cc: stable@vger.kernel.org
> Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> ---
>
Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-fixes
- Eric
prev parent reply other threads:[~2026-07-13 2:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 2:29 [PATCH] crypto: aes - Fix conditions for selecting MAC dependencies Eric Biggers
2026-07-13 2:15 ` Eric Biggers [this message]
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=20260713021529.GD4362@quark \
--to=ebiggers@kernel.org \
--cc=Jason@zx2c4.com \
--cc=ardb@kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox