mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: linux-kernel@vger.kernel.org, linux@dominikbrodowski.net
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>, Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 9/9] random: group sysctl functions
Date: Fri, 11 Feb 2022 13:35:46 +0100	[thread overview]
Message-ID: <20220211123546.474952-10-Jason@zx2c4.com> (raw)
In-Reply-To: <20220211123546.474952-1-Jason@zx2c4.com>

This pulls all of the sysctl-focused functions into the sixth labeled
section.

No functional changes.

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

diff --git a/drivers/char/random.c b/drivers/char/random.c
index a4229474d7fa..bff77654910c 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1537,7 +1537,25 @@ const struct file_operations urandom_fops = {
 
 /********************************************************************
  *
- * Sysctl interface
+ * Sysctl interface.
+ *
+ * These are mostly unused legacy knobs with dummy values to not break
+ * userspace. Still in use, however, are:
+ *
+ * - /proc/sys/kernel/random/boot_id - a UUID representing the current
+ *   boot.
+ *
+ * - /proc/sys/kernel/random/uuid - a random UUID, fresh each time.
+ *
+ * - /proc/sys/kernel/random/poolsize - the total amount of entropy
+ *   that the input pool can hold.
+ *
+ * - /proc/sys/kernel/random/write_wakeup_threshold - the amount of
+ *   entropy in the input pool below which write polls to
+ *   /dev/random will unblock, requesting more entropy. This is
+ *   currently the same value as the previous "poolsize" sysctl. It
+ *   is writable to avoid breaking old userspaces, but writing to it
+ *   does not change any behavior of the RNG.
  *
  ********************************************************************/
 
@@ -1545,8 +1563,8 @@ const struct file_operations urandom_fops = {
 
 #include <linux/sysctl.h>
 
-static int random_min_urandom_seed = 60;
-static int random_write_wakeup_bits = POOL_MIN_BITS;
+static int sysctl_random_min_urandom_seed = 60;
+static int sysctl_random_write_wakeup_bits = POOL_MIN_BITS;
 static int sysctl_poolsize = POOL_BITS;
 static char sysctl_bootid[16];
 
@@ -1603,14 +1621,14 @@ static struct ctl_table random_table[] = {
 	},
 	{
 		.procname	= "write_wakeup_threshold",
-		.data		= &random_write_wakeup_bits,
+		.data		= &sysctl_random_write_wakeup_bits,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
 	},
 	{
 		.procname	= "urandom_min_reseed_secs",
-		.data		= &random_min_urandom_seed,
+		.data		= &sysctl_random_min_urandom_seed,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
@@ -1641,4 +1659,4 @@ static int __init random_sysctls_init(void)
 	return 0;
 }
 device_initcall(random_sysctls_init);
-#endif	/* CONFIG_SYSCTL */
+#endif
-- 
2.35.0


      parent reply	other threads:[~2022-02-11 12:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 12:35 [PATCH 0/9] random: re-group and re-document functions Jason A. Donenfeld
2022-02-11 12:35 ` [PATCH 1/9] random: introduce drain_entropy() helper to declutter crng_reseed() Jason A. Donenfeld
2022-02-11 12:35 ` [PATCH 2/9] random: remove useless header comment Jason A. Donenfeld
2022-02-11 12:35 ` [PATCH 3/9] random: rewrite header introductory comment Jason A. Donenfeld
2022-02-11 12:35 ` [PATCH 4/9] random: group initialization wait functions Jason A. Donenfeld
2022-02-11 12:35 ` [PATCH 5/9] random: group crng functions Jason A. Donenfeld
2022-02-11 12:35 ` [PATCH 6/9] random: group entropy extraction functions Jason A. Donenfeld
2022-02-11 12:35 ` [PATCH 7/9] random: group entropy collection functions Jason A. Donenfeld
2022-02-11 12:35 ` [PATCH 8/9] random: group userspace read/write functions Jason A. Donenfeld
2022-02-11 12:35 ` Jason A. Donenfeld [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220211123546.474952-10-Jason@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.net \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®