diff options
author | Eric Biggers <ebiggers@google.com> | 2021-12-20 16:41:57 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2022-01-07 00:25:25 +0100 |
commit | 009ba8568be497c640cab7571f7bfd18345d7b24 (patch) | |
tree | 1adc5b2e17ac2cbce18f6a1cd2a42078225769bb /drivers/net/Kconfig | |
parent | 5d73d1e320c3fd94ea15ba5f79301da9a8bcc7de (diff) | |
download | linux-009ba8568be497c640cab7571f7bfd18345d7b24.tar.bz2 |
random: fix data race on crng init time
_extract_crng() does plain loads of crng->init_time and
crng_global_init_time, which causes undefined behavior if
crng_reseed() and RNDRESEEDCRNG modify these corrently.
Use READ_ONCE() and WRITE_ONCE() to make the behavior defined.
Don't fix the race on crng->init_time by protecting it with crng->lock,
since it's not a problem for duplicate reseedings to occur. I.e., the
lockless access with READ_ONCE() is fine.
Fixes: d848e5f8e1eb ("random: add new ioctl RNDRESEEDCRNG")
Fixes: e192be9d9a30 ("random: replace non-blocking pool with a Chacha20-based CRNG")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'drivers/net/Kconfig')
0 files changed, 0 insertions, 0 deletions