Linux RNG Improvements Aim For Better VM Security

Written by Michael Larabel in Linux Kernel on 25 February 2022 at 04:25 AM EST. 5 Comments
LINUX KERNEL
In addition to performance improvements for Linux's RNG code, Jason Donenfeld has also been working on security improvements around the kernel's random number generator code in the context of virtual machines. New patches he has been working on aim to address the issue of potentially having the same stream of random numbers when forking/cloning a VM.

The new patch series by Jason Donenfeld is about ensuring the same stream of random numbers isn't produced if forking/cloning a VM and/or rolling back that VM. Obviously if two VMs or a rolled back VM is able to produce the same random numbers that would have "catastrophic cryptographic consequences" and so this new kernel code better fends off such a situation.

The new patch work revives work originally started by Amazon/AWS engineers but then stalled some time ago. The code is listening for VMGENID ACPI notifications and then having the RNG reinitialize safely. The VMGENID is short for VM Generation ID and is actually a specification started by Microsoft but beyond Hyper-V is also supported now by QEMU. For handling the VMGENID ACPI notifications, a new "vmgenid" virt driver is introduced. VMGENID is summed up as:
If the OS is running in a VM, there is a problem that most hypervisors can snapshot the state of the machine and later rewind the VM state to the saved state. This results in the machine running a second time with the exact same RNG state, which leads to serious security problems. To reduce the window of vulnerability, Windows 10 on a Hyper-V VM will detect when the VM state is reset, retrieve a unique (not random) value from the hypervisor, and reseed the root RNG with that unique value. This does not eliminate the vulnerability, but it greatly reduces the time during which the RNG system will produce the same outputs as it did during a previous instantiation of the same VM state.

More details on this pending Linux RNG improvement via this patch series. If all goes well this and the other recent RNG improvements will be found in Linux 5.18.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week