Commit 537878d2c988fa12bbfaec19ee060c7603a48230

Authored by David Brownell
Committed by Linus Torvalds
1 parent cb622bbb69

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>

Showing 2 changed files with 48 additions and 20 deletions Side-by-side Diff

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/
17 16  
18   -About the Intel RNG hardware, from the firmware hub datasheet:
  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.
19 20  
20   - The Firmware Hub integrates a Random Number Generator (RNG)
21   - using thermal noise generated from inherently random quantum
22   - mechanical properties of silicon. When not generating new random
23   - bits the RNG circuitry will enter a low power state. Intel will
24   - provide a binary software driver to give third party software
25   - access to our RNG for use as a security feature. At this time,
26   - the RNG is only to be used with a system in an OS-present state.
27   -
28 21 Theory of operation:
29 22  
30   - Character driver. Using the standard open()
  23 + CHARACTER DEVICE. Using the standard open()
31 24 and read() system calls, you can read random data from
32 25 the hardware RNG device. This data is NOT CHECKED by any
33 26 fitness tests, and could potentially be bogus (if the
34 27  
... ... @@ -36,9 +29,37 @@
36 29 a security-conscious person would run fitness tests on the
37 30 data before assuming it is truly random.
38 31  
39   - /dev/hwrandom is char device major 10, minor 183.
  32 + The rng-tools package uses such tests in "rngd", and lets you
  33 + run them by hand with a "rngtest" utility.
40 34  
41   -Driver notes:
  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 +
  51 +
  52 +About the Intel RNG hardware, from the firmware hub datasheet:
  53 +
  54 + The Firmware Hub integrates a Random Number Generator (RNG)
  55 + using thermal noise generated from inherently random quantum
  56 + mechanical properties of silicon. When not generating new random
  57 + bits the RNG circuitry will enter a low power state. Intel will
  58 + provide a binary software driver to give third party software
  59 + access to our RNG for use as a security feature. At this time,
  60 + the RNG is only to be used with a system in an OS-present state.
  61 +
  62 +Intel RNG Driver notes:
42 63  
43 64 * FIXME: support poll(2)
44 65  
drivers/char/hw_random/Kconfig
... ... @@ -9,7 +9,14 @@
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