From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Theodore Ts'o" <tytso@mit.edu>,
Dominik Brodowski <linux@dominikbrodowski.net>
Subject: Re: [PATCH v2] random: tie batched entropy generation to base_crng generation
Date: Mon, 21 Feb 2022 15:35:44 +0100 [thread overview]
Message-ID: <CAHmME9pcFkPysTHHUCiPwqO0rv-i8X4nzNvomaSnyxbx3nauig@mail.gmail.com> (raw)
In-Reply-To: <YhMRf1tqgB/zSvAs@sol.localdomain>
On Mon, Feb 21, 2022 at 5:13 AM Eric Biggers <ebiggers@kernel.org> wrote:
> > @@ -455,7 +453,7 @@ static size_t crng_fast_load(const void *cp, size_t len)
> > src++; crng_init_cnt++; len--; ret++;
> > }
> > if (crng_init_cnt >= CRNG_INIT_CNT_THRESH) {
> > - invalidate_batched_entropy();
> > + ++base_crng.generation;
> > crng_init = 1;
> > }
>
> This is an existing issue, but why doesn't crng_slow_load() do this too?
Because it's called by add_device_randomness(), which is mostly
ingesting static bytes, akin to what you get by running `dmidecode`
and such. The idea is that this is something that's good to mix, but
bad to credit. I think there was a CVE a few years back about this,
precipitating the change.
Jason
next prev parent reply other threads:[~2022-02-21 14:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 18:57 [PATCH] random: fix locking for crng_init in crng_reseed() Dominik Brodowski
2022-02-09 21:39 ` Jason A. Donenfeld
2022-02-09 21:54 ` [PATCH] random: tie batched entropy generation to base_crng generation Jason A. Donenfeld
2022-02-10 6:00 ` Dominik Brodowski
2022-02-10 13:09 ` Jason A. Donenfeld
2022-02-10 13:13 ` [PATCH v2] " Jason A. Donenfeld
2022-02-21 4:13 ` Eric Biggers
2022-02-21 14:35 ` Jason A. Donenfeld [this message]
2022-02-10 5:43 ` [PATCH] random: fix locking for crng_init in crng_reseed() Dominik Brodowski
2022-02-10 13:07 ` Jason A. Donenfeld
2022-02-21 4:05 ` Eric Biggers
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=CAHmME9pcFkPysTHHUCiPwqO0rv-i8X4nzNvomaSnyxbx3nauig@mail.gmail.com \
--to=jason@zx2c4.com \
--cc=ebiggers@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--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;
as well as URLs for NNTP newsgroup(s).