From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752901Ab2GTUk6 (ORCPT ); Fri, 20 Jul 2012 16:40:58 -0400 Received: from mga03.intel.com ([143.182.124.21]:14375 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751908Ab2GTUk5 (ORCPT ); Fri, 20 Jul 2012 16:40:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="170961217" From: Tony Luck Date: Fri, 20 Jul 2012 13:15:20 -0700 Subject: [PATCH] dmi: Feed DMI table to /dev/random driver In-Reply-To: <1341511933-11169-1-git-send-email-tytso@mit.edu> To: "Theodore Ts'o" Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, w@1wt.eu, ewust@umich.edu, zakir@umich.edu, greg@kroah.com, mpm@selenic.com, nadiah@cs.ucsd.edu, jhalderm@umich.edu, tglx@linutronix.de, davem@davemloft.net, "Theodore Ts'o" Message-Id: <0107910@agluck-desktop.sc.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Send the entire DMI (SMBIOS) table to the /dev/random driver to help seed its pools. Signed-off-by: Tony Luck --- This looks a useful addition to your /dev/random series. There are lots of platform specific goodies in this table (BIOS version, system serial number and UUID, count and version number of processors, DIMM slot population and serial numbers, etc.) On the system I tested the patch on the table is 9866 bytes. Is it OK to dump that much into add_device_randomness() in one shot? The alternative is to select the 'useful' bits deeper into the routines that parse the entries in the table. drivers/firmware/dmi_scan.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 153980b..b298158 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -6,6 +6,7 @@ #include #include #include +#include #include /* @@ -111,6 +112,8 @@ static int __init dmi_walk_early(void (*decode)(const struct dmi_header *, dmi_table(buf, dmi_len, dmi_num, decode, NULL); + add_device_randomness(buf, dmi_len); + dmi_iounmap(buf, dmi_len); return 0; } -- 1.7.10.2.552.gaa3bb87