All of lore.kernel.org
 help / color / mirror / Atom feed
From: Torsten Duwe <duwe@suse.de>
To: "Theodore Ts'o" <tytso@mit.edu>, "H. Peter Anvin" <hpa@zytor.com>,
	"Andy Lutomirski" <luto@amacapital.net>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Matt Mackall" <mpm@selenic.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Rusty Russell" <rusty@rustcorp.com.au>,
	"Satoru Takeuchi" <satoru.takeuchi@gmail.com>,
	ingo.tuchscherer@de.ibm.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Hans-Georg Markgraf" <MGRF@de.ibm.com>,
	"Gerald Schaefer" <gerald.schaefer@de.ibm.com>,
	"Martin Schwidefsky" <schwidefsky@de.ibm.com>,
	"Heiko Carstens" <heiko.carstens@de.ibm.com>,
	"Joe Perches" <joe@perches.com>, "Jörn Engel" <joern@logfs.org>
Subject: Re: [Patch v5.1 03/03]: hwrng: khwrngd derating per device
Date: Mon, 16 Jun 2014 16:07:19 +0200	[thread overview]
Message-ID: <20140616140719.GA1744@suse.de> (raw)
In-Reply-To: <20140616112207.GB4887@thunk.org>

On Mon, Jun 16, 2014 at 07:22:07AM -0400, Theodore Ts'o wrote:
> On Mon, Jun 16, 2014 at 09:31:08AM +0200, Torsten Duwe wrote:
> > > 2)  Fixed a bug in patch #2 so that it would work correctly if the rng
> > > driver doesn't have an init function (which happens to be the case for
> > > the tpm-rng driver, which I used for my testing).
> > 
> > The whole thing stems from entropy-challenged s390. 3.12 on s390 compiles
> > and runs fine. Yields a solid 200 kB/s
> > 
> > TPM RNG is a crook ;-)
> 
> I think the word you mean is "crock" (as in "crock of sh*t"?)  :-)

Actually, I was thinking of a crutch. Makes you walk slowly, but better
than nothing. Seems I've bent the wrong tube.

> Were you referring to the typical hardware implementation in most
> TPM's, or something else?

Those are designed for the TPM's own, internal use IIRC. Their exposure
to the main computer is only a side effect.

> > With patch 03/03, it is up to the driver author to specify an entropy
> > quality, which can be overridden at boot time, or when loading
> > the module, respectively. This should be a constant hardware property.
> > It would be nice to change it at runtime; but frankly I hope that this
> > won't be neccessary.
> 
> The question of what should be the proper derating mechanism is going
> to be subject to individual administrators.  I agree that we should
> have good defaults, but for example, I'm sure the manufacturer of the
> TPM that's in my Thinkpad would try to claim that it's the Bug
> Free(tm), and try to assign it derating factor accordingly.  If the

Then the next question would be about the underlying specification.
A bug free implementation of dual-EC DRBG?

> manufacturer is supplying the device driver, it may not be a value
> that other people will agree with.  Which is why I think making it
> runtime configurable is a good thing.

Boot time configurable, I'd say. Again: this is a hardware property,
multiplied by the admin's level of confidence in the absence of backdoors.
It's easy with s390: from z/VM you can read all the guest's memory anyway.
If you use this machine, you already trust IBM.

> As another example, I assume Peter or someone else from Intel will be
> shortly submitting a hw_random driver for RDRAND on x86.  What should
> the derating factor be for that?  I suspect David Johnson's answer
> would be quite different from other people's.  And that's to be
> expected, since he has much better information that most of us have
> access to about the RDRAND implementation, and the
> likelihood/possibiliy it could have been subverted.

So let's keep it close to 0, and allow those to raise it who have confidence.

> > Maybe along with more sophisticated steering of how many bits to pick
> > from which source, if multiple are available.
> 
> Yeah, the question about what to do we have multiple hw random sources
> is something that I thought about.  Do we want to poll from more than
> one?

Of course! Choose your mix!

> Also, suppose some hw random sources require more resources ---
> battery life in particular, for mobile/laptop devices?  How do we deal
> with policy questions such as these?  Should we deal with it all, or
> just assume that userspace will dynamically enable or disable pulling
> from certain devices based on policy questions such as power
> utilization issues?

One thing after the other. What are the consumers of kernel entropy?
Mostly ASLR, I guess, and the web server / sshd accepting connections.
Those proceses starting probably eats more power than a HWRNG needs for
the appropriate random bits. We can address exceptions once they arise.

	Torsten


  reply	other threads:[~2014-06-16 14:07 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 14:29 [PATCH v2 00/03]: khwrngd Torsten Duwe
2014-03-21 14:32 ` [Patch v2 01/03]: provide an injection point for pure hardware randomness Torsten Duwe
2014-03-21 14:33 ` [PATCH v2 02/03]: hwrng: create filler thread Torsten Duwe
2014-03-27  0:50   ` Andy Lutomirski
2014-03-27  1:03     ` H. Peter Anvin
2014-03-27  1:11       ` Andy Lutomirski
2014-03-27  1:55         ` H. Peter Anvin
2014-03-27  4:47         ` H. Peter Anvin
2014-03-27 15:03           ` Torsten Duwe
2014-03-27 16:06           ` Andy Lutomirski
2014-03-27 14:54       ` Torsten Duwe
2014-03-27 15:47         ` Andy Lutomirski
2014-04-14 16:02       ` [PATCH v3 00/03]: hwrng: an in-kernel rngd Torsten Duwe
2014-04-14 16:04         ` [PATCH v3 01/03]: hwrng: provide an injection point for pure hardware randomness Torsten Duwe
2014-04-14 16:05         ` [PATCH v3 02/03]: hwrng: create filler thread Torsten Duwe
2014-04-14 16:06         ` [PATCH v3 03/03]: hwrng: khwrngd derating per device Torsten Duwe
2014-04-14 16:41           ` Andy Lutomirski
2014-04-15  8:51             ` Torsten Duwe
2014-04-15 16:53               ` Andy Lutomirski
2014-05-27 13:41                 ` [PATCH v5 00/03]: hwrng: an in-kernel rngd Torsten Duwe
2014-05-27 13:44                   ` [Patch 01/03]: provide an injection point for pure hardware randomness Torsten Duwe
2014-05-27 13:45                   ` [Patch v5 02/03]: hwrng: create filler thread Torsten Duwe
2014-05-27 13:46                   ` [Patch v5 03/03]: hwrng: khwrngd derating per device Torsten Duwe
2014-05-27 14:11                     ` [Patch v5.1 " Torsten Duwe
2014-06-12  1:24                       ` H. Peter Anvin
2014-06-12 10:09                         ` Torsten Duwe
2014-06-14  2:40                           ` Theodore Ts'o
2014-06-14  2:44                             ` H. Peter Anvin
2014-06-15  5:11                               ` Theodore Ts'o
2014-06-16  7:31                                 ` Torsten Duwe
2014-06-16 11:22                                   ` Theodore Ts'o
2014-06-16 14:07                                     ` Torsten Duwe [this message]
2014-06-16 14:40                                       ` Theodore Ts'o
     [not found]                                     ` <20140616141444.GB1744@suse.de>
     [not found]                                       ` <20140616142812.GB19387@thunk.org>
2014-07-11 13:43                                         ` Ingo Tuchscherer
2014-07-11 14:42                                           ` Theodore Ts'o
2014-04-14 16:09         ` [PATCH v3 00/03]: hwrng: an in-kernel rngd H. Peter Anvin
2014-04-14 16:24           ` Torsten Duwe
2014-04-14 16:29             ` H. Peter Anvin
2014-04-14 16:43             ` Andy Lutomirski
2014-04-14 16:27           ` [PATCH v4 03/03]: hwrng: khwrngd derating per device Torsten Duwe
2014-03-21 14:34 ` [PATCH v2 " Torsten Duwe

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=20140616140719.GA1744@suse.de \
    --to=duwe@suse.de \
    --cc=MGRF@de.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=ingo.tuchscherer@de.ibm.com \
    --cc=joe@perches.com \
    --cc=joern@logfs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mpm@selenic.com \
    --cc=rusty@rustcorp.com.au \
    --cc=satoru.takeuchi@gmail.com \
    --cc=schwidefsky@de.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.