Message ID | 66b16acf2953fc033abc9641b9cf43d23e75a8e9.1568990048.git.luto@kernel.org |
---|---|
State | Not Applicable |
Headers | show |
Series | Rework random blocking | expand |
On Fri, Sep 20, 2019 at 4:37 PM Andy Lutomirski <luto@kernel.org> wrote: > It has no effect any more, so remove it. We can revert this if > there is some user code that expects to be able to set this sysctl. > > Signed-off-by: Andy Lutomirski <luto@kernel.org> > --- > drivers/char/random.c | 18 +----------------- > 1 file changed, 1 insertion(+), 17 deletions(-) > > diff --git a/drivers/char/random.c b/drivers/char/random.c [...] > - { > - .procname = "read_wakeup_threshold", There's a line in bin_random_table in kernel/sysctl_binary.c that refers to this sysctl, that should probably also be deleted?
Jann Horn <jannh@google.com> writes: > On Fri, Sep 20, 2019 at 4:37 PM Andy Lutomirski <luto@kernel.org> wrote: >> It has no effect any more, so remove it. We can revert this if >> there is some user code that expects to be able to set this sysctl. >> >> Signed-off-by: Andy Lutomirski <luto@kernel.org> >> --- >> drivers/char/random.c | 18 +----------------- >> 1 file changed, 1 insertion(+), 17 deletions(-) >> >> diff --git a/drivers/char/random.c b/drivers/char/random.c > [...] >> - { >> - .procname = "read_wakeup_threshold", > > There's a line in bin_random_table in kernel/sysctl_binary.c that > refers to this sysctl, that should probably also be deleted? I think it should be safe to leave in kernel/sysctl_binary.c This reminds me. I think we may finally be at a point where we can remove practically all of kernel/sysctl_binary.c I need to double check but last I looked no distro enables COINFIG_SYSCTL_SYSCALL anymore. Ubunutu was the last distro I know of that enabled it, and I think it has been a year or more since Ubuntu disabled CONFIG_SYSCTL_SYSCALL. Eric
diff --git a/drivers/char/random.c b/drivers/char/random.c index 99fea5cc29a8..2a284f30cac4 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -369,12 +369,6 @@ #define ENTROPY_SHIFT 3 #define ENTROPY_BITS(r) ((r)->entropy_count >> ENTROPY_SHIFT) -/* - * The minimum number of bits of entropy before we wake up a read on - * /dev/random. Should be enough to do a significant reseed. - */ -static int random_read_wakeup_bits = 64; - /* * If the entropy count falls under this number of bits, then we * should wake up processes which are selecting or polling on write @@ -1982,8 +1976,7 @@ SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count, #include <linux/sysctl.h> -static int min_read_thresh = 8, min_write_thresh; -static int max_read_thresh = OUTPUT_POOL_WORDS * 32; +static int min_write_thresh; static int max_write_thresh = INPUT_POOL_WORDS * 32; static int random_min_urandom_seed = 60; static char sysctl_bootid[16]; @@ -2058,15 +2051,6 @@ struct ctl_table random_table[] = { .proc_handler = proc_do_entropy, .data = &input_pool.entropy_count, }, - { - .procname = "read_wakeup_threshold", - .data = &random_read_wakeup_bits, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec_minmax, - .extra1 = &min_read_thresh, - .extra2 = &max_read_thresh, - }, { .procname = "write_wakeup_threshold", .data = &random_write_wakeup_bits,
It has no effect any more, so remove it. We can revert this if there is some user code that expects to be able to set this sysctl. Signed-off-by: Andy Lutomirski <luto@kernel.org> --- drivers/char/random.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-)