* [PATCH] drbd: select CRYPTO and CRYPTO_HASH
@ 2026-11-11 8:35 Christoph Böhmwalder
2026-11-11 21:22 ` Eric Biggers
0 siblings, 1 reply; 2+ messages in thread
From: Christoph Böhmwalder @ 2026-11-11 8:35 UTC (permalink / raw)
To: Jens Axboe
Cc: drbd-dev, linux-kernel, Lars Ellenberg, Philipp Reisner,
linux-block, Christoph Böhmwalder
DRBD uses the shash API for the data integrity, online verify and
checksum-based resync algorithms and for peer authentication, but
BLK_DEV_DRBD does not select the crypto core. With CRYPTO=n, a kernel
with DRBD built in does not link:
ld: drbd_sender.c:(.text+0x137f): undefined reference to `crypto_shash_finup'
ld: drbd_receiver.c:(.text+0x58f): undefined reference to `crypto_alloc_shash'
Select CRYPTO and CRYPTO_HASH.
Fixes: b411b3637fa7 ("The DRBD driver")
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
---
drivers/block/drbd/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/block/drbd/Kconfig b/drivers/block/drbd/Kconfig
index 495a72da04c6..d707187d2cec 100644
--- a/drivers/block/drbd/Kconfig
+++ b/drivers/block/drbd/Kconfig
@@ -11,6 +11,8 @@ config BLK_DEV_DRBD
depends on PROC_FS && INET
select LRU_CACHE
select CRC32
+ select CRYPTO
+ select CRYPTO_HASH
help
NOTE: In order to authenticate connections you have to select
base-commit: aa7014f8d7565cfea117eac36a5de0a05eba65a4
--
2.56.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drbd: select CRYPTO and CRYPTO_HASH
2026-11-11 8:35 [PATCH] drbd: select CRYPTO and CRYPTO_HASH Christoph Böhmwalder
@ 2026-11-11 21:22 ` Eric Biggers
0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2026-11-11 21:22 UTC (permalink / raw)
To: Christoph Böhmwalder
Cc: Jens Axboe, drbd-dev, linux-kernel, Lars Ellenberg,
Philipp Reisner, linux-block
On Wed, Nov 11, 2026 at 09:35:05AM +0100, Christoph Böhmwalder wrote:
> DRBD uses the shash API for the data integrity, online verify and
> checksum-based resync algorithms and for peer authentication, but
> BLK_DEV_DRBD does not select the crypto core. With CRYPTO=n, a kernel
> with DRBD built in does not link:
>
> ld: drbd_sender.c:(.text+0x137f): undefined reference to `crypto_shash_finup'
> ld: drbd_receiver.c:(.text+0x58f): undefined reference to `crypto_alloc_shash'
>
> Select CRYPTO and CRYPTO_HASH.
>
> Fixes: b411b3637fa7 ("The DRBD driver")
> Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Looks fine for now, but you should consider what algorithms DRBD
actually needs and consider switching to the library APIs for those
instead of crypto_shash. Presumably not more than a handful are
actually used in practice with DRBD, and you don't really need to keep
"supporting" MD4, Whirlpool, RIPEMD, CMAC-SM4, etc.?
The "pass arbitrary string from userspace to crypto_alloc_*()" strategy
has been problematic for other kernel features using it. For one, it
gives access to algorithms that are obsolete, insecure, redundant or
make no sense for the use case. And it makes it more difficult to
remove unused algorithms from the crypto API, since it makes it harder
to prove that they are in fact unused.
Note that the crypto_shash API is also somewhat inefficient and
difficult to use correctly, even though it's better than crypto_ahash.
(And the DRBD driver got it wrong, so just FYI, you should expect fixes
if you keep using it...).
- Eric
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-11 21:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 8:35 [PATCH] drbd: select CRYPTO and CRYPTO_HASH Christoph Böhmwalder
2026-11-11 21:22 ` Eric Biggers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®