Re: [PATCH 10/10] drivers/char: Support compiling out the getrandom(2) syscall
From: josh
Date: Fri Jan 23 2015 - 17:30:16 EST
On Fri, Jan 23, 2015 at 02:46:10PM -0500, Theodore Ts'o wrote:
> On Fri, Jan 23, 2015 at 12:37:16PM -0600, Tom Zanussi wrote:
> > Many embedded systems have no use for getrandom, and could benefit
> > from the size savings gained by omitting it. Add a new EXPERT config
> > option, CONFIG_GETRANDOM_SYSCALL (default y), to support compiling it
> > out.
>
> I'm really not sure this is a good idea. Even the tiniest embedded
> device need secure crypto.
[...]
> We know already that home routers are running ancient kernels that are
> absolutely no protection whatever. Is saving a few bytes really worth
> potentially opening up a similar attack vector on devices that will
> probably be at least an order of magnitude or more numerous than home
> routers, and even harder to upgrade once they get out there?
>
> And if you don't have a good random number generator, you really are
> *toast*.
>
> It's for this reason that /dev/[u]random were not eligible from being
> disabled from the very beginning; it's too much of an attractive
> nuisance to a clueless product manager....
Forcing the availability of the random devices and getrandom syscall
will not force userspace to actually *use* them, and there do exist real
devices that do not need them.
We're not yet talking about the full in-kernel entropy infrastructure,
which should also be removable *if* you aren't using it for CONFIG_NET
or similar. We're talking about the userspace interfaces. If you
aren't running any userspace bits that open /dev/*random or that call
getrandom, forcing the existence of those devices will not magically
make the system more secure. Not all userspaces actually need
randomness, and some of those that do have better alternatives than
/dev/*random or getrandom (such as hardware RNGs).
- Josh Triplett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/