Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: kernel test robot <lkp@intel.com>,
	Danny Tsen <dtsen@linux.ibm.com>,
	oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	Ard Biesheuvel <ardb@kernel.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: [PATCH] crypto: lib/Kconfig - Fix lib built-in failure when arch is modular
Date: Wed, 12 Feb 2025 05:09:36 +0000	[thread overview]
Message-ID: <20250212050936.GB2010357@google.com> (raw)
In-Reply-To: <Z6woN4vgdaywOZxm@gondor.apana.org.au>

On Wed, Feb 12, 2025 at 12:48:55PM +0800, Herbert Xu wrote:
> On Thu, Jan 23, 2025 at 02:18:27AM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   c4b9570cfb63501638db720f3bee9f6dfd044b82
> > commit: b42519dbba838c928e82b55f32712fbe3eed2c45 crypto: ppc/curve25519 - Update Kconfig and Makefile for ppc64le
> > date:   8 months ago
> > config: powerpc64-randconfig-r111-20250122 (https://download.01.org/0day-ci/archive/20250123/202501230223.ikroNDr1-lkp@intel.com/config)
> > compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
> > reproduce: (https://download.01.org/0day-ci/archive/20250123/202501230223.ikroNDr1-lkp@intel.com/reproduce)
> 
> Thanks for the report.  This is the old built-in vs. modular Kconfig
> problem.  This patch should fix it:
> 
> ---8<---
> The HAVE_ARCH Kconfig options in lib/crypto try to solve the
> modular versus built-in problem, but it still fails when the
> the LIB option (e.g., CRYPTO_LIB_CURVE25519) is selected externally.
> 
> Fix this by introducing a level of indirection with ARCH_MAY_HAVE
> Kconfig options, these then go on to select the ARCH_HAVE options
> if the ARCH Kconfig options matches that of the LIB option.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202501230223.ikroNDr1-lkp@intel.com/
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 
> diff --git a/arch/arm/crypto/Kconfig b/arch/arm/crypto/Kconfig
> index 32650c8431d9..47d9cc59f254 100644
> --- a/arch/arm/crypto/Kconfig
> +++ b/arch/arm/crypto/Kconfig
> @@ -6,7 +6,7 @@ config CRYPTO_CURVE25519_NEON
>  	tristate "Public key crypto: Curve25519 (NEON)"
>  	depends on KERNEL_MODE_NEON
>  	select CRYPTO_LIB_CURVE25519_GENERIC
> -	select CRYPTO_ARCH_HAVE_LIB_CURVE25519
> +	select CRYPTO_ARCH_MAY_HAVE_LIB_CURVE25519
>  	help
>  	  Curve25519 algorithm

Please name these like ARCH_HAS_CURVE25519 and CRYPTO_LIB_CURVE25519_ARCH to be
consistent with the CRC library, the many other ARCH_HAS_* options, and
CRYPTO_LIB_CURVE25519_GENERIC.  Nothing uses names that contain "MAY_HAVE",
which is ambiguous.

FWIW, at some point the arch optimized crypto algorithms also need to just be
enabled by default.  The fact that they're not is a longstanding bug that is
really harmful to users and needs to be fixed.

- Eric

  reply	other threads:[~2025-02-12  5:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <202501230223.ikroNDr1-lkp@intel.com>
2025-02-12  4:48 ` [PATCH] crypto: lib/Kconfig - Fix lib built-in failure when arch is modular Herbert Xu
2025-02-12  5:09   ` Eric Biggers [this message]
2025-02-12  5:29     ` Herbert Xu
2025-02-12  5:44       ` Eric Biggers
2025-02-12  5:48         ` Herbert Xu
     [not found]   ` <202502232152.JC84YDLp-lkp@intel.com>
2025-02-24  3:28     ` [PATCH] crypto: lib/Kconfig - Fix lib built-in and modular failure for arm64/mips/s390 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=20250212050936.GB2010357@google.com \
    --to=ebiggers@kernel.org \
    --cc=ardb@kernel.org \
    --cc=dtsen@linux.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox