Messages in this thread | | | From | "Jason A. Donenfeld" <> | Date | Mon, 21 Feb 2022 15:35:44 +0100 | Subject | Re: [PATCH v2] random: tie batched entropy generation to base_crng generation |
| |
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
| |