mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] random: give sysctl_random_min_urandom_seed a more sensible value
@ 2022-02-28 13:37 Jason A. Donenfeld
  2022-02-28 13:37 ` [PATCH 2/2] random: don't let 644 read-only sysctls be written to Jason A. Donenfeld
  2022-03-01  5:14 ` [PATCH 1/2] random: give sysctl_random_min_urandom_seed a more sensible value Dominik Brodowski
  0 siblings, 2 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2022-02-28 13:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jason A. Donenfeld, Dominik Brodowski, Theodore Ts'o

This isn't used by anything or anywhere, but we can't delete it due to
compatibility. So at least give it the correct value of what it's
supposed to be instead of a garbage one.

Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 drivers/char/random.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 8171c3bbf460..116ebf50d791 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1619,7 +1619,7 @@ const struct file_operations urandom_fops = {
  *   to avoid breaking old userspaces, but writing to it does not
  *   change any behavior of the RNG.
  *
- * - urandom_min_reseed_secs - fixed to the meaningless value "60".
+ * - urandom_min_reseed_secs - fixed to the value CRNG_RESEED_INTERVAL.
  *   It is writable to avoid breaking old userspaces, but writing
  *   to it does not change any behavior of the RNG.
  *
@@ -1629,7 +1629,7 @@ const struct file_operations urandom_fops = {
 
 #include <linux/sysctl.h>
 
-static int sysctl_random_min_urandom_seed = 60;
+static int sysctl_random_min_urandom_seed = CRNG_RESEED_INTERVAL / HZ;
 static int sysctl_random_write_wakeup_bits = POOL_MIN_BITS;
 static int sysctl_poolsize = POOL_BITS;
 static u8 sysctl_bootid[UUID_SIZE];
-- 
2.35.1


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

end of thread, other threads:[~2022-03-01  5:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 13:37 [PATCH 1/2] random: give sysctl_random_min_urandom_seed a more sensible value Jason A. Donenfeld
2022-02-28 13:37 ` [PATCH 2/2] random: don't let 644 read-only sysctls be written to Jason A. Donenfeld
2022-03-01  5:16   ` Dominik Brodowski
2022-03-01  5:14 ` [PATCH 1/2] random: give sysctl_random_min_urandom_seed a more sensible value Dominik Brodowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®