You need to sign in or sign up before continuing.
  1. 09 6月, 2016 1 次提交
  2. 20 3月, 2014 2 次提交
    • H
      random: Add arch_has_random[_seed]() · 7b878d4b
      H. Peter Anvin 提交于
      Add predicate functions for having arch_get_random[_seed]*().  The
      only current use is to avoid the loop in arch_random_refill() when
      arch_get_random_seed_long() is unavailable.
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      7b878d4b
    • H
      x86, random: Enable the RDSEED instruction · d20f78d2
      H. Peter Anvin 提交于
      Upcoming Intel silicon adds a new RDSEED instruction, which is similar
      to RDRAND but provides a stronger guarantee: unlike RDRAND, RDSEED
      will always reseed the PRNG from the true random number source between
      each read.  Thus, the output of RDSEED is guaranteed to be 100%
      entropic, unlike RDRAND which is only architecturally guaranteed to be
      1/512 entropic (although in practice is much more.)
      
      The RDSEED instruction takes the same time to execute as RDRAND, but
      RDSEED unlike RDRAND can legitimately return failure (CF=0) due to
      entropy exhaustion if too many threads on too many cores are hammering
      the RDSEED instruction at the same time.  Therefore, we have to be
      more conservative and only use it in places where we can tolerate
      failures.
      
      This patch introduces the primitives arch_get_random_seed_{int,long}()
      but does not use it yet.
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      Reviewed-by: NIngo Molnar <mingo@kernel.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      d20f78d2
  3. 13 10月, 2013 1 次提交
  4. 01 8月, 2011 2 次提交
    • H
      x86, random: Verify RDRAND functionality and allow it to be disabled · 49d859d7
      H. Peter Anvin 提交于
      If the CPU declares that RDRAND is available, go through a guranteed
      reseed sequence, and make sure that it is actually working (producing
      data.)   If it does not, disable the CPU feature flag.
      
      Allow RDRAND to be disabled on the command line (as opposed to at
      compile time) for a user who has special requirements with regards to
      random numbers.
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      49d859d7
    • H
      x86, random: Architectural inlines to get random integers with RDRAND · 628c6246
      H. Peter Anvin 提交于
      Architectural inlines to get random ints and longs using the RDRAND
      instruction.
      
      Intel has introduced a new RDRAND instruction, a Digital Random Number
      Generator (DRNG), which is functionally an high bandwidth entropy
      source, cryptographic whitener, and integrity monitor all built into
      hardware.  This enables RDRAND to be used directly, bypassing the
      kernel random number pool.
      
      For technical documentation, see:
      
      http://software.intel.com/en-us/articles/download-the-latest-bull-mountain-software-implementation-guide/
      
      In this patch, this is *only* used for the nonblocking random number
      pool.  RDRAND is a nonblocking source, similar to our /dev/urandom,
      and is therefore not a direct replacement for /dev/random.  The
      architectural hooks presented in the previous patch only feed the
      kernel internal users, which only use the nonblocking pool, and so
      this is not a problem.
      
      Since this instruction is available in userspace, there is no reason
      to have a /dev/hw_rng device driver for the purpose of feeding rngd.
      This is especially so since RDRAND is a nonblocking source, and needs
      additional whitening and reduction (see the above technical
      documentation for details) in order to be of "pure entropy source"
      quality.
      
      The CONFIG_EXPERT compile-time option can be used to disable this use
      of RDRAND.
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      Originally-by: NFenghua Yu <fenghua.yu@intel.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      628c6246