* [PATCH] crypto: loongson - Select CRYPTO_RNG
@ 2026-05-22 2:25 Eric Biggers
2026-05-22 2:52 ` Huacai Chen
0 siblings, 1 reply; 7+ messages in thread
From: Eric Biggers @ 2026-05-22 2:25 UTC (permalink / raw)
To: linux-crypto, Herbert Xu
Cc: linux-kernel, loongarch, Huacai Chen, Qunqin Zhao, Yinggang Gu,
Lee Jones, Eric Biggers, kernel test robot, stable
This driver registers a rng_alg, so it requires CRYPTO_RNG.
Fixes: 766b2d724c8d ("crypto: loongson - add Loongson RNG driver support")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202605201622.qWOiiZTV-lkp@intel.com/
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
---
drivers/crypto/loongson/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/crypto/loongson/Kconfig b/drivers/crypto/loongson/Kconfig
index 15475da8fc11..f4e1544ffbb4 100644
--- a/drivers/crypto/loongson/Kconfig
+++ b/drivers/crypto/loongson/Kconfig
@@ -1,5 +1,6 @@
config CRYPTO_DEV_LOONGSON_RNG
tristate "Support for Loongson RNG Driver"
depends on MFD_LOONGSON_SE
+ select CRYPTO_RNG
help
Support for Loongson RNG Driver.
base-commit: 6c9dddeb582fde005360f4fe02c760d45ca05fb5
--
2.54.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] crypto: loongson - Select CRYPTO_RNG 2026-05-22 2:25 [PATCH] crypto: loongson - Select CRYPTO_RNG Eric Biggers @ 2026-05-22 2:52 ` Huacai Chen 2026-05-22 2:57 ` Eric Biggers 0 siblings, 1 reply; 7+ messages in thread From: Huacai Chen @ 2026-05-22 2:52 UTC (permalink / raw) To: Eric Biggers Cc: linux-crypto, Herbert Xu, linux-kernel, loongarch, Qunqin Zhao, Yinggang Gu, Lee Jones, kernel test robot, stable On Fri, May 22, 2026 at 10:26 AM Eric Biggers <ebiggers@kernel.org> wrote: > > This driver registers a rng_alg, so it requires CRYPTO_RNG. > > Fixes: 766b2d724c8d ("crypto: loongson - add Loongson RNG driver support") > Reported-by: kernel test robot <lkp@intel.com> > Closes: https://lore.kernel.org/oe-kbuild-all/202605201622.qWOiiZTV-lkp@intel.com/ > Cc: stable@vger.kernel.org > Signed-off-by: Eric Biggers <ebiggers@kernel.org> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> > --- > drivers/crypto/loongson/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/crypto/loongson/Kconfig b/drivers/crypto/loongson/Kconfig > index 15475da8fc11..f4e1544ffbb4 100644 > --- a/drivers/crypto/loongson/Kconfig > +++ b/drivers/crypto/loongson/Kconfig > @@ -1,5 +1,6 @@ > config CRYPTO_DEV_LOONGSON_RNG > tristate "Support for Loongson RNG Driver" > depends on MFD_LOONGSON_SE > + select CRYPTO_RNG > help > Support for Loongson RNG Driver. > > base-commit: 6c9dddeb582fde005360f4fe02c760d45ca05fb5 > -- > 2.54.0 > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] crypto: loongson - Select CRYPTO_RNG 2026-05-22 2:52 ` Huacai Chen @ 2026-05-22 2:57 ` Eric Biggers 2026-05-22 3:41 ` Qunqin Zhao 0 siblings, 1 reply; 7+ messages in thread From: Eric Biggers @ 2026-05-22 2:57 UTC (permalink / raw) To: Huacai Chen Cc: linux-crypto, Herbert Xu, linux-kernel, loongarch, Qunqin Zhao, Yinggang Gu, Lee Jones, kernel test robot, stable On Fri, May 22, 2026 at 10:52:42AM +0800, Huacai Chen wrote: > On Fri, May 22, 2026 at 10:26 AM Eric Biggers <ebiggers@kernel.org> wrote: > > > > This driver registers a rng_alg, so it requires CRYPTO_RNG. > > > > Fixes: 766b2d724c8d ("crypto: loongson - add Loongson RNG driver support") > > Reported-by: kernel test robot <lkp@intel.com> > > Closes: https://lore.kernel.org/oe-kbuild-all/202605201622.qWOiiZTV-lkp@intel.com/ > > Cc: stable@vger.kernel.org > > Signed-off-by: Eric Biggers <ebiggers@kernel.org> > Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> > > --- > > drivers/crypto/loongson/Kconfig | 1 + > > 1 file changed, 1 insertion(+) > > By the way, do any of the loongson people have any comment on what they think the point of this driver is? It's not registered with the actual hwrng subsystem, but rather the pointless crypto_rng system which no one uses. So if it was intended to provide entropy for /dev/urandom etc., that isn't what it's doing. Can we just delete this driver? - Eric ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] crypto: loongson - Select CRYPTO_RNG 2026-05-22 2:57 ` Eric Biggers @ 2026-05-22 3:41 ` Qunqin Zhao 2026-05-22 4:03 ` Eric Biggers 0 siblings, 1 reply; 7+ messages in thread From: Qunqin Zhao @ 2026-05-22 3:41 UTC (permalink / raw) To: Eric Biggers, Huacai Chen Cc: linux-crypto, Herbert Xu, linux-kernel, loongarch, Yinggang Gu, Lee Jones, kernel test robot, stable 在 2026/5/22 上午10:57, Eric Biggers 写道: > On Fri, May 22, 2026 at 10:52:42AM +0800, Huacai Chen wrote: >> On Fri, May 22, 2026 at 10:26 AM Eric Biggers <ebiggers@kernel.org> wrote: >>> This driver registers a rng_alg, so it requires CRYPTO_RNG. >>> >>> Fixes: 766b2d724c8d ("crypto: loongson - add Loongson RNG driver support") >>> Reported-by: kernel test robot <lkp@intel.com> >>> Closes: https://lore.kernel.org/oe-kbuild-all/202605201622.qWOiiZTV-lkp@intel.com/ >>> Cc: stable@vger.kernel.org >>> Signed-off-by: Eric Biggers <ebiggers@kernel.org> >> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> >>> --- >>> drivers/crypto/loongson/Kconfig | 1 + >>> 1 file changed, 1 insertion(+) >>> > By the way, do any of the loongson people have any comment on what they > think the point of this driver is? It's not registered with the actual To provide an AF_ALG-based random number generation interface for other modules and user-space programs. Thanks, Qunqin > hwrng subsystem, but rather the pointless crypto_rng system which no one > uses. So if it was intended to provide entropy for /dev/urandom etc., > that isn't what it's doing. > > Can we just delete this driver? > > - Eric ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] crypto: loongson - Select CRYPTO_RNG 2026-05-22 3:41 ` Qunqin Zhao @ 2026-05-22 4:03 ` Eric Biggers 2026-05-22 6:40 ` Qunqin Zhao 0 siblings, 1 reply; 7+ messages in thread From: Eric Biggers @ 2026-05-22 4:03 UTC (permalink / raw) To: Qunqin Zhao Cc: Huacai Chen, linux-crypto, Herbert Xu, linux-kernel, loongarch, Yinggang Gu, Lee Jones, kernel test robot, stable On Fri, May 22, 2026 at 11:41:15AM +0800, Qunqin Zhao wrote: > > 在 2026/5/22 上午10:57, Eric Biggers 写道: > > On Fri, May 22, 2026 at 10:52:42AM +0800, Huacai Chen wrote: > > > On Fri, May 22, 2026 at 10:26 AM Eric Biggers <ebiggers@kernel.org> wrote: > > > > This driver registers a rng_alg, so it requires CRYPTO_RNG. > > > > > > > > Fixes: 766b2d724c8d ("crypto: loongson - add Loongson RNG driver support") > > > > Reported-by: kernel test robot <lkp@intel.com> > > > > Closes: https://lore.kernel.org/oe-kbuild-all/202605201622.qWOiiZTV-lkp@intel.com/ > > > > Cc: stable@vger.kernel.org > > > > Signed-off-by: Eric Biggers <ebiggers@kernel.org> > > > Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> > > > > --- > > > > drivers/crypto/loongson/Kconfig | 1 + > > > > 1 file changed, 1 insertion(+) > > > > > > By the way, do any of the loongson people have any comment on what they > > think the point of this driver is? It's not registered with the actual > > To provide an AF_ALG-based random number generation interface for other > modules and user-space programs. > > Thanks, > > Qunqin AF_ALG is a userspace interface; it's not available for in-kernel use. If you mean using crypto_rng directly, note that no kernel code actually uses it other than the tests, the implementation of AF_ALG, and the FIPS-specific code which uses drbg.c specifically. So, the first half of your justification doesn't make any sense. As far as the second half: why would a userspace program do that instead of just using the regular Linux RNG (/dev/urandom)? AFAIK, the only reason to use a HW RNG directly is for certification reasons. However, there's also already an interface for that: /dev/hw_random. So AF_ALG seems completely redundant for this case. - Eric ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] crypto: loongson - Select CRYPTO_RNG 2026-05-22 4:03 ` Eric Biggers @ 2026-05-22 6:40 ` Qunqin Zhao 2026-05-22 17:48 ` Eric Biggers 0 siblings, 1 reply; 7+ messages in thread From: Qunqin Zhao @ 2026-05-22 6:40 UTC (permalink / raw) To: Eric Biggers Cc: Huacai Chen, linux-crypto, Herbert Xu, linux-kernel, loongarch, Yinggang Gu, Lee Jones, kernel test robot, stable 在 2026/5/22 下午12:03, Eric Biggers 写道: > On Fri, May 22, 2026 at 11:41:15AM +0800, Qunqin Zhao wrote: >> 在 2026/5/22 上午10:57, Eric Biggers 写道: >>> On Fri, May 22, 2026 at 10:52:42AM +0800, Huacai Chen wrote: >>>> On Fri, May 22, 2026 at 10:26 AM Eric Biggers <ebiggers@kernel.org> wrote: >>>>> This driver registers a rng_alg, so it requires CRYPTO_RNG. >>>>> >>>>> Fixes: 766b2d724c8d ("crypto: loongson - add Loongson RNG driver support") >>>>> Reported-by: kernel test robot <lkp@intel.com> >>>>> Closes: https://lore.kernel.org/oe-kbuild-all/202605201622.qWOiiZTV-lkp@intel.com/ >>>>> Cc: stable@vger.kernel.org >>>>> Signed-off-by: Eric Biggers <ebiggers@kernel.org> >>>> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> >>>>> --- >>>>> drivers/crypto/loongson/Kconfig | 1 + >>>>> 1 file changed, 1 insertion(+) >>>>> >>> By the way, do any of the loongson people have any comment on what they >>> think the point of this driver is? It's not registered with the actual >> To provide an AF_ALG-based random number generation interface for other >> modules and user-space programs. >> >> Thanks, >> >> Qunqin > AF_ALG is a userspace interface; it's not available for in-kernel use. > If you mean using crypto_rng directly, note that no kernel code actually > uses it other than the tests, the implementation of AF_ALG, and the > FIPS-specific code which uses drbg.c specifically. > > So, the first half of your justification doesn't make any sense. > > As far as the second half: why would a userspace program do that instead > of just using the regular Linux RNG (/dev/urandom)? > > AFAIK, the only reason to use a HW RNG directly is for certification > reasons. > > However, there's also already an interface for that: /dev/hw_random. > > So AF_ALG seems completely redundant for this case. To be honest, I previously assumed that the `hw_random` was designed strictly and exclusively for the TRNG mode. Is it architecturally acceptable or common practice for a PRNG mode to utilize `hw_random` as well? Thanks, Qunqin > > - Eric ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] crypto: loongson - Select CRYPTO_RNG 2026-05-22 6:40 ` Qunqin Zhao @ 2026-05-22 17:48 ` Eric Biggers 0 siblings, 0 replies; 7+ messages in thread From: Eric Biggers @ 2026-05-22 17:48 UTC (permalink / raw) To: Qunqin Zhao Cc: Huacai Chen, linux-crypto, Herbert Xu, linux-kernel, loongarch, Yinggang Gu, Lee Jones, kernel test robot, stable On Fri, May 22, 2026 at 02:40:38PM +0800, Qunqin Zhao wrote: > > 在 2026/5/22 下午12:03, Eric Biggers 写道: > > On Fri, May 22, 2026 at 11:41:15AM +0800, Qunqin Zhao wrote: > > > 在 2026/5/22 上午10:57, Eric Biggers 写道: > > > > On Fri, May 22, 2026 at 10:52:42AM +0800, Huacai Chen wrote: > > > > > On Fri, May 22, 2026 at 10:26 AM Eric Biggers <ebiggers@kernel.org> wrote: > > > > > > This driver registers a rng_alg, so it requires CRYPTO_RNG. > > > > > > > > > > > > Fixes: 766b2d724c8d ("crypto: loongson - add Loongson RNG driver support") > > > > > > Reported-by: kernel test robot <lkp@intel.com> > > > > > > Closes: https://lore.kernel.org/oe-kbuild-all/202605201622.qWOiiZTV-lkp@intel.com/ > > > > > > Cc: stable@vger.kernel.org > > > > > > Signed-off-by: Eric Biggers <ebiggers@kernel.org> > > > > > Reviewed-by: Huacai Chen <chenhuacai@loongson.cn> > > > > > > --- > > > > > > drivers/crypto/loongson/Kconfig | 1 + > > > > > > 1 file changed, 1 insertion(+) > > > > > > > > > > By the way, do any of the loongson people have any comment on what they > > > > think the point of this driver is? It's not registered with the actual > > > To provide an AF_ALG-based random number generation interface for other > > > modules and user-space programs. > > > > > > Thanks, > > > > > > Qunqin > > AF_ALG is a userspace interface; it's not available for in-kernel use. > > If you mean using crypto_rng directly, note that no kernel code actually > > uses it other than the tests, the implementation of AF_ALG, and the > > FIPS-specific code which uses drbg.c specifically. > > > > So, the first half of your justification doesn't make any sense. > > > > As far as the second half: why would a userspace program do that instead > > of just using the regular Linux RNG (/dev/urandom)? Could you answer this question? If there's no answer to this question, then there's no use case for this driver as-is. > > AFAIK, the only reason to use a HW RNG directly is for certification > > reasons. > > > > However, there's also already an interface for that: /dev/hw_random. > > > > So AF_ALG seems completely redundant for this case. > > To be honest, I previously assumed that the `hw_random` was designed > strictly and exclusively for the TRNG mode. > > Is it architecturally acceptable or common practice for a PRNG mode to > utilize `hw_random` as well? > > Thanks, So the Loongson RNG is a PRNG? Where does it get its entropy from, and what is its security strength? - Eric ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-05-22 17:48 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-05-22 2:25 [PATCH] crypto: loongson - Select CRYPTO_RNG Eric Biggers 2026-05-22 2:52 ` Huacai Chen 2026-05-22 2:57 ` Eric Biggers 2026-05-22 3:41 ` Qunqin Zhao 2026-05-22 4:03 ` Eric Biggers 2026-05-22 6:40 ` Qunqin Zhao 2026-05-22 17:48 ` Eric Biggers
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox