Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2821154pxb; Mon, 19 Apr 2021 15:06:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7IXWdceJ/r9PuTGwVkOQYZS1A/IbtyCMvPmmyOM8PkpEyfi3pzNpzgNFBBLA3CbYHgldm X-Received: by 2002:a17:906:4153:: with SMTP id l19mr21307843ejk.109.1618870004992; Mon, 19 Apr 2021 15:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618870004; cv=none; d=google.com; s=arc-20160816; b=IVieSSkcih1EzoAMwNl1762X9HCczL41M0kdBeQ4fzV59SRJ6dKDYb4YdpjN2YzE9G Z735oDpjuaHO9zo6vAqOvc13fXIlZ9bMptsb8r6ClFOK28zvnmsZwzEC7+yl3AOr4gf+ q0hZ5chjVlBsMnV5GoHt2Q85h02OwsR+wuFEi6L4xQFAZBGUuSTpvneNZ0UkrRK654mh Bwm4ITo7g8IOl0n0V6kTYlvoMK+TYHOVIJt5m0sUgObfB7xuDtjuIlRA+56WPog2SDkP xcCO1zcSWIftgw1ER3uBllzZDcz4UI9kshYLGg0XmpniVk4JY+Mib145gNFp+D1Q18ig ugjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XQAv/5jJB0J54D0n58EWRjCtAfMhcsbA7DVjNeGd+Go=; b=cCxHicrf5qPBUm2UezWdzePYOgsvDeq+Xmh4l5mWD2/xYXxmPRtYJuOvwLQwBVRTZ4 YLJMCnxSVY9BCP/SexFpxnbMdnD5wzLiZ6oGwfca5z3M9hNpTVRNOUhs8JsAvjcPrXPo 9+Tiscx2KyBxSoSSqqmZ6uuost+C2/wyVzkzt9eefc0NzcRkmkageXdWxcyjPDMiQmFS Xm8LWEbQ43TqjUUjiUwbOBVLAHMCJuPg5VDdv1o/2iR+wMcPvH3FXBrdwGXbGuKYQTHf QQgRMmDgqqA+dbEzwM/onm6WWF/zZb3vtJ21gHJDef5n22CYf8j4gPF68c/4s/3OPBgj +02w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mCRAHbLO; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u14si7389175edq.318.2021.04.19.15.06.21; Mon, 19 Apr 2021 15:06:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mCRAHbLO; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229863AbhDSWF5 (ORCPT + 99 others); Mon, 19 Apr 2021 18:05:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:47366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbhDSWF4 (ORCPT ); Mon, 19 Apr 2021 18:05:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CD7C1613B4; Mon, 19 Apr 2021 22:05:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618869926; bh=7qxXUL+60tZO/lod/ToaBQJmBTycv2Zd4iAqoJm/Ieg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mCRAHbLOOD0Uqg3frJEbdBxsnOsucQlbyCtdknPJzv8auys3C34tIJ03gsnqkk2tu ZRmBJC5hgPR2vg8qyavmr8Ip5J8tfWDEvZHfLb8DD5GwSxXGZ6hvlSAr8mwQGatzKN O/TvmOk1vH2yrcxh4ouYGWyJYx5BmzPfHTHBE0TQj6toMXuZ/bnsW08amHPEQB4PNm yuo3iVSY3eVvrQ5dednFEeDWhs3r6klXjX98PrqmiRMv8XFpG/MaOq+pKSc/RR4AMH HRJewi7AnY/lwIRkCYcqGLFD+/CbBFI/1E5fmcmZCImRzEneX31zGPUPumFwVJv0aL EamfyDkYv/9yw== Date: Mon, 19 Apr 2021 15:05:24 -0700 From: Eric Biggers To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, linux-fscrypt@vger.kernel.org, "Theodore Y. Ts'o" , Jaegeuk Kim Subject: Re: [PATCH 2/2] fsverity: relax build time dependency on CRYPTO_SHA256 Message-ID: References: <20210416160642.85387-1-ardb@kernel.org> <20210416160642.85387-3-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210416160642.85387-3-ardb@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Apr 16, 2021 at 06:06:42PM +0200, Ard Biesheuvel wrote: > 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 > help > This option enables fs-verity. fs-verity is the dm-verity > mechanism implemented at the file level. On supported Looks fine, Acked-by: Eric Biggers - Eric