From: "Stephan Müller" <smueller@chronox.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Daney <david.daney@cavium.com>,
Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
Matt Mackall <mpm@selenic.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Revert "hwrng: core - zeroize buffers with random data"
Date: Thu, 09 Feb 2017 10:32:18 +0100 [thread overview]
Message-ID: <10800323.FrV6YrZeG5@positron.chronox.de> (raw)
In-Reply-To: <CA+55aFwBdG42kk8J0t2tufHE=OUk4qWXEkFyySNgU3Ru2TA-tQ@mail.gmail.com>
Am Mittwoch, 8. Februar 2017, 17:57:23 CET schrieb Linus Torvalds:
Hi Linus,
> Stephan, Herbert? The zeroes in /dev/hwrng output are obviously
> complete crap, so there's something badly wrong somewhere.
>
> The locking, for example, is completely buggered. There's even a
> comment about it, but that comment makes the correct observation of
> "but y'know: randomness". But the memset() also being outside the lock
> makes a complete joke of the whole thing.
That is correct, the patch is broken and should be reverted.
May I ask, however, why the add_device_randomness is invoked outside the lock
as well. Shouldn't it be moved into the lock?
Besides, I still would think that a memset(0) is needed because we have long-
living memory locations (rng_buffer and rng_fillbuf) which may be overwritten
sporadically. As these memory locations are expected to hold entropy, they
should be overwritten as soon as the data is processed. Obviously, such memset
must be done within the lock.
Ciao
Stephan
prev parent reply other threads:[~2017-02-09 9:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 0:23 [PATCH] Revert "hwrng: core - zeroize buffers with random data" David Daney
2017-02-09 1:57 ` Linus Torvalds
2017-02-09 9:32 ` Stephan Müller [this message]
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=10800323.FrV6YrZeG5@positron.chronox.de \
--to=smueller@chronox.de \
--cc=david.daney@cavium.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=torvalds@linux-foundation.org \
/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