[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YhL527P1sEjpu3R2@sol.localdomain>
Date: Sun, 20 Feb 2022 18:32:59 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: Dominik Brodowski <linux@...inikbrodowski.net>
Cc: "Jason A . Donenfeld" <Jason@...c4.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org
Subject: Re: [PATCH 1/2] random: fix locking in crng_fast_load()
On Sat, Feb 05, 2022 at 11:34:57AM +0100, Dominik Brodowski wrote:
> crng_init is protected by primary_crng->lock, so keep holding that lock
> when incrementing crng_init from 0 to 1 in crng_fast_load(). The call to
> pr_notice() can wait until the lock is released; this code path cannot
> be reached twice, as crng_fast_load() aborts early if crng_init > 0.
>
> Signed-off-by: Dominik Brodowski <linux@...inikbrodowski.net>
> ---
> drivers/char/random.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Eric Biggers <ebiggers@...gle.com>
- Eric
Powered by blists - more mailing lists