Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hw_random doc updates

Update documentation for the hw_random support to be current:

- Documentation/hw_random.txt has been updated to reflect the
current code: it's a framework now, a "core" with a small
sysfs interface, that hardware-specific drivers plug in to.
Text specific to Intel hardware is now at the end.

- Kconfig now references the Documentation/hw_random.txt file
and better explains what this really does.

Both chunks of documentation now higlight the fact that the kernel entropy
pool is maintained by "rngd", and this driver has nothing directly to do with
that important task.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Brownell and committed by
Linus Torvalds
537878d2 cb622bbb

+50 -22
+42 -21
Documentation/hw_random.txt
··· 1 - Hardware driver for Intel/AMD/VIA Random Number Generators (RNG) 2 - Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com> 3 - Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com> 4 - 5 1 Introduction: 6 2 7 - The hw_random device driver is software that makes use of a 3 + The hw_random framework is software that makes use of a 8 4 special hardware feature on your CPU or motherboard, 9 - a Random Number Generator (RNG). 5 + a Random Number Generator (RNG). The software has two parts: 6 + a core providing the /dev/hw_random character device and its 7 + sysfs support, plus a hardware-specific driver that plugs 8 + into that core. 10 9 11 - In order to make effective use of this device driver, you 10 + To make the most effective use of these mechanisms, you 12 11 should download the support software as well. Download the 13 12 latest version of the "rng-tools" package from the 14 13 hw_random driver's official Web site: 15 14 16 15 http://sourceforge.net/projects/gkernel/ 16 + 17 + Those tools use /dev/hw_random to fill the kernel entropy pool, 18 + which is used internally and exported by the /dev/urandom and 19 + /dev/random special files. 20 + 21 + Theory of operation: 22 + 23 + CHARACTER DEVICE. Using the standard open() 24 + and read() system calls, you can read random data from 25 + the hardware RNG device. This data is NOT CHECKED by any 26 + fitness tests, and could potentially be bogus (if the 27 + hardware is faulty or has been tampered with). Data is only 28 + output if the hardware "has-data" flag is set, but nevertheless 29 + a security-conscious person would run fitness tests on the 30 + data before assuming it is truly random. 31 + 32 + The rng-tools package uses such tests in "rngd", and lets you 33 + run them by hand with a "rngtest" utility. 34 + 35 + /dev/hw_random is char device major 10, minor 183. 36 + 37 + CLASS DEVICE. There is a /sys/class/misc/hw_random node with 38 + two unique attributes, "rng_available" and "rng_current". The 39 + "rng_available" attribute lists the hardware-specific drivers 40 + available, while "rng_current" lists the one which is currently 41 + connected to /dev/hw_random. If your system has more than one 42 + RNG available, you may change the one used by writing a name from 43 + the list in "rng_available" into "rng_current". 44 + 45 + ========================================================================== 46 + 47 + Hardware driver for Intel/AMD/VIA Random Number Generators (RNG) 48 + Copyright 2000,2001 Jeff Garzik <jgarzik@pobox.com> 49 + Copyright 2000,2001 Philipp Rumpf <prumpf@mandrakesoft.com> 50 + 17 51 18 52 About the Intel RNG hardware, from the firmware hub datasheet: 19 53 ··· 59 25 access to our RNG for use as a security feature. At this time, 60 26 the RNG is only to be used with a system in an OS-present state. 61 27 62 - Theory of operation: 63 - 64 - Character driver. Using the standard open() 65 - and read() system calls, you can read random data from 66 - the hardware RNG device. This data is NOT CHECKED by any 67 - fitness tests, and could potentially be bogus (if the 68 - hardware is faulty or has been tampered with). Data is only 69 - output if the hardware "has-data" flag is set, but nevertheless 70 - a security-conscious person would run fitness tests on the 71 - data before assuming it is truly random. 72 - 73 - /dev/hwrandom is char device major 10, minor 183. 74 - 75 - Driver notes: 28 + Intel RNG Driver notes: 76 29 77 30 * FIXME: support poll(2) 78 31
+8 -1
drivers/char/hw_random/Kconfig
··· 9 9 Hardware Random Number Generator Core infrastructure. 10 10 11 11 To compile this driver as a module, choose M here: the 12 - module will be called rng-core. 12 + module will be called rng-core. This provides a device 13 + that's usually called /dev/hw_random, and which exposes one 14 + of possibly several hardware random number generators. 15 + 16 + These hardware random number generators do not feed directly 17 + into the kernel's random number generator. That is usually 18 + handled by the "rngd" daemon. Documentation/hw_random.txt 19 + has more information. 13 20 14 21 If unsure, say Y. 15 22