[PATCH 08/14] random: rate-limit reseeding only after properly seeded

From: Greg Price
Date: Sat Dec 14 2013 - 21:01:36 EST


Until then, we need all the entropy we can get. The "min_bytes"
logic takes care of making these reseeds catastrophic, and
reserving entropy for /dev/random isn't a priority in early boot.

Signed-off-by: Greg Price <price@xxxxxxx>
---
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 c2428ecb2..f55365696 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -907,7 +907,7 @@ static ssize_t extract_entropy(struct entropy_store *r, void *buf,
static void _xfer_secondary_pool(struct entropy_store *r, size_t nbytes);
static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes)
{
- if (r->limit == 0 && random_min_urandom_seed) {
+ if (r->limit == 0 && r->initialized && random_min_urandom_seed) {
unsigned long now = jiffies;

if (time_before(now,
--
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/