Skip to Content [alt-c]

Andrew Ayer


LibreSSL's PRNG is Unsafe on Linux [Update: LibreSSL fork fix]

Comment by Andrew Ayer

Posted in reply to Comment by Reader x.

This comment is owned by whoever posted it. I am not responsible for it in any way.

pthread_atfork() requires linking with libpthread, which a single-threaded program would not normally do. Otherwise, it's not a bad suggestion. Checking process creation time is a very interesting suggestion (not perfect due to clock changes but still pretty darn good). Can it be done without needing to read /proc, which wouldn't exist in a chroot jail?

Still, on top of everything LibreSSL does to automatically detect forks, it should still expose a way to explicitly reseed the PRNG in an OpenSSL-compatible way, since OpenSSL has made guarantees that certain functions will re-seed the PRNG, and there may be some scenarios where even the best automatic fork detection fails (imagine a program calling the clone syscall directly for whatever reason, in which case pthread_atfork handlers won't be called). Since LibreSSL is billed as a drop-in replacement for OpenSSL, you should not be able to write a valid program that's safe under OpenSSL's guarantees but not when linked with LibreSSL.

| Posted on 2014-07-15 at 01:15:53 UTC by Andrew Ayer | Parent | Reply to This

Post a Reply

Your comment will be public. If you would like to contact me privately, please email me. Please keep your comment on-topic, polite, and comprehensible. Use the "Preview" button to make sure your comment is properly formatted. Name and email address are optional. If you specify an email address it will be kept confidential.

Post Comment

(Optional; will be published)

(Optional; will not be published)

(Optional; will be published)

  • Blank lines separate paragraphs.
  • Lines starting with ">" are indented as block quotes.
  • Lines starting with two spaces are reproduced verbatim.
  • Text surrounded by *asterisks* is italicized.
  • Text surrounded by `back ticks` is monospaced.
  • URLs are turned into links.