linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] random: fix the RNDRESEEDCRNG ioctl
@ 2020-09-16  4:19 Eric Biggers
  2020-10-07  3:50 ` Eric Biggers
  2020-10-07  4:20 ` Jann Horn
  0 siblings, 2 replies; 7+ messages in thread
From: Eric Biggers @ 2020-09-16  4:19 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: linux-crypto, linux-kernel, Andy Lutomirski, Jann Horn

From: Eric Biggers <ebiggers@google.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@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-12  0:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-16  4:19 [PATCH] random: fix the RNDRESEEDCRNG ioctl Eric Biggers
2020-10-07  3:50 ` Eric Biggers
2020-10-26 16:33   ` Eric Biggers
2020-11-20 18:52     ` Eric Biggers
2021-01-04 18:55       ` Eric Biggers
2021-01-12  0:04         ` Jann Horn
2020-10-07  4:20 ` Jann Horn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).