Conversation

The Linux kernel needs a strong CSPRNG in early boot. It doesn't have a real excuse for this being broken. There should be no issue with every program on the system using getrandom from early boot especially since the Linux kernel had important uses for the CSPRNG before PID 1.
1
6
For example, the Linux kernel has to use the CSPRNG for kernel and userspace ASLR bases, kernel and userspace SSP, memory tagging and other probabilistic mitigations. There are also many important and real use cases for generating keys and making secure network connections early.
1
2
Even if the persistent keys have already been previously generated, it's necessary to have a proper CSPRNG to create secure connections with those keys, due to how protocols are implemented with forward secrecy. A weak CSPRNG will compromise connections even with existing keys.
1
3
The baseline should be provided by a few things: regularly saving entropy and restoring that in early boot, passing gathered entropy from each boot stage to the following boot stage and obtaining it from hardware CSPRNG support. Kernel can also generate more than enough itself.
1
3
There are existing protocols for passing entropy to the kernel from the previous boot stage via the EFI RNG protocol or the device tree. Unfortunately, until recently, the Linux kernel made poor use of this. Using bootloaders like GRUB between UEFI and the kernel also breaks it.
1
3
Instead of fixing the real issues, Linus is proposing making a backwards incompatible change to the API that will silently break userspace and open up security vulnerabilities. On top of that, he proposes further overcomplications to what should be a simple and reliable API...
1
3
If anything, the security vulnerability in the /dev/urandom API should be fixed and the cargo cult /dev/random and GRND_RANDOM APIs should be deprecated and replaced with a meaningful API to approach VM cloning, an attacker leaking state, etc. by waiting for a full CSPRNG reseed.
4
Agreed, the kernel is doing a terrible job at this and the getrandom API being properly designed is making people aware of that which is a good thing. I don't understand why the Linux kernel needs to be so painfully forced into doing things sanely particularly in areas like this.