]> Git Repo - linux.git/commit
random: Use arch_get_random_int instead of cycle counter if avail
authorLinus Torvalds <[email protected]>
Thu, 22 Dec 2011 19:36:22 +0000 (11:36 -0800)
committerH. Peter Anvin <[email protected]>
Fri, 30 Dec 2011 00:49:45 +0000 (16:49 -0800)
commitcf833d0b9937874b50ef2867c4e8badfd64948ce
treef2eb260e524387c6dce6de17b5c06ec0c34adef7
parent5f0a6e2d503896062f641639dacfe5055c2f593b
random: Use arch_get_random_int instead of cycle counter if avail

We still don't use rdrand in /dev/random, which just seems stupid. We
accept the *cycle*counter* as a random input, but we don't accept
rdrand? That's just broken.

Sure, people can do things in user space (write to /dev/random, use
rdrand in addition to /dev/random themselves etc etc), but that
*still* seems to be a particularly stupid reason for saying "we
shouldn't bother to try to do better in /dev/random".

And even if somebody really doesn't trust rdrand as a source of random
bytes, it seems singularly stupid to trust the cycle counter *more*.

So I'd suggest the attached patch. I'm not going to even bother
arguing that we should add more bits to the entropy estimate, because
that's not the point - I don't care if /dev/random fills up slowly or
not, I think it's just stupid to not use the bits we can get from
rdrand and mix them into the strong randomness pool.

Link: http://lkml.kernel.org/r/CA%2B55aFwn59N1=m651QAyTy-1gO1noGbK18zwKDwvwqnravA84A@mail.gmail.com
Acked-by: "David S. Miller" <[email protected]>
Acked-by: "Theodore Ts'o" <[email protected]>
Acked-by: Herbert Xu <[email protected]>
Cc: Matt Mackall <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Eric Dumazet <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
drivers/char/random.c
This page took 0.049394 seconds and 4 git commands to generate.