Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Qunqin Zhao <zhaoqunqin@loongson.cn>
Cc: Huacai Chen <chenhuacai@kernel.org>,
	linux-crypto@vger.kernel.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
	Yinggang Gu <guyinggang@loongson.cn>, Lee Jones <lee@kernel.org>,
	kernel test robot <lkp@intel.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] crypto: loongson - Select CRYPTO_RNG
Date: Thu, 21 May 2026 23:03:10 -0500	[thread overview]
Message-ID: <20260522040310.GF5937@quark> (raw)
In-Reply-To: <d71adfa1-8895-e741-b72f-c5e99d5fb9e6@loongson.cn>

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

  reply	other threads:[~2026-05-22  4:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2026-05-22  6:40         ` Qunqin Zhao
2026-05-22 17:48           ` Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260522040310.GF5937@quark \
    --to=ebiggers@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=guyinggang@loongson.cn \
    --cc=herbert@gondor.apana.org.au \
    --cc=lee@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=loongarch@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=zhaoqunqin@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox