[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c2750e64d318e44bca34ae792edc976e0e6990eb.1405532533.git.luto@amacapital.net>
Date: Wed, 16 Jul 2014 10:45:58 -0700
From: Andy Lutomirski <luto@...capital.net>
To: kvm@...r.kernel.org, "H. Peter Anvin" <hpa@...or.com>,
Theodore Ts'o <tytso@....edu>, linux-kernel@...r.kernel.org,
Kees Cook <keescook@...omium.org>, x86@...nel.org
Cc: Daniel Borkmann <dborkman@...hat.com>,
Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>,
Raghavendra K T <raghavendra.kt@...ux.vnet.ibm.com>,
Gleb Natapov <gleb@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Andy Lutomirski <luto@...capital.net>
Subject: [PATCH v2 3/5] random: Seed pools from arch_get_slow_rng_u64 at startup
This should help solve the problem of guests starting out with
predictable RNG state.
Signed-off-by: Andy Lutomirski <luto@...capital.net>
---
drivers/char/random.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 0a7ac0a..e2c3d02 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1261,6 +1261,14 @@ static void init_std_data(struct entropy_store *r)
mix_pool_bytes(r, &rv, sizeof(rv), NULL);
}
mix_pool_bytes(r, utsname(), sizeof(*(utsname())), NULL);
+
+ for (i = 0; i < 4; i++) {
+ u64 rv64;
+
+ if (arch_get_slow_rng_u64(&rv64))
+ mix_pool_bytes(r, &rv64, sizeof(rv64), NULL);
+ }
+ }
}
/*
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists