]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
random: mix rdrand with entropy sent in from userspace
authorTheodore Ts'o <tytso@mit.edu>
Sun, 15 Jul 2018 03:55:57 +0000 (23:55 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 18 Jul 2018 01:32:36 +0000 (21:32 -0400)
commit81e69df38e2911b642ec121dec319fad2a4782f3
treee3b6dd0b65d0e5f0a5b48820ad2f9142d1b908df
parent1e4b044d22517cae7047c99038abb444423243ca
random: mix rdrand with entropy sent in from userspace

Fedora has integrated the jitter entropy daemon to work around slow
boot problems, especially on VM's that don't support virtio-rng:

    https://bugzilla.redhat.com/show_bug.cgi?id=1572944

It's understandable why they did this, but the Jitter entropy daemon
works fundamentally on the principle: "the CPU microarchitecture is
**so** complicated and we can't figure it out, so it *must* be
random".  Yes, it uses statistical tests to "prove" it is secure, but
AES_ENCRYPT(NSA_KEY, COUNTER++) will also pass statistical tests with
flying colors.

So if RDRAND is available, mix it into entropy submitted from
userspace.  It can't hurt, and if you believe the NSA has backdoored
RDRAND, then they probably have enough details about the Intel
microarchitecture that they can reverse engineer how the Jitter
entropy daemon affects the microarchitecture, and attack its output
stream.  And if RDRAND is in fact an honest DRNG, it will immeasurably
improve on what the Jitter entropy daemon might produce.

This also provides some protection against someone who is able to read
or set the entropy seed file.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>
drivers/char/random.c