summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorGreg Price <price@MIT.EDU>2013-12-06 01:19:29 +0100
committerTheodore Ts'o <tytso@mit.edu>2014-03-20 03:18:51 +0100
commit8c2aa3390ebb59cba4495a56557b70ad0575eef5 (patch)
treed84aea5260ad2eacc88f96f4f3fb9097a32f7bf5 /drivers/char
parentrandom: forget lock in lockless accounting (diff)
downloadlinux-8c2aa3390ebb59cba4495a56557b70ad0575eef5.tar.xz
linux-8c2aa3390ebb59cba4495a56557b70ad0575eef5.zip
random: tighten bound on random_read_wakeup_thresh
We use this value in a few places other than its literal meaning, in particular in _xfer_secondary_pool() as a minimum number of bits to pull from the input pool at a time into either output pool. It doesn't make sense to pull more bits than the whole size of an output pool. We could and possibly should separate the quantities "how much should the input pool have to have to wake up /dev/random readers" and "how much should we transfer from the input to an output pool at a time", but nobody is likely to be sad they can't set the first quantity to more than 1024 bits, so for now just limit them both. Signed-off-by: Greg Price <price@mit.edu> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 694510af4fcd..70b8ebf08edd 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1490,7 +1490,7 @@ EXPORT_SYMBOL(generate_random_uuid);
#include <linux/sysctl.h>
static int min_read_thresh = 8, min_write_thresh;
-static int max_read_thresh = INPUT_POOL_WORDS * 32;
+static int max_read_thresh = OUTPUT_POOL_WORDS * 32;
static int max_write_thresh = INPUT_POOL_WORDS * 32;
static char sysctl_bootid[16];