GNU C Library Merges Support for getrandom vDSO
([GNU] 3 Hours Ago
glibc getrandom vDSO)
- Reference: 0001505527
- News link: https://www.phoronix.com/news/glibc-getrandom-vDSO-Merged
- Source link:
Back in Linux 6.11 [1]support for getrandom() in the vDSO was upstreamed for [2]much better performance in providing [3]speedy yet secure random number generation (RNG) needs. Since Linux 6.11 [4]getrandom in the vDSO has expanded to more CPU architectures and now there's a notable user-space user ready to go: the GNU C Library "glibc" support was merged.
The patch enabling getrandom() vDSO usage by the GNU C Library was upstreamed yesterday into Glibc Git. Adhemerval Zanella of Linaro and co-author Jason Donenfeld explain in the Glibc support [5]patch :
"linux: Add support for getrandom vDSO
Linux 6.11 has getrandom() in vDSO. It operates on a thread-local opaque state allocated with mmap using flags specified by the vDSO.
Multiple states are allocated at once, as many as fit into a page, and these are held in an array of available states to be doled out to each thread upon first use, and recycled when a thread terminates. As these states run low, more are allocated.
To make this procedure async-signal-safe, a simple guard is used in the LSB of the opaque state address, falling back to the syscall if there's reentrancy contention.
...
It is currently enabled for x86_64, which is available in Linux 6.11, and aarch64, powerpc32, powerpc64, loongarch64, and s390x, which are available in Linux 6.12."
Thus with the Glibc 2.41 release due out around the start of February, getrandom vDSO will be utilized when running on recent Linux kernel versions in providing faster yet secure RNG.
[1] https://www.phoronix.com/news/Linux-6.11-Lands-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/getrandom-vDSO-More-CPU-Ports
[5] https://sourceware.org/git/?p=glibc.git;a=commit;h=461cab1de747f3842f27a5d24977d78d561d45f9
The patch enabling getrandom() vDSO usage by the GNU C Library was upstreamed yesterday into Glibc Git. Adhemerval Zanella of Linaro and co-author Jason Donenfeld explain in the Glibc support [5]patch :
"linux: Add support for getrandom vDSO
Linux 6.11 has getrandom() in vDSO. It operates on a thread-local opaque state allocated with mmap using flags specified by the vDSO.
Multiple states are allocated at once, as many as fit into a page, and these are held in an array of available states to be doled out to each thread upon first use, and recycled when a thread terminates. As these states run low, more are allocated.
To make this procedure async-signal-safe, a simple guard is used in the LSB of the opaque state address, falling back to the syscall if there's reentrancy contention.
...
It is currently enabled for x86_64, which is available in Linux 6.11, and aarch64, powerpc32, powerpc64, loongarch64, and s390x, which are available in Linux 6.12."
Thus with the Glibc 2.41 release due out around the start of February, getrandom vDSO will be utilized when running on recent Linux kernel versions in providing faster yet secure RNG.
[1] https://www.phoronix.com/news/Linux-6.11-Lands-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/getrandom-vDSO-More-CPU-Ports
[5] https://sourceware.org/git/?p=glibc.git;a=commit;h=461cab1de747f3842f27a5d24977d78d561d45f9
phoronix