From: Oliver Xymoron <oxymoron@waste.org>
To: "Theodore Ts'o" <tytso@mit.edu>,
Linus Torvalds <torvalds@transmeta.com>,
Robert Love <rml@tech9.net>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] (0/4) Entropy accounting fixes
Date: Mon, 19 Aug 2002 07:39:37 -0500 [thread overview]
Message-ID: <20020819123937.GA14427@waste.org> (raw)
In-Reply-To: <20020819042141.GA26519@think.thunk.org>
On Mon, Aug 19, 2002 at 12:21:41AM -0400, Theodore Ts'o wrote:
> On Sun, Aug 18, 2002 at 12:38:59AM -0500, Oliver Xymoron wrote:
> > On Sat, Aug 17, 2002 at 09:01:20PM -0700, Linus Torvalds wrote:
> > >
> > > On 17 Aug 2002, Robert Love wrote:
> > > >
> > > > [1] this is why I wrote my netdev-random patches. some machines just
> > > > have to take the entropy from the network card... there is nothing
> > > > else.
> > >
> > > I suspect that Oliver is 100% correct in that the current code is just
> > > _too_ trusting. And parts of his patches seem to be in the "obviously
> > > good" category (ie the xor'ing of the buffers instead of overwriting).
> >
> > Make sure you don't miss this bit, I should have sent it
> > separately. This is a longstanding bug that manufactures about a
> > thousand bits out of thin air when the pool runs dry.
>
> There's a reason why I did what I did here, and it has to do with an
> attack which Bruce Schneier describes in his Yarrow paper:
>
> http://www.counterpane.com/yarrow-notes.html
>
> called the "iterative guessing attack". Assume that the adversary has
> somehow knows the current state of the pool.
Yes, I understand the catastrophic reseeding, I've read that and a
few other of his papers on PRNGs.
> I tried to take a bit more of a moderate position between relying
> solely on crypgraphic randomness and a pure absolute randomness model.
> So we use large pools for mixing, and a catastrophic reseeding policy.
>
> >From a pure theory point of view, I can see where this might be quite
> bothersome. On the other hand, practically, I think what we're doing
> is justifiable, and not really a secucity problem.
That's certainly a reasonable approach (to the extent that all the
attacks we know of are purely theoretical), but a) it's not the
impression one gets from the docs and b) I think we can easily do better.
> That being said, if you really want to use your patch, please do it
> differently. In order to avoid the iterative guessing attack
> described by Bruce Schneier, it is imperative that you extract
> r->poolinfo.poolwirds - r->entropy_count/32 words of randomness from
> the primary pool, and mix it into the secondary.
Ah, I thought we were relying on the extract_count clause of the xfer
function to handle this, the first clause just seemed buggy. I'm not
quite convinced that this isn't sufficient. Do you see a theoretical
problem with that?
It certainly doesn't hurt to transfer a larger chunk of data from the
primary pool (and I'll update my patch to reflect this), but if it
says there are only 8 bits of entropy there, we should only tally 8
bits of credit in the secondary pool. With the current behavior, you
can do 'cat /dev/random | hexdump', wait for it to block, hit a key or
two, and have it spew out another K of data. I think this goes against
everyone's expectations of how this should work.
> P.S. /dev/urandom should probably also be changed to use an entirely
> separate pool, which then periodically pulls a small amount of entropy
> from the priamry pool as necessary. That would make /dev/urandom
> slightly more dependent on the strength of SHA, while causing it to
> not draw down as heavily on the entropy stored in /dev/random, which
> would be a good thing.
Indeed - I intend to take advantage of the multiple pool flexibility
in the current code. I'll have a third pool that's allowed to draw
from the primary whenever it's more than half full. Assuming input
entropy rate > output entropy rate, this will make it exactly as
strong as /dev/random, while not starving /dev/random when there's a
shortage.
--
"Love the dolphins," she advised him. "Write by W.A.S.T.E.."
next prev parent reply other threads:[~2002-08-19 12:35 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-18 2:15 [PATCH] (0/4) Entropy accounting fixes Oliver Xymoron
2002-08-18 2:23 ` [PATCH] (1/4) " Oliver Xymoron
2002-08-18 2:26 ` [PATCH] (2/4) Update input drivers Oliver Xymoron
2002-08-18 2:29 ` [PATCH] (3/4) SA_RANDOM user fixup Oliver Xymoron
2002-08-18 2:32 ` [PATCH] (4/4) entropy batching update Oliver Xymoron
2002-08-18 2:30 ` [PATCH] (0/4) Entropy accounting fixes Linus Torvalds
2002-08-18 2:59 ` Oliver Xymoron
2002-08-18 3:08 ` Linus Torvalds
2002-08-18 3:25 ` Linus Torvalds
2002-08-18 4:42 ` Oliver Xymoron
2002-08-18 4:53 ` Linus Torvalds
2002-08-18 5:05 ` Dmitri
2002-08-18 6:18 ` Oliver Xymoron
2002-08-22 3:33 ` David Wagner
2002-08-18 10:30 ` Alan Cox
2002-08-18 15:08 ` Oliver Xymoron
2002-08-18 17:31 ` Jonathan Lundell
2002-08-22 3:27 ` David Wagner
2002-08-18 4:30 ` Oliver Xymoron
2002-08-21 8:44 ` Rogier Wolff
2002-08-21 12:47 ` Oliver Xymoron
2002-08-18 5:28 ` Andreas Dilger
2002-08-18 5:53 ` Oliver Xymoron
2002-08-22 3:25 ` David Wagner
2002-08-18 3:05 ` Linus Torvalds
2002-08-18 3:51 ` Robert Love
2002-08-18 4:01 ` Linus Torvalds
2002-08-18 5:38 ` Oliver Xymoron
2002-08-19 4:21 ` Theodore Ts'o
2002-08-19 10:15 ` Marco Colombo
2002-08-19 10:25 ` Oliver Neukum
2002-08-19 11:03 ` Marco Colombo
2002-08-19 14:22 ` Oliver Neukum
2002-08-19 15:21 ` Marco Colombo
2002-08-19 16:29 ` Oliver Neukum
2002-08-19 12:39 ` Oliver Xymoron [this message]
2002-08-18 6:31 ` Robert Love
2002-08-18 6:48 ` Oliver Xymoron
2002-08-18 4:06 ` dean gaudet
2002-08-18 4:44 ` Oliver Xymoron
2002-08-18 7:31 ` Bernd Eckenfels
2002-08-18 9:48 ` Ralf Baechle
2002-08-20 12:51 ` Bernd Eckenfels
2002-08-18 16:58 ` Robert Love
2002-08-18 10:25 ` Alan Cox
2002-08-19 10:47 ` Marco Colombo
2002-08-19 12:29 ` Alan Cox
2002-08-19 12:56 ` Marco Colombo
2002-09-08 3:43 ` D. Hugh Redelmeier
2002-09-08 18:03 ` David Wagner
2002-09-09 16:53 ` Oliver Xymoron
2002-09-09 16:58 ` David Wagner
2002-09-09 19:47 ` Oliver Xymoron
2002-09-09 23:22 ` David Wagner
2002-09-16 22:51 ` dean gaudet
2002-09-17 1:18 ` Oliver Xymoron
2002-09-09 18:54 ` Kent Borg
2002-09-09 19:57 ` Oliver Xymoron
2002-09-09 20:11 ` Kent Borg
2002-08-18 4:57 ` Oliver Xymoron
2002-08-18 4:28 ` Oliver Xymoron
2002-08-18 4:51 ` Linus Torvalds
2002-08-18 5:24 ` Oliver Xymoron
2002-08-18 16:59 ` Linus Torvalds
2001-11-02 10:34 ` Pavel Machek
2002-08-23 20:16 ` Linus Torvalds
2002-08-18 17:03 ` Robert Love
2002-08-18 17:31 ` Oliver Xymoron
2002-08-18 16:54 ` Robert Love
2002-08-18 17:18 ` Oliver Xymoron
2002-08-18 17:20 ` Robert Love
2002-08-19 5:43 ` Theodore Ts'o
2001-11-02 10:05 ` Pavel Machek
2002-08-19 6:06 ` *Challenge* Finding a solution (When kernel boots it does not display any system info) louie miranda
2002-08-19 7:30 ` Gilad Ben-Yossef
2002-08-19 7:30 ` Ryan Cumming
2002-08-20 0:55 ` louie miranda
2002-08-19 13:52 ` [PATCH] (0/4) Entropy accounting fixes Oliver Xymoron
2002-08-20 8:59 ` Tommi Kyntola
2002-08-20 13:21 ` Oliver Xymoron
2002-08-20 16:19 ` Tommi Kyntola
2002-08-20 17:22 ` Oliver Xymoron
2002-09-08 3:51 ` D. Hugh Redelmeier
2002-09-08 4:31 ` Oliver Xymoron
-- strict thread matches above, loose matches on Subject: below --
2002-08-18 4:57 David Brownell
2002-08-18 6:02 ` Oliver Xymoron
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=20020819123937.GA14427@waste.org \
--to=oxymoron@waste.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rml@tech9.net \
--cc=torvalds@transmeta.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