linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephan Mueller <smueller@chronox.de>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: sandy harris <sandyinchina@gmail.com>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	Nicholas Mc Guire <der.herr@hofr.at>,
	Clemens Ladisch <clemens@ladisch.de>, Pavel Machek <pavel@ucw.cz>
Subject: Re: [PATCH] CPU Jitter RNG: Executing time variation tests on bare metal
Date: Wed, 13 Nov 2013 04:37:18 +0100	[thread overview]
Message-ID: <2783048.WEALGJott2@myon.chronox.de> (raw)
In-Reply-To: <20131029132448.GB691@thunk.org>

Am Dienstag, 29. Oktober 2013, 09:24:48 schrieb Theodore Ts'o:

Hi Theodore,

> On Tue, Oct 29, 2013 at 09:42:30AM +0100, Stephan Mueller wrote:
> > Based on this suggestion, I now added the tests in Appendix F.46.8 where
> > I disable the caches and the tests in Appendix F.46.9 where I disable
> > the caches and interrupts.
> 
> What you've added in F.46 is a good start, but as a suggestiom,
> instead of disabling one thing at a time, try disabling *everything*
> and then see what you get, and then enabling one thing at a time.  The
> best thing is if you can get to the point where the amount of entropy
> is close to zero.  Then as you add things back, there's a much better
> sense of where the unpredictability might be coming from, and whether
> the unpredictability is coming from something which is fundamentally
> arising from something which is chaotic or quantum effect, or just
> because we don't have a good way of modelling the behavior of the
> L1/L2 cache (for example) and that is spoofing your entropy estimator.

I was now able to implement two more test buckets that were in my mind for 
quite some time. They are documented in the new sections 6.3 and 6.4 in [1].

The tests for the time variation measurements are now executed on bare metal, 
i.e. without *any* operating system underneath. For achieving that, I used the 
memtest86+ tool, ripped out the memory tests and added the time variation 
testing into it.

The time variation tests now execute single threaded without any interference 
from an underlying operating system. Again, I added all the variations of 
disabling CPU support (TLB flushes, L1/2 flushes, cache disabling, ...).

And, surprise: all the jitter is still there.

Furthermore, I use the same vehicle to just measure the variations by 
obtaining two timestamps immediately after each other and calculate the 
difference. As before, there are various tests which disable the different CPU 
mechanisms.

And, surprise: there is still variations visible. Granted, these variations 
are smaller than the ones for the folding loop. But the smallest variations 
still have way more than 1 bit when applying the Shannon Entropy formula.

The code is uploaded to [2] and can be used to play with.

In addition, I added test resutls with varying loads as explained in section 
6.2 (thanks to Nicholas Mc Guire for helping here).

[1] http://www.chronox.de/jent/doc/CPU-Jitter-NPTRNG.html

[2] http://www.chronox.de/

Ciao
Stephan
-- 
| Cui bono? |

  parent reply	other threads:[~2013-11-13  3:37 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
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         ` Stephan Mueller [this message]
2013-10-30 12:59     ` 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=2783048.WEALGJott2@myon.chronox.de \
    --to=smueller@chronox.de \
    --cc=clemens@ladisch.de \
    --cc=der.herr@hofr.at \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=sandyinchina@gmail.com \
    --cc=tytso@mit.edu \
    /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).