linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan McDowell <noodles@earth.li>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Olivia Mackall <olivia@selenic.com>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-integrity@vger.kernel.org
Subject: Re: [PATCH v2] hwrng: core - Allow runtime disabling of the HW RNG
Date: Tue, 23 Sep 2025 09:48:28 +0100	[thread overview]
Message-ID: <aNJe3HZHG2uiXNAx@earth.li> (raw)
In-Reply-To: <aNIXUADMpZWo0iFz@gondor.apana.org.au>

On Tue, Sep 23, 2025 at 11:43:12AM +0800, Herbert Xu wrote:
>On Mon, Sep 15, 2025 at 05:02:15PM +0100, Jonathan McDowell wrote:
>>
>> diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
>> index 018316f54621..1682a9f1b28c 100644
>> --- a/drivers/char/hw_random/core.c
>> +++ b/drivers/char/hw_random/core.c
>> @@ -341,6 +341,10 @@ static ssize_t rng_current_store(struct device *dev,
>>  	if (sysfs_streq(buf, "")) {
>>  		err = enable_best_rng();
>> +	} else if (sysfs_streq(buf, "none")) {
>> +		if (current_rng)
>> +			cur_rng_set_by_user = 1;
>
>Shouldn't this be set unconditionally?

Yes, I guess so. I'd been guided by enable_best_rng() which only clears 
it if it changes the current RNG, but re-reading I agree that's probably 
the wrong thing here.

J.

-- 
101 things you can't have too much of : 16 - Time.

  reply	other threads:[~2025-09-23  8:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 13:55 [PATCH] hwrng: core - Allow runtime disabling of the HW RNG Jonathan McDowell
2025-09-13  3:56 ` Herbert Xu
2025-09-13 14:08   ` Jonathan McDowell
2025-09-15 16:02 ` [PATCH v2] " Jonathan McDowell
2025-09-23  3:43   ` Herbert Xu
2025-09-23  8:48     ` Jonathan McDowell [this message]
2025-09-23 13:33   ` [PATCH v3] " Jonathan McDowell
2025-10-17  8:17     ` Herbert Xu

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=aNJe3HZHG2uiXNAx@earth.li \
    --to=noodles@earth.li \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olivia@selenic.com \
    /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;
as well as URLs for NNTP newsgroup(s).