From: Linus Torvalds <torvalds@linux-foundation.org>
To: Willy Tarreau <w@1wt.eu>
Cc: Ingo Molnar <mingo@elte.hu>,
security@kernel.org, Linux@hera.kernel.org, stable@kernel.org,
Cox <alan@lxorguk.ukuu.org.uk>,
Arjan@hera.kernel.org, List <linux-kernel@vger.kernel.org>,
Alan@hera.kernel.org, Eric Paris <eparis@redhat.com>,
Jake Edge <jake@lwn.net>,
linux-security-module@vger.kernel.org, mingo@redhat.com,
"Eric W. Biederman" <ebiederm@xmission.com>,
Matt Mackall <mpm@selenic.com>, Dave Jones <davej@redhat.com>,
James Morris <jmorris@namei.org>,
Andrew Morton <akpm@linux-foundation.org>,
Roland McGrath <roland@redhat.com>, de Ven <arjan@infradead.org>
Subject: Re: [Security] [patch] random: make get_random_int() more random
Date: Sat, 16 May 2009 08:23:11 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.2.01.0905160811550.3301@localhost.localdomain> (raw)
In-Reply-To: <20090516135828.GA25283@1wt.eu>
On Sat, 16 May 2009, Willy Tarreau wrote:
>
> I don't agree with your point. It is good when the user must choose
> between performance and security.
Well, quite frankly, historically "get_random_int()" has been exactly
that.
It's based very much on top of the random number generator for networking,
where performance was a primary goal. It's why the code has that
re-seeding with "real" randomness that happens once a minute (or
whatever): exactly because "real" randomness was too expensive (and would
deplete the entropy pool).
So "get_random_int()" has _always_ been about a choice between performance
and security. Ok, it's not been a "user" choice, but the thing is, most
users really aren't capable of that choice - they may not think they care,
until they get hacked (and not even necessarily then - the _bulk_ of
hacked computers probably end up being used for DDoS kind of things, so
the user itself is not even the primary target).
So I don't think that there are "insecure" and "secure" users - yes,
there are people who care more, and people who care less, but we need to
protect the people who care less even just to protect the people who care
more ;)
But there very much _are_ performance vs "strength of hash" issues. And
historically, "get_random_int()" has leaned towards the performance thing.
It's just that it had a really outrageously stupid weakness that wasn't
even really helping performance.
I think we've fixed the "outrageously stupid" part. It would certainly be
good to make it even better.
And yes, giving out more of our pool (by remembering which part we've
already given out) would make it possible to use a more expensive hash.
But at the same time, I personally suspect that it would be _much_ easier
to attack the hash if we actually gave out the whole 16 bytes (over
several iteration), when compared to what we do now (only give out a small
part and then re-hash). I can't back that up with any proofs, though, but
I suspect it's much harder to re-generate the hash if you never see more
than a very small part of the output.
(That's especially true since whatever we do, the _one_ thing we can never
do is to actually hide what hash we use. We can hide the data, but we
can't hide the code. Others depend on also making it harder to guess
even what the algorithm for the hash itself is).
Linus
next prev parent reply other threads:[~2009-05-16 15:26 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-04 18:51 [PATCH] proc: avoid information leaks to non-privileged processes Jake Edge
2009-05-04 19:00 ` [Security] " Linus Torvalds
2009-05-04 19:51 ` Arjan van de Ven
2009-05-04 20:20 ` Eric W. Biederman
2009-05-04 22:24 ` Linus Torvalds
2009-05-04 23:26 ` Arjan van de Ven
2009-05-04 23:54 ` Linus Torvalds
2009-05-05 7:51 ` Eric W. Biederman
2009-05-05 15:17 ` Linus Torvalds
2009-05-05 15:35 ` Linus Torvalds
2009-05-05 16:18 ` Matt Mackall
2009-05-05 16:10 ` Matt Mackall
2009-05-05 5:50 ` Matt Mackall
2009-05-05 6:31 ` Ingo Molnar
2009-05-05 8:14 ` Eric W. Biederman
2009-05-05 19:52 ` Ingo Molnar
2009-05-05 20:22 ` Matt Mackall
2009-05-05 21:20 ` Eric W. Biederman
2009-05-06 10:33 ` Ingo Molnar
2009-05-06 10:30 ` Ingo Molnar
2009-05-06 16:25 ` Matt Mackall
2009-05-06 16:48 ` Linus Torvalds
2009-05-06 17:57 ` Matt Mackall
2009-05-07 0:50 ` Matt Mackall
2009-05-07 15:02 ` Ingo Molnar
2009-05-07 18:14 ` Matt Mackall
2009-05-07 18:21 ` Ingo Molnar
2009-05-07 18:41 ` Ingo Molnar
2009-05-07 19:24 ` Matt Mackall
2009-05-07 15:16 ` Florian Weimer
2009-05-07 16:55 ` Matt Mackall
2009-05-07 17:53 ` Linus Torvalds
2009-05-07 18:42 ` Matt Mackall
2009-05-06 20:09 ` [patch] random: make get_random_int() more random Ingo Molnar
2009-05-06 20:41 ` Matt Mackall
2009-05-06 20:51 ` Ingo Molnar
2009-05-06 21:10 ` Matt Mackall
2009-05-06 21:24 ` Ingo Molnar
2009-05-14 22:47 ` Jake Edge
2009-05-14 22:55 ` [Security] " Linus Torvalds
2009-05-15 13:47 ` Ingo Molnar
2009-05-15 15:10 ` Jake Edge
2009-05-16 10:00 ` Willy Tarreau
2009-05-16 10:39 ` Ingo Molnar
2009-05-16 12:02 ` Eric W. Biederman
2009-05-16 14:00 ` Michael S. Zick
2009-05-16 14:28 ` Michael S. Zick
2009-05-16 14:57 ` Arjan van de Ven
2009-05-16 15:09 ` Michael S. Zick
2009-05-16 14:32 ` Matt Mackall
2009-05-16 13:58 ` Willy Tarreau
2009-05-16 15:23 ` Linus Torvalds [this message]
2009-05-16 15:47 ` Willy Tarreau
2009-05-16 15:54 ` Oliver Neukum
2009-05-16 16:05 ` Linus Torvalds
2009-05-16 16:17 ` Linus Torvalds
2009-05-15 1:16 ` Américo Wang
2009-05-06 20:25 ` [Security] [PATCH] proc: avoid information leaks to non-privileged processes Ingo Molnar
2009-05-06 20:52 ` Matt Mackall
2009-05-05 8:58 ` Andi Kleen
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=alpine.LFD.2.01.0905160811550.3301@localhost.localdomain \
--to=torvalds@linux-foundation.org \
--cc=Alan@hera.kernel.org \
--cc=Arjan@hera.kernel.org \
--cc=Linux@hera.kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=arjan@infradead.org \
--cc=davej@redhat.com \
--cc=ebiederm@xmission.com \
--cc=eparis@redhat.com \
--cc=jake@lwn.net \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=mpm@selenic.com \
--cc=roland@redhat.com \
--cc=security@kernel.org \
--cc=stable@kernel.org \
--cc=w@1wt.eu \
/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
Powered by JetHome