Re: [PATCH] crypto: loongson - Remove broken and unused loongson-rng

From: Herbert Xu

Date: Thu Jun 11 2026 - 04:50:29 EST


On Fri, May 29, 2026 at 04:32:08PM -0700, Eric Biggers wrote:
> The loongson-rng rng_alg has several vulnerabilities, including not
> providing forward security, and a use-after-free bug due to the use of
> wait_for_completion_interruptible().
>
> Meanwhile, the rng_alg framework doesn't really have any purpose in the
> first place other than to access the software algorithms crypto/drbg.c
> and crypto/jitterentropy.c. Hardware-specific rng_algs have no
> in-kernel user, and unlike hwrng there's no feed into the actual Linux
> RNG. As such, there's really no point to this code. There are of
> course other rng_alg drivers that are similarly unused, but they're
> similarly in the process of being phased out, e.g.
> https://lore.kernel.org/r/20260529193648.18172-1-ebiggers@xxxxxxxxxx and
> https://lore.kernel.org/r/20260529220430.34135-1-ebiggers@xxxxxxxxxx
>
> Given that, there's no point in fixing forward these vulnerabilities,
> and it makes much more sense to simply roll back the addition of this
> driver. If this platform provides TRNG (not PRNG) functionality, it
> could make sense to add a hwrng driver, but it would be quite different.
>
> Link: https://lore.kernel.org/linux-crypto/20260525145939.GC2018@quark/
> Fixes: 766b2d724c8d ("crypto: loongson - add Loongson RNG driver support")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> ---
> MAINTAINERS | 1 -
> arch/loongarch/configs/loongson32_defconfig | 1 -
> arch/loongarch/configs/loongson64_defconfig | 1 -
> drivers/crypto/Kconfig | 1 -
> drivers/crypto/Makefile | 1 -
> drivers/crypto/loongson/Kconfig | 6 -
> drivers/crypto/loongson/Makefile | 1 -
> drivers/crypto/loongson/loongson-rng.c | 209 --------------------
> 8 files changed, 221 deletions(-)
> delete mode 100644 drivers/crypto/loongson/Kconfig
> delete mode 100644 drivers/crypto/loongson/Makefile
> delete mode 100644 drivers/crypto/loongson/loongson-rng.c

Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt