News for hackers. Stuff that matters.
Re:Linux RNG RFC Patch: implement getrandom() in vDSO by fefe23 on Friday July 29, 2022 @02:33PM (#32280316)
This looks like an excellent idea. I will implement support for it in my libc immediately when it's available in a release kernel.

Currently userspace has incentive to roll their own RNG stuff. This removes that, which is good for everyone. The less incentive you give people to write code that has already been written by other, more experienced people, the better.

I would go even further and export the kernel ciphers via vDSO. Then user space could rely on those ciphers being optimized for the host CPU and side channel free instead of everybody bringing their own crypto primitives. I don't think there is a good reason why gnupg and openssl would bring different crypto primitives.

Re:Linux RNG RFC Patch: implement getrandom() in vDSO by thadt on Friday July 29, 2022 @06:20PM (#32282422)
Isn't there already userspace access to the kernel's crypto machinery?

https://www.kernel.org/doc/html/latest/crypto/userspace-if.h...

Re:Linux RNG RFC Patch: implement getrandom() in vDSO by simcop2387 on Friday July 29, 2022 @07:23PM (#32282821)
Doing it through vdso has performance advantages because it elides a lot of the syscall overhead. This works make the crypto stack be more advantageous they it was previously
Re:Linux RNG RFC Patch: implement getrandom() in vDSO by fefe23 on Friday July 29, 2022 @07:54PM (#32283001)
You are right, I was not aware of that!

This way may actually have advantages over vDSO. Maybe you can set up IV and key with the kernel and then let the kernel do the crypto without having to have them in user space memory anymore. That would be a way to reduce risk in crypto applications, as long as you can prevent an attacker who has taken over the crypto app to retrieve the keys from the kernel. Maybe seccomp can help here.

Very exciting!

Re:Linux RNG RFC Patch: implement getrandom() in vDSO by badrabbit on Saturday July 30, 2022 @02:40AM (#32284833)
What is your libc?
Re:Linux RNG RFC Patch: implement getrandom() in vDSO by mschuster91 on Saturday July 30, 2022 @05:43AM (#32285501)
Judging by the username, they may be German blogger Fefe, who has written their own libc: https://www.fefe.de/dietlibc/