Linux 6.11 Lands Support For getrandom() In The vDSO
([Linux Kernel] 4 Hours Ago
getrandom() vDSO)
- Reference: 0001480978
- News link: https://www.phoronix.com/news/Linux-6.11-Lands-getrandom-vDSO
- Source link:
Going back two years has been the effort for [1]adding getrandom() to the vDSO in order to enhance the performance. This work has yielded [2]as much as 15x the performance in showing [3]very fast while being secure user-space RNG needs . A few weeks back Linus Torvalds was [4]unconvinced by adding getrandom() to the vDSO , but after going back through the patches he gave it another go. Today the work has managed to be mainlined for Linux 6.11.
The getrandom() in the vDSO effort was led by Jason Donenfeld who is known for his work on WireGuard. Last week he sent in the code as part of the [5]RNG updates pull request and today it was honored by Linus Torvalds.
The code is [6]merged and summed up as:
"This adds getrandom() support to the vDSO.
First, it adds a new kind of mapping to mmap(2), MAP_DROPPABLE, which lets the kernel zero out pages anytime under memory pressure, which enables allocating memory that never gets swapped to disk but also doesn't count as being mlocked.
Then, the vDSO implementation of getrandom() is introduced in a generic manner and hooked into random.c.
Next, this is implemented on x86. (Also, though it's not ready for this pull, somebody has begun an arm64 implementation already)"
Great to see this milestone achieved so user-space can generate random bytes quickly and safely.
[1] https://www.phoronix.com/news/Linux-getrandom-vDSO
[2] https://www.phoronix.com/news/Linux-getrandom-vDSO-v7
[3] https://www.phoronix.com/news/getrandom-vDSO-RNG-Linux-6.11
[4] https://www.phoronix.com/news/Linus-Torvalds-No-Random-vDSO#google_vignette
[5] https://lore.kernel.org/lkml/20240719183308.1472668-1-Jason@zx2c4.com/
[6] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7a3fad30fd8b4b5e370906b3c554f64026f56c2f
The getrandom() in the vDSO effort was led by Jason Donenfeld who is known for his work on WireGuard. Last week he sent in the code as part of the [5]RNG updates pull request and today it was honored by Linus Torvalds.
The code is [6]merged and summed up as:
"This adds getrandom() support to the vDSO.
First, it adds a new kind of mapping to mmap(2), MAP_DROPPABLE, which lets the kernel zero out pages anytime under memory pressure, which enables allocating memory that never gets swapped to disk but also doesn't count as being mlocked.
Then, the vDSO implementation of getrandom() is introduced in a generic manner and hooked into random.c.
Next, this is implemented on x86. (Also, though it's not ready for this pull, somebody has begun an arm64 implementation already)"
Great to see this milestone achieved so user-space can generate random bytes quickly and safely.
[1] https://www.phoronix.com/news/Linux-getrandom-vDSO
[2] https://www.phoronix.com/news/Linux-getrandom-vDSO-v7
[3] https://www.phoronix.com/news/getrandom-vDSO-RNG-Linux-6.11
[4] https://www.phoronix.com/news/Linus-Torvalds-No-Random-vDSO#google_vignette
[5] https://lore.kernel.org/lkml/20240719183308.1472668-1-Jason@zx2c4.com/
[6] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7a3fad30fd8b4b5e370906b3c554f64026f56c2f
KDE_FOREVER