News for hackers. Stuff that matters.
Re:Linux Kernel 5.3 by leni536 on Monday September 16, 2019 @12:08PM (#20985507)
> The correct fix is to fix getrandom() to not block when it's not appropriate,...

I'm not a cryptography expert, but this suggestion doesn't look right.

Edit: IMO the main problem is the lack of a forward progress guarantee for entropy generation, even if there are suitable sources for entropy in the system.

Re:Linux Kernel 5.3 by banachtarski on Monday September 16, 2019 @12:22PM (#20985673)
I've worked in crypto before (not now though) and your statement is actually a common misconception. The information about whether the randomness is sourced from "true" entropy or not is in and of itself a form of entropy from the perspective of an assailant. It's enough that given some period of time, "some" amount of entropy is present and how much is dependent on the degree to which the system is used. You can use a game theoretic approach to determine how much that is.

edit: to clarify, occasionally not using /dev/random when it may block is not actually a security issue (in most cases)

Re:Linux Kernel 5.3 by ses1984 on Monday September 16, 2019 @12:30PM (#20985763)
How do we know which cases?
Re:Linux Kernel 5.3 by masklinn on Monday September 16, 2019 @01:08PM (#20986207)
The only case where it could be an issue is at bootup, when the subsystem simply does not have enough entropy. OpenBSD solved that by storing a seed for next bootup at the end of boot and during shutdown.
Re:Linux Kernel 5.3 by asamarin on Monday September 16, 2019 @04:34PM (#20988290)
So what happens at the very first boot (e.g. after system installation, or cloud instance just being spawned)? Is that the only circumstance where it would be OK to block? Does OpenBSD trust RdRand for such occasions?
Re:Linux Kernel 5.3 by ChrisSD on Monday September 16, 2019 @06:33PM (#20989212)
You can set /etc/random.seed (or /var/db/host.random for spawned instances) prior to first boot. That's what cloud providers do IIRC. It also mixes in hardware random (if available).
Re:Linux Kernel 5.3 by boring_twenties on Monday September 16, 2019 @08:13PM (#20989855)
> Does OpenBSD trust RdRand for such occasions?

It is used as one source among many to seed the PRNG, so I think the answer is no.

Re:Linux Kernel 5.3 by gnud on Monday September 16, 2019 @06:33PM (#20989214)
A new cloud instance seems like a small problem. The host could just generate an entropy file for the first boot.
Re:Linux Kernel 5.3 by caf on Tuesday September 17, 2019 @12:38AM (#20991610)
Yes - the hard case is a little flash-based low power ARM router, cloned by the million.
Re:Linux Kernel 5.3 by Reelin on Tuesday September 17, 2019 @03:46AM (#20992654)
From 2012, but still at least somewhat relevant (https://factorable.net/weakkeys12.extended.pdf).

> RSA and DSA can fail catastrophically when used with malfunctioning random number generators ... network survey of TLS and SSH servers and present evidence that vulnerable keys are surprisingly widespread ... we are able to obtain RSA private keys for 0.50% of TLS hosts and 0.03% of SSH hosts, because their public keys shared nontrivial common factors due to entropy problems, and DSA private keys for 1.03% of SSH hosts, because of insufficient signature randomness ... the vast majority appear to be headless or embedded devices ...

Re:Linux Kernel 5.3 by simonh on Monday September 16, 2019 @02:09PM (#20986919)
I hope the seed is very well protected.
Re:Linux Kernel 5.3 by VibrantClarity on Monday September 16, 2019 @03:31PM (#20987713)
wdym? if an attacker can access your filesystem its already game over
Re:Linux Kernel 5.3 by iforgotpassword on Tuesday September 17, 2019 @05:41AM (#20993283)
The same could be said for some of the entropy sources that were nerfed or removed over time due to security concerns. That's the main reason why we even are in this situation today.
Re:Linux Kernel 5.3 by trasz on Monday September 16, 2019 @12:22PM (#20985674)
PRNG needs entropy, but it doesn't consume it. You don't need to feed entropy into it continuously.
Re:Linux Kernel 5.3 by msla on Monday September 16, 2019 @03:25PM (#20987658)
> PRNG needs entropy, but it doesn't consume it. You don't need to feed entropy into it continuously.

In the extreme case, this means you can run a PRNG with a fixed seed indefinitely, which is definitely wrong because such a PRNG will necessarily loop.

That might not be feasible to exploit, however.

Re:Linux Kernel 5.3 by stouset on Monday September 16, 2019 @04:02PM (#20988010)
> such a PRNG will necessarily loop

Given infinite time, energy, and computing power, yes. Given computers made out matter and running on energy for use by meat-based intelligences, no.

This is really analogous to saying "technically a 256-bit encryption key is brute-forceable". In fact, this is so close to being the actual underlying situation it's barely even an analogy.

Re:Linux Kernel 5.3 by dmitrygr on Monday September 16, 2019 @01:37PM (#20986580)
> even if there are suitable sources for entropy in the system

What might those be on, say, a freshly booted RasPi that hasn't even brought up much of userspace besides systemd?

Re:Linux Kernel 5.3 by leni536 on Tuesday September 17, 2019 @02:18AM (#20992178)
The problematic commit reduced the number of disk IO at bootup which resulted in starving getrandom() from the necessary entropy. If disk IO is already considered a reliable source of entropy then there is no reason to not actively exercise it when entropy is needed.
Re:Linux Kernel 5.3 by jlgaddis on Monday September 16, 2019 @07:29PM (#20989575)
The Raspberry Pi has a HWRNG onboard.
Re:Linux Kernel 5.3 by dmitrygr on Monday September 16, 2019 @08:22PM (#20989907)
Do you trust it?
Re:Linux Kernel 5.3 by tatersolid on Tuesday September 17, 2019 @05:34AM (#20993251)
You’re forced to trust the maker of your CPU, mainboard, etc. if you can’t trust your hardware you’re toast. There’s nothing special about RNGs in this regard.
Re:Linux Kernel 5.3 by pmoriarty on Monday September 16, 2019 @12:54PM (#20986037)
Something else I'd wonder is whether there are other sources of entropy that could be used here other than the disk -- as improving disk IO is what seems to have caused this particular issue in the first place.