Re: [PATCH] random: allow writes to /dev/urandom to influence fast init

From: Theodore Ts'o
Date: Wed Mar 23 2022 - 08:32:21 EST


On Tue, Mar 22, 2022 at 10:00:49PM -0600, Jason A. Donenfeld wrote:
>
> Another variation on that would be to do what this current patch does,
> but only crng_pre_init_inject() on CAP_SYS_ADMIN. But this has the same
> pitfall of only working as intended at cnrg_init=0 but not crng_init=1.
> That's better than nothing, but it's not perfect, and it introduces that
> problem with RNDADDTOENTCNT.

Well, one could argue that "RNDADDTOENTCNT" is a problem that has
always been there, and it already requires CAP_SYS_ADMIN. So I'm not
sure it makes it any worse.

> > > And perhaps we might consider attempting to deprecate RNDADDTOENTCNT at
> > > some point in the future.
> >
> > That would be a good idea.  :-)
>
> Oh cool, I'm glad you agree. Let's do that then. Have a preferred path?
> Maybe just a pr_once() saying not to use it?

Probably. We could get more aggressive (e.g., WARN), but the first
Google search on RNDADDTOENTCNT returned:

https://github.com/jumpnow/rndaddtoentcnt

So I'm now regretting not silently making it vanish a decade or more ago...

- Ted