[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YhMlQEDbbPHGXMSc@sol.localdomain>
Date: Sun, 20 Feb 2022 21:38:08 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: "Jason A. Donenfeld" <Jason@...c4.com>
Cc: linux-kernel@...r.kernel.org, linux@...inikbrodowski.net,
Theodore Ts'o <tytso@....edu>
Subject: Re: [PATCH 2/3] random: check for crng_init == 0, not crng_ready()
in add_device_randomness()
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@...inikbrodowski.net>
> Cc: Theodore Ts'o <tytso@....edu>
> Signed-off-by: Jason A. Donenfeld <Jason@...c4.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@...gle.com>
- Eric
Powered by blists - more mailing lists