public inbox for linux-coco@lists.linux.dev
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linux-crypto@vger.kernel.org, Arnd Bergmann <arnd@kernel.org>,
	Dan Williams <dan.j.williams@intel.com>,
	Dionna Amalie Glaze <dionnaglaze@google.com>,
	Cedric Xing <cedric.xing@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Zi Li <zi.li@linux.dev>, Masami Hiramatsu <mhiramat@kernel.org>,
	Lance Yang <lance.yang@linux.dev>,
	Zhou Yuhang <zhouyuhang@kylinos.cn>,
	Colin Ian King <colin.i.king@gmail.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sample/tsm-mr: Use SHA-2 library APIs
Date: Thu, 19 Mar 2026 10:32:22 -0700	[thread overview]
Message-ID: <20260319173222.GA10208@quark> (raw)
In-Reply-To: <dc124ea8-05b8-42d2-93ad-d265e0ecf585@app.fastmail.com>

On Wed, Mar 18, 2026 at 08:57:01PM +0100, Arnd Bergmann wrote:
> On Wed, Mar 18, 2026, at 17:42, Eric Biggers wrote:
> > Given that tsm_mr_sample has a particular set of algorithms that it
> > wants, just use the library APIs for those algorithms rather than
> > crypto_shash.  This is more straightforward and a bit more efficient.
> >
> > This fixes an issue where this module failed to build due to the kconfig
> > options CRYPTO and CRYPTO_HASH not being selected.  Also, even if it
> > built, crypto_alloc_shash() could fail at runtime due to the needed
> > algorithms not being available.
> >
> > The library functions simply use direct linking.  So if it builds, which
> > it will due to the kconfig options being enabled, they are available.
> >
> > Fixes: f6953f1f9ec4 ("tsm-mr: Add tsm-mr sample code")
> > Fixes: 44a3873df811 ("coco/guest: Remove unneeded selection of CRYPTO")
> > Signed-off-by: Eric Biggers <ebiggers@kernel.org>
> > ---
> >
> > I'd like to take this via libcrypto-next, as that is where
> > "coco/guest: Remove unneeded selection of CRYPTO" is.
> 
> Thanks for fixing this! It is indeed nicer than the fix
> I sent earlier today.
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>

Thanks.  Additional acks from the people owning this code (Dan, Cedric?)
would be appreciated.  But since this fixes a build error and is related
to the crypto library, I went ahead and applied this to
https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next

I also found that the build error is pre-existing, as CRYPTO_HASH was
not being selected.  "coco/guest: Remove unneeded selection of CRYPTO"
just made it a bit easier to encounter, by not selecting CRYPTO either.

So I updated the second paragraph of the commit message to:

    This also fixes a bug where this module failed to build if it was
    enabled without CRYPTO_HASH happening to be set elsewhere in the
    kconfig.  (With the concurrent change to make TSM_MEASUREMENTS stop
    selecting CRYPTO, this existing build error would have become easier to
    encounter, as well.)  Also, even if it built, crypto_alloc_shash() could
    fail at runtime due to the needed algorithms not being available.

I also put this commit before "coco/guest: Remove unneeded selection of
CRYPTO" and dropped the Fixes reference to that.  So now it just has:

    Fixes: f6953f1f9ec4 ("tsm-mr: Add tsm-mr sample code")

- Eric

  reply	other threads:[~2026-03-19 17:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 16:42 [PATCH] sample/tsm-mr: Use SHA-2 library APIs Eric Biggers
2026-03-18 19:57 ` Arnd Bergmann
2026-03-19 17:32   ` Eric Biggers [this message]
2026-03-19 17:51     ` Dan Williams

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=20260319173222.GA10208@quark \
    --to=ebiggers@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=cedric.xing@intel.com \
    --cc=colin.i.king@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=dionnaglaze@google.com \
    --cc=lance.yang@linux.dev \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=zhouyuhang@kylinos.cn \
    --cc=zi.li@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