[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200916041908.66649-1-ebiggers@kernel.org>
Date: Tue, 15 Sep 2020 21:19:08 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Theodore Ts'o <tytso@....edu>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
Andy Lutomirski <luto@...nel.org>, Jann Horn <jannh@...gle.com>
Subject: [PATCH] random: fix the RNDRESEEDCRNG ioctl
From: Eric Biggers <ebiggers@...gle.com>
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: stable@...r.kernel.org
Signed-off-by: Eric Biggers <ebiggers@...gle.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 d20ba1b104ca3..a8b9e66f41435 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1973,7 +1973,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:
--
2.28.0
Powered by blists - more mailing lists