crypto: hisi-trng - Remove crypto_rng interface
Subsystems (2)
PATCH 1/1 crypto: hisi-trng - Remove crypto_rng interface
commit 216a7795ec210bdabd5dad42323eee70bbfc8d90 upstream.
drivers/crypto/hisilicon/trng/trng.c exposes the same hardware through two completely separate interfaces, crypto_rng and hwrng. However, the implementation of this is buggy because it permits generation operations from these interfaces to run concurrently with each other, accessing the same registers. That is, hisi_trng_generate() synchronizes with itself but not with hisi_trng_read(). This results in potential repetition of output from the RNG, output of non-random values, etc.
Fortunately, there's actually no point in hardware RNG drivers implementing the crypto_rng interface. It's not actually used by anything besides the "rng" algorithm type of AF_ALG, which in turn is not actually used in practice. Other crypto_rng hardware drivers are likewise being phased out, leaving just the hwrng support.
Thus, remove it to simplify the code and avoid conflict (and confusion) with the hwrng interface which is the one that actually matters.
--- drivers/crypto/hisilicon/Kconfig | 1 - drivers/crypto/hisilicon/trng/trng.c | 298 +-------------------------- 2 files changed, 2 insertions(+), 297 deletions(-)
drivers/crypto/hisilicon/Kconfig +0 -1
@@ -79,6 +79,5 @@ config CRYPTO_DEV_HISI_TRNG tristate "Support for HISI TRNG Driver" depends on ARM64 && ACPI select HW_RANDOM - select CRYPTO_RNG help Support for HiSilicon TRNG Driver.
drivers/crypto/hisilicon/trng/trng.c +2 -296
355 lines not on this page · raw message
base-commit: da47cbc254661aa66d61ef061485a7080305c4be
Signature · 1 line
2.55.0
Quoted 2 lines
drivers/crypto/hisilicon/trng/trng.cexposes the same hardware through two completely separate interfaces,crypto_rngand hwrng.
Queued for 6.6, 6.1, and 5.15, thanks.
Signature · 2 lines
Thanks, Sasha