archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <>
Cc:, Ard Biesheuvel <>,
	"Theodore Y. Ts'o" <>,
	Jaegeuk Kim <>,
	Eric Biggers <>
Subject: [PATCH 2/2] fsverity: relax build time dependency on CRYPTO_SHA256
Date: Fri, 16 Apr 2021 18:06:42 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

CONFIG_CRYPTO_SHA256 denotes the generic C implementation of the SHA-256
shash algorithm, which is selected as the default crypto shash provider
for fsverity. However, fsverity has no strict link time dependency, and
the same shash could be exposed by an optimized implementation, and arm64
has a number of those (scalar, NEON-based and one based on special crypto
instructions). In such cases, it makes little sense to require that the
generic C implementation is incorporated as well, given that it will never
be called.

To address this, relax the 'select' clause to 'imply' so that the generic
driver can be omitted from the build if desired.

Signed-off-by: Ard Biesheuvel <>
 fs/verity/Kconfig | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/verity/Kconfig b/fs/verity/Kconfig
index 88fb25119899..24d1b54de807 100644
--- a/fs/verity/Kconfig
+++ b/fs/verity/Kconfig
@@ -3,9 +3,13 @@
 config FS_VERITY
 	bool "FS Verity (read-only file-based authenticity protection)"
 	select CRYPTO
-	# SHA-256 is selected as it's intended to be the default hash algorithm.
+	# SHA-256 is implied as it's intended to be the default hash algorithm.
 	# To avoid bloat, other wanted algorithms must be selected explicitly.
-	select CRYPTO_SHA256
+	# Note that CRYPTO_SHA256 denotes the generic C implementation, but
+	# some architectures provided optimized implementations of the same
+	# algorithm that may be used instead. In this case, CRYPTO_SHA256 may
+	# be omitted even if SHA-256 is being used.
+	imply CRYPTO_SHA256
 	  This option enables fs-verity.  fs-verity is the dm-verity
 	  mechanism implemented at the file level.  On supported

  parent reply	other threads:[~2021-04-16 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 16:06 [PATCH 0/2] relax crypto Kconfig dependencies for fsverity/fscrypt Ard Biesheuvel
2021-04-16 16:06 ` [PATCH 1/2] fscrypt: relax Kconfig dependencies for crypto API algorithms Ard Biesheuvel
2021-04-19 22:03   ` Eric Biggers
2021-04-16 16:06 ` Ard Biesheuvel [this message]
2021-04-19 22:05   ` [PATCH 2/2] fsverity: relax build time dependency on CRYPTO_SHA256 Eric Biggers

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:

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

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 2/2] fsverity: relax build time dependency on CRYPTO_SHA256' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).