Re: [PATCH] tools/nolibc: stackprotector: Avoid stalling program startup if crng is not init yet

From: Willy Tarreau

Date: Sun May 24 2026 - 00:25:57 EST


On Sat, May 23, 2026 at 07:29:53AM +0900, Daniel Palmer wrote:
> Hi Thomas,
>
> On Fri, 22 May 2026 at 23:46, Thomas Weißschuh <linux@xxxxxxxxxxxxxx> wrote:
>
> > > > Anyhow, I switched compilers for my nommu target and everything
> > > > stopped working, tracked it down to this. my other compiler must
> > > > have not supported the stack protector.
> >
> > Did the random pool *never* fully initialize?
> > That sounds weird.
>
> The crng init message is eventually printed after a while if I
> interact with the shell[0].
> Since my init, shell, everything is written with nolibc now there is
> so little disk activity etc I don't think there are enough interrupts
> happening to collect any randomness.

Yeah I've known this problem as well for years on small headless
systems that never finish to boot if you ever called getrandom(),
before GRND_INSECURE existed. Several of us used to patch it not
to wait or used to change boot code not to call this function.

> Maybe something to save some seeding data between boots is the next
> tool I need to write.

Since modern kernels support GRND_INSECURE, I suspect you would just
be wasting your time. Better rely on this for boot code.

Willy