Re: Stop breaking the CSRNG
From: Adam Borowski
Date: Thu Oct 03 2019 - 07:51:40 EST
On Thu, Oct 03, 2019 at 10:13:39AM +0000, David Laight wrote:
> From: Kurt Roeckx
> > Sent: 02 October 2019 17:56
> > As OpenSSL, we want cryptograhic secure random numbers. Before
> > getrandom(), Linux never provided a good API for that, both
> > /dev/random and /dev/urandom have problems. getrandom() fixed
> > that, so we switched to it were available.
>
> The fundamental problem is that you can't always get ' cryptograhic secure
> random numbers'. No API changes are ever going to change that.
>
> The system can either return an error or sleep (possibly indefinitely)
> until some 'reasonably random' numbers are available.
>
> A RISC-V system running on an FGPA (I've only used Altera NIOS cpu)
> may have absolutely no sources of randomness at boot time.
I'd say this is a hardware security vulnerability; no different from eg.
having no or faulty MMU, speculation that allows exfiltrating data, etc.
We did not understand the seriousness of lacking hardware sources of
randomness, but that's a common thing to many other security
vulnerabilities.
Machines that lack any sources of entropy have their uses, but they're akin
to processors with no MMU. You should never run a world-accessible ssh
daemon on either of them.
> Saying the architecture must include a random number instruction
> doesn't help!
It won't fix existing systems, and is irrelevant to deeply embedded, but
communicating this requirement to SoC designers sounds like a good idea to
me. IoTrash appliance makers won't care but their security is already so
atrocious that lack of entropy is nowhere near the easiest way to get in,
while anyone else will at least notice the warning.
Any real-silicon hardware can include an entropy source, and if it doesn't,
shaming the maker is the way to go. Calling the problem a security
vulnerability (which I say it is) sends a stronger message.
Meow!
--
âââââââ A MAP07 (Dead Simple) raspberry tincture recipe: 0.5l 95% alcohol,
âââââââ 1kg raspberries, 0.4kg sugar; put into a big jar for 1 month.
âââââââ Filter out and throw away the fruits (can dump them into a cake,
âââââââ etc), let the drink age at least 3-6 months.