[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: lib/25367: arc4random state is shared across forks
The following reply was made to PR lib/25367; it has been noted by GNATS.
From: David Laight <david%l8s.co.uk@localhost>
Subject: Re: lib/25367: arc4random state is shared across forks
Date: Sun, 19 Aug 2012 09:01:48 +0100
Just bumped into this one while looking at other arc4random bugs.
There are two freebsd threads from september 2008 explaining that
openbsd had added a getpid() call prior to every arc4random() one
in order to detect this - butthat is slow. See:
There is a more general problem of detecting fork() - arc4random()
isn't the only affected code.
Optimising getpid() (or having an optimised getpid() function) is one
possibility. All that requires is for libc to zero the cached pid
value in the child of fork().
Although vfork() and others? may need special consideration.
David Laight: david%l8s.co.uk@localhost
Main Index |
Thread Index |