Messages in this thread | | | From | "Jason A. Donenfeld" <> | Date | Thu, 10 Feb 2022 14:09:49 +0100 | Subject | Re: [PATCH] random: tie batched entropy generation to base_crng generation |
| |
Hi Dominik,
On Thu, Feb 10, 2022 at 7:04 AM Dominik Brodowski <linux@dominikbrodowski.net> wrote: > Here we do not need to take a lock (single-threaded operation), can only be > at generation 0 or 1, and the base_crng.key has changed. Which leads me to > ask: shouldn't we increase the generation counter always (or at least if > arch_init is true)? And just make icnrementing crng_init to 2 depending on > trust_cpu?
Interesting consideration. I think incrementing the generation counter there unconditionally can't hurt. It should be done every time the base_crng key changes, which there it clearly does since we're extracting into it. I'll go ahead and do that.
Jason
| |