All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: linux-kernel@vger.kernel.org, linux@dominikbrodowski.net,
	Theodore Ts'o <tytso@mit.edu>
Subject: Re: [PATCH 2/3] random: check for crng_init == 0, not crng_ready() in add_device_randomness()
Date: Sun, 20 Feb 2022 21:38:08 -0800	[thread overview]
Message-ID: <YhMlQEDbbPHGXMSc@sol.localdomain> (raw)
In-Reply-To: <20220212231022.679926-3-Jason@zx2c4.com>

On Sun, Feb 13, 2022 at 12:10:21AM +0100, Jason A. Donenfeld wrote:
> This has no real functional change, as crng_pre_init_inject() (and
> before that, crng_slow_init()) always checks for == 0, not >= 2. So
> correct the outer unlocked change to reflect that.
> 
> Cc: Dominik Brodowski <linux@dominikbrodowski.net>
> Cc: Theodore Ts'o <tytso@mit.edu>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
>  drivers/char/random.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/char/random.c b/drivers/char/random.c
> index a128bb947bd4..9a8e1bb9845d 100644
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -1007,7 +1007,7 @@ void add_device_randomness(const void *buf, size_t size)
>  	unsigned long time = random_get_entropy() ^ jiffies;
>  	unsigned long flags;
>  
> -	if (!crng_ready() && size)
> +	if (crng_init == 0 && size)
>  		crng_pre_init_inject(buf, size, false, false);
>  
>  	spin_lock_irqsave(&input_pool.lock, flags);
> -- 
> 2.35.0
> 

Reviewed-by: Eric Biggers <ebiggers@google.com>

- Eric

  parent reply	other threads:[~2022-02-21  5:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-12 23:10 [PATCH 0/3] cleanup init-time fast/slow key loading Jason A. Donenfeld
2022-02-12 23:10 ` [PATCH 1/3] random: unify early init crng load accounting Jason A. Donenfeld
2022-02-13  6:55   ` Dominik Brodowski
2022-02-13 10:56     ` Jason A. Donenfeld
2022-02-21  5:50   ` Eric Biggers
2022-02-21 15:22     ` Jason A. Donenfeld
2022-02-12 23:10 ` [PATCH 2/3] random: check for crng_init == 0, not crng_ready() in add_device_randomness() Jason A. Donenfeld
2022-02-13  6:55   ` Dominik Brodowski
2022-02-21  5:38   ` Eric Biggers [this message]
2022-02-12 23:10 ` [PATCH 3/3] random: use trylock in irq handler rather than spinning Jason A. Donenfeld
2022-02-13  6:55   ` Dominik Brodowski
2022-02-13 10:51     ` Jason A. Donenfeld

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=YhMlQEDbbPHGXMSc@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=Jason@zx2c4.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=tytso@mit.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.