linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Stephan Mueller <smueller@chronox.de>
Cc: Pavel Machek <pavel@ucw.cz>,
	sandy harris <sandyinchina@gmail.com>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH] CPU Jitter RNG: inclusion into kernel crypto API and /dev/random
Date: Sun, 3 Nov 2013 07:41:35 -0500	[thread overview]
Message-ID: <20131103124135.GB32091@thunk.org> (raw)
In-Reply-To: <3537770.iLHXPOXMiU@tauon>

On Sun, Nov 03, 2013 at 08:20:34AM +0100, Stephan Mueller wrote:
> Another friend of mine mentioned that he assumes the rise and fall times 
> of transistors varies very slightly and could be the main reason for the 
> jitter. I do not think that this is really the case, because our gates 
> that form the CPU instructions comprise of many transistors. The 
> combined raise/fall jitter should cancel each other out.

The whole point of using a clocked architecture for digital circuitry
is to avoid differences in the rise/fall times of transitors to lead
to non-deterministic behavior --- which is important if you want to
make sure that 2 * 2 == 4 and not 3.99999999.....

The one place where you might find differences is when you have
different subsystems which are clocked using different clock sources,
and then there's extra circuitry that has to be needed to handle
interfacing between those differently clocked circuit areas.

The problem, though is that over time, these boundaries can change; it
may be that on certain chipsets, things that had been in different
clock circuits, have later been integrated onto a single
system-on-chip device and all run off of a single clock source.

> That said, the full root cause is is not really known at this time 
> considering that major chip vendors have no real clue either.

I have trouble beliving that statement; they might not be willing to
comment, since to do so would expose a internal CPU designs which they
consider secret, or worse, it might cause people to depend on certain
implementation details which might not be true in future chipsets ---
which may either tie their hands, or they may even know that it won't
be true for CPU version currently under development but not yet
released.

Sandy Harris pointed out a very good paper that I would definitely
recommend that people read:

http://lwn.net/images/conf/rtlws11/random-hardware.pdf

It basically describes some efforts made in 2009 by folks to do
exactly the sort of experiments I was advocating.  What I actually
think is more important, though, is not the doing of the experiments,
but the development the tools to do these experiments.  If people can
create kernel modules (and they have to be done in the kernel, since
you need to be able to disable interrupts, L1 caches, etc., while you
run these tests), then it will be possible to do these experiments
each time a new CPU comes out from Intel, or each time an ARM hardware
vendor comes out with a new ARM SOC.

It's important that these tests are done all time, and not, "OK, we
did some tests in 2009 or 2013, and things looked good, and we don't
have to worry about this any more; CPU-generated entropy is guaranteed
to be good!"  We need to make sure we can easily do these tests all
the time, for every new piece of hardware out there --- and when we
can't explain where the entropy is coming from, we need to be doubly
on our guard.

Regards,

					- Ted


  reply	other threads:[~2013-11-03 12:41 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-11 18:38 [PATCH] CPU Jitter RNG: inclusion into kernel crypto API and /dev/random Stephan Mueller
2013-10-12  1:45 ` Sandy Harris
2013-10-12  3:28   ` Theodore Ts'o
2013-10-12 19:04     ` Stephan Mueller
2013-10-12 20:12   ` Stephan Mueller
     [not found]     ` <CACXcFm=_jmeKe2YYbHDi-jTGX-23hDsDeu_weWQkr2F_FpE_6g@mail.gmail.com>
2013-10-14 13:38       ` Fwd: " Sandy Harris
2013-10-14 14:12         ` Stephan Mueller
2013-10-14 14:26           ` Stephan Mueller
2013-10-14 14:14         ` Sandy Harris
2013-10-14 14:40           ` Stephan Mueller
2013-10-14 15:18             ` Sandy Harris
2013-10-14 15:26               ` Stephan Mueller
2013-10-14 15:46                 ` Sandy Harris
2013-10-14 21:33                 ` Sandy Harris
2013-10-15  6:23               ` Stephan Mueller
2013-10-28 15:40 ` Stephan Mueller
2013-10-28 16:06   ` Henrique de Moraes Holschuh
2013-10-28 16:15     ` Stephan Mueller
2013-10-28 21:45   ` Theodore Ts'o
2013-10-29  8:42     ` Stephan Mueller
2013-10-29 13:24       ` Theodore Ts'o
2013-10-29 14:00         ` Stephan Mueller
2013-10-29 22:25           ` Stephan Mueller
2013-11-02 11:01           ` Pavel Machek
2013-11-02 11:12             ` Pavel Machek
2013-11-03  7:20             ` Stephan Mueller
2013-11-03 12:41               ` Theodore Ts'o [this message]
2013-11-05 12:20                 ` Stephan Mueller
2013-11-06 11:49                   ` Stephan Mueller
2013-11-06 12:43                     ` Theodore Ts'o
2013-11-06 12:51                       ` Stephan Mueller
2013-11-06 13:04                         ` Theodore Ts'o
2013-11-06 13:24                           ` Pavel Machek
2013-11-07  0:36                             ` Nicholas Mc Guire
2013-11-07  5:21                           ` Stephan Mueller
2013-11-09 22:04                             ` Clemens Ladisch
2013-11-10  1:10                               ` Stephan Mueller
2013-11-10 16:31                                 ` Clemens Ladisch
2013-11-10 17:21                                   ` Stephan Mueller
2013-11-10 20:28                                     ` Clemens Ladisch
2013-11-13  3:12                                       ` Stephan Mueller
2013-11-13 11:51                                         ` Clemens Ladisch
2013-11-13 15:15                                           ` Stephan Mueller
2013-11-13 17:14                                             ` Pavel Machek
2013-11-14 10:51                                             ` Clemens Ladisch
2013-11-14 18:01                                               ` Stephan Mueller
2013-11-14 18:30                                                 ` Clemens Ladisch
2013-11-14 18:34                                                   ` Stephan Mueller
2013-11-11  2:58                                     ` H. Peter Anvin
2013-11-07  1:03                         ` Nicholas Mc Guire
2013-11-07  5:26                           ` Stephan Mueller
2013-11-09 22:04                             ` Clemens Ladisch
2013-11-10  1:16                               ` Stephan Mueller
2013-11-03 23:32               ` Pavel Machek
2013-11-05 12:25                 ` Stephan Mueller
2013-11-05 13:45                   ` Stephan Mueller
2013-11-06 11:42                     ` Stephan Mueller
2013-11-06 13:26                       ` Pavel Machek
2013-11-07  3:12                         ` Stephan Mueller
2013-11-13  3:37         ` [PATCH] CPU Jitter RNG: Executing time variation tests on bare metal Stephan Mueller
2013-10-30 12:59     ` [PATCH] CPU Jitter RNG: inclusion into kernel crypto API and /dev/random Sandy Harris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131103124135.GB32091@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=sandyinchina@gmail.com \
    --cc=smueller@chronox.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).