-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix seeding from random device w/o getrandom syscall #8251
Fix seeding from random device w/o getrandom syscall #8251
Conversation
Use select to wait for /dev/random in readable state, but do not actually read anything from /dev/random, use /dev/urandom first. Use linux define __NR_getrandom instead of the glibc define SYS_getrandom, in case the kernel headers are more current than the glibc headers. Fixes openssl#8215
This needs a kernel patch to be fully functional: But without the kernel patch it is also an improvement, because |
Actually with the kernel patch the syscall getrandom will be faster, because the |
Any update on this? |
I have meanwhile posted a V5 of the linux patch here: I got a first reply from Theodore Y. Ts'o, but I am still waiting for his final decision. The main issues this patch addresses, are:
This fixes also some issues, I did not notice initially:
|
That's all related to the kernel, and it's good to know. Does it
have any effect on this PR? Can it be merged?
|
Well yes, I think so. @levitte do you agree? It is theoretically possible to see select blocking but only when you use a mis-configured |
OK, @levittes review comments are addressed, unless someone objects I'll merge this in the evening.
Use select to wait for /dev/random in readable state, but do not actually read anything from /dev/random, use /dev/urandom first. Use linux define __NR_getrandom instead of the glibc define SYS_getrandom, in case the kernel headers are more current than the glibc headers. Fixes #8215 Reviewed-by: Kurt Roeckx <[email protected]> (Merged from #8251) (cherry picked from commit 38023b8)
Use select to wait for /dev/random in readable state, but do not actually read anything from /dev/random, use /dev/urandom first. Use linux define __NR_getrandom instead of the glibc define SYS_getrandom, in case the kernel headers are more current than the glibc headers. Fixes #8215 Reviewed-by: Kurt Roeckx <[email protected]> (Merged from #8251)
Let me know if you want more info - or want me to try something out on this platform. |
OK, something more to patch-out downstream. :( |
Should we change the select on /dev/random a Linux only thing? |
That would make sense. |
Use select to wait for /dev/random in readable state,
but do not actually read anything from /dev/random,
use /dev/urandom first.
Use linux define __NR_getrandom instead of the
glibc define SYS_getrandom, in case the kernel headers
are more current than the glibc headers.
Fixes #8215
Checklist