From: Eric Biggers <ebiggers@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>,
Dionna Amalie Glaze <dionnaglaze@google.com>,
Cedric Xing <cedric.xing@intel.com>,
Arnd Bergmann <arnd@arndb.de>,
Andrew Morton <akpm@linux-foundation.org>,
Zi Li <zi.li@linux.dev>,
"Masami Hiramatsu (Google)" <mhiramat@kernel.org>,
Lance Yang <lance.yang@linux.dev>,
Zhou Yuhang <zhouyuhang@kylinos.cn>,
Colin Ian King <colin.i.king@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tsm-mr: fix sample dependencies
Date: Wed, 18 Mar 2026 09:48:34 -0700 [thread overview]
Message-ID: <20260318164834.GB2255@sol> (raw)
In-Reply-To: <20260318105200.1985712-1-arnd@kernel.org>
On Wed, Mar 18, 2026 at 11:51:55AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The tsm sample fails to link when crypto support is in a loadable module:
>
> ld.lld-22: error: undefined symbol: crypto_alloc_shash
> ld.lld-22: error: undefined symbol: crypto_shash_tfm_digest
> ld.lld-22: error: undefined symbol: crypto_destroy_tfm
> ld.lld-22: error: undefined symbol: crypto_shash_init
> ld.lld-22: error: undefined symbol: crypto_shash_finup
> >>> referenced by tsm_mr_sample.c
> >>> samples/tsm-mr/tsm_mr_sample.o:(sample_report_extend_mr) in archive vmlinux.a
>
> This used to be handled indirectly by CONFIG_TSM_MEASUREMENTS forcing
> the crypto code to be built-in, but that was changed because TSM
> itself does not require it.
>
> Move the select into the Kconfig option that controls the sample
> instead.
>
> Fixes: f6953f1f9ec4 ("tsm-mr: Add tsm-mr sample code")
> Fixes: 44a3873df811 ("coco/guest: Remove unneeded selection of CRYPTO")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> samples/Kconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/samples/Kconfig b/samples/Kconfig
> index 5bc7c9e5a59e..730cc9f4197e 100644
> --- a/samples/Kconfig
> +++ b/samples/Kconfig
> @@ -186,6 +186,8 @@ config SAMPLE_TIMER
>
> config SAMPLE_TSM_MR
> tristate "TSM measurement sample"
> + select CRYPTO
> + select CRYPTO_HASH
> select TSM_MEASUREMENTS
> select VIRT_DRIVERS
> help
Thanks. If we go with this, I can take it through libcrypto-next, given
that that's where "coco/guest: Remove unneeded selection of CRYPTO" is.
However, note that this fix doesn't select the crypto algorithms the
module actually uses. So it doesn't completely fix it either, and we'd
at least need an additional fix to actually select the algorithms.
I suggest that we instead convert this module to use the SHA-2 library
APIs
(https://lore.kernel.org/linux-crypto/20260318164233.19800-1-ebiggers@kernel.org/).
That patch fixes both problems.
- Eric
prev parent reply other threads:[~2026-03-18 16:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 10:51 [PATCH] tsm-mr: fix sample dependencies Arnd Bergmann
2026-03-18 16:48 ` 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=20260318164834.GB2255@sol \
--to=ebiggers@kernel.org \
--cc=akpm@linux-foundation.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-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