Red Hat Bugzilla – Bug 1254032
8.1.1 advice on using getpid to avoid fork problems is dangerously wrong
Last modified: 2015-08-16 20:22:22 EDT
Description of problem:
If one forks a process, the original process dies and then the second one forks again the last forked process can have the same pid as the original and so getpid will not detect a change. This was a widely noted weakness in LibreSSL (see https://www.agwa.name/blog/post/libressls_prng_is_unsafe_on_linux.)
This is very probably systematically reproducible in possibly affected libraries but in practise should never really happen.