Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760374AbaGPRqZ (ORCPT ); Wed, 16 Jul 2014 13:46:25 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:52865 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760129AbaGPRqU (ORCPT ); Wed, 16 Jul 2014 13:46:20 -0400 From: Andy Lutomirski To: kvm@vger.kernel.org, "H. Peter Anvin" , "Theodore Ts'o" , linux-kernel@vger.kernel.org, Kees Cook , x86@kernel.org Cc: Daniel Borkmann , Srivatsa Vaddagiri , Raghavendra K T , Gleb Natapov , Paolo Bonzini , Andy Lutomirski Subject: [PATCH v2 3/5] random: Seed pools from arch_get_slow_rng_u64 at startup Date: Wed, 16 Jul 2014 10:45:58 -0700 Message-Id: X-Mailer: git-send-email 1.9.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This should help solve the problem of guests starting out with predictable RNG state. Signed-off-by: Andy Lutomirski --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/