Re: [PATCH] random: fix crash on multiple early calls to add_bootloader_randomness()
From: Dominik Brodowski
Date: Fri Nov 05 2021 - 03:54:07 EST
Am Wed, Nov 03, 2021 at 08:27:39AM +0100 schrieb Ard Biesheuvel:
> > > > - if (unlikely(crng_init == 0)) {
> > > > + /* We cannot do much with the input pool until it is set up in
> > > > + * rand_initalize(); therefore just mix into the crng state.
> > > > + * As this does not affect the input pool, we cannot credit
> > > > + * entropy for this.
> > > > + */
> > > > + if (unlikely(crng_init == 0) || unlikely(crng_global_init_time == 0)) {
> > >
> > > Can we just drop the unlikely()s here?
> >
> > As that would be a different change to the one necessary to resolve the bug,
> > I'd like to defer that decision to the maintainer of random.c.
> >
>
> In that case, can we at least using a single unlikely() for the whole condition?
Fixed for v3.
Thanks,
Dominik