Skip to contentSkip to conversation

firmware_loader: rework crypto dependencies

PATCH In review Arnd Bergmann 4 participants 4 messages Apr 14, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware_loader: rework crypto dependencies

From: Arnd Bergmann <[email protected]>

The crypto dependencies for the firmwware loader are incomplete, in particular a built-in FW_LOADER fails to link against a modular crypto hash driver:

ld.lld: error: undefined symbol: crypto_alloc_shash ld.lld: error: undefined symbol: crypto_shash_digest ld.lld: error: undefined symbol: crypto_destroy_tfm

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by main.c
drivers/base/firmware_loader/main.o:(fw_log_firmware_info) in archive vmlinux.a

Rework this to use the usual 'select' from the driver module, to respect the built-in vs module dependencies, and add a more verbose crypto dependency to the debug option to prevent configurations that lead to a link failure.

Fixes 02fe26f25325 ("firmware_loader: Add debug message with checksum for FW file")

---
Tested on a few hundred randconfig builds

---
 drivers/base/firmware_loader/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/base/firmware_loader/Kconfig +3 -2
index 0cabc783d67a..5ca00e02fe82 100644
@@ -3,6 +3,8 @@ menu "Firmware loader"
 
 config FW_LOADER
 	tristate "Firmware loading facility" if EXPERT
+	select CRYPTO_HASH if FW_LOADER_DEBUG
+	select CRYPTO_SHA256 if FW_LOADER_DEBUG
 	default y
 	help
 	  This enables the firmware loading facility in the kernel. The kernel
@@ -26,10 +28,9 @@ config FW_LOADER
 
 config FW_LOADER_DEBUG
 	bool "Log filenames and checksums for loaded firmware"
+	depends on CRYPTO = FW_LOADER || CRYPTO=y
 	depends on DYNAMIC_DEBUG
 	depends on FW_LOADER
-	depends on CRYPTO
-	depends on CRYPTO_SHA256
 	default FW_LOADER
 	help
 	  Select this option to use dynamic debug to log firmware filenames and
Signature · 1 line
2.39.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The crypto dependencies for the firmwware loader are incomplete, in particular a built-in FW_LOADER fails to link against a modular crypto hash driver:

ld.lld: error: undefined symbol: crypto_alloc_shash ld.lld: error: undefined symbol: crypto_shash_digest ld.lld: error: undefined symbol: crypto_destroy_tfm

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by main.c
drivers/base/firmware_loader/main.o:(fw_log_firmware_info) in archive vmlinux.a

Rework this to use the usual 'select' from the driver module, to respect the built-in vs module dependencies, and add a more verbose crypto dependency to the debug option to prevent configurations that lead to a link failure.

Quoted 7 lines
Fixes 02fe26f25325 ("firmware_loader: Add debug message with checksum for FW file")

---
Tested on a few hundred randconfig builds

---
 drivers/base/firmware_loader/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 17 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The crypto dependencies for the firmwware loader are incomplete, in particular a built-in FW_LOADER fails to link against a modular crypto hash driver:

ld.lld: error: undefined symbol: crypto_alloc_shash ld.lld: error: undefined symbol: crypto_shash_digest ld.lld: error: undefined symbol: crypto_destroy_tfm

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by main.c
drivers/base/firmware_loader/main.o:(fw_log_firmware_info) in archive vmlinux.a

Rework this to use the usual 'select' from the driver module, to respect the built-in vs module dependencies, and add a more verbose crypto dependency to the debug option to prevent configurations that lead to a link failure.

Quoted 5 lines
Fixes 02fe26f25325 ("firmware_loader: Add debug message with checksum for FW file")

---
Tested on a few hundred randconfig builds
---

When I thought I've tested all combinations... ;)

Thanks!

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Arnd Bergmann
Quoted 12 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The crypto dependencies for the firmwware loader are incomplete, in particular a built-in FW_LOADER fails to link against a modular crypto hash driver:

ld.lld: error: undefined symbol: crypto_alloc_shash ld.lld: error: undefined symbol: crypto_shash_digest ld.lld: error: undefined symbol: crypto_destroy_tfm

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by main.c
drivers/base/firmware_loader/main.o:(fw_log_firmware_info) in archive vmlinux.a

Quoted 7 lines

Rework this to use the usual 'select' from the driver module, to respect the built-in vs module dependencies, and add a more verbose crypto dependency to the debug option to prevent configurations that lead to a link failure.

Fixes 02fe26f25325 ("firmware_loader: Add debug message with checksum for FW file")

Luis