lkml.org 
[lkml]   [2012]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH] dmi: Feed DMI table to /dev/random driver
Send the entire DMI (SMBIOS) table to the /dev/random driver to
help seed its pools.

Signed-off-by: Tony Luck <tony.luck@intel.com>
---

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 <linux/dmi.h>
#include <linux/efi.h>
#include <linux/bootmem.h>
+#include <linux/random.h>
#include <asm/dmi.h>

/*
@@ -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


\
 
 \ /
  Last update: 2012-07-20 23:21    [W:0.228 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site