aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Biggers <[email protected]>2021-01-12 11:28:18 -0800
committerGreg Kroah-Hartman <[email protected]>2021-02-04 16:59:02 +0100
commit11a0b5e0ec8c13bef06f7414f9e914506140d5cb (patch)
tree7a023fe157df59956311db2a0c7cc673ea602c04
parenta74ab2ed0def52a993d0cbd9df9d1c4de33c6fbd (diff)
random: fix the RNDRESEEDCRNG ioctl
The RNDRESEEDCRNG ioctl reseeds the primary_crng from itself, which doesn't make sense. Reseed it from the input_pool instead. Fixes: d848e5f8e1eb ("random: add new ioctl RNDRESEEDCRNG") Cc: [email protected] Cc: [email protected] Cc: Andy Lutomirski <[email protected]> Cc: Jann Horn <[email protected]> Cc: Theodore Ts'o <[email protected]> Reviewed-by: Jann Horn <[email protected]> Acked-by: Ard Biesheuvel <[email protected]> Signed-off-by: Eric Biggers <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/char/random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 5f3b8ac9d97b..a894c0559a8c 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1972,7 +1972,7 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
return -EPERM;
if (crng_init < 2)
return -ENODATA;
- crng_reseed(&primary_crng, NULL);
+ crng_reseed(&primary_crng, &input_pool);
crng_global_init_time = jiffies - 1;
return 0;
default: