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 | 296 +-------------------------- 2 files changed, 2 insertions(+), 295 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 -294
353 lines not on this page · raw message
base-commit: 296aabce459470a4c1b68ffd0c0c0920e563aaad
Signature · 1 line
2.55.0
Quoted 5 lines
drivers/crypto/hisilicon/trng/trng.cexposes the same hardware through two completely separate interfaces,crypto_rngand 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.
Queued for 6.12, thanks.
Signature · 2 lines
Thanks, Sasha