* [PATCH] tsm-mr: fix sample dependencies
@ 2026-03-18 10:51 Arnd Bergmann
2026-03-18 16:48 ` Eric Biggers
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2026-03-18 10:51 UTC (permalink / raw)
To: Dan Williams, Dionna Amalie Glaze, Cedric Xing, Eric Biggers
Cc: Arnd Bergmann, Andrew Morton, Zi Li, Masami Hiramatsu (Google),
Lance Yang, Zhou Yuhang, Colin Ian King, linux-kernel
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
--
2.39.5
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] tsm-mr: fix sample dependencies
2026-03-18 10:51 [PATCH] tsm-mr: fix sample dependencies Arnd Bergmann
@ 2026-03-18 16:48 ` Eric Biggers
0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2026-03-18 16:48 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Dan Williams, Dionna Amalie Glaze, Cedric Xing, Arnd Bergmann,
Andrew Morton, Zi Li, Masami Hiramatsu (Google), Lance Yang,
Zhou Yuhang, Colin Ian King, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-18 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-18 10:51 [PATCH] tsm-mr: fix sample dependencies Arnd Bergmann
2026-03-18 16:48 ` Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox