Re: Is fork() hook ever possible?

From: Andrey Chernov <ache_at_nagual.pp.ru>
Date: Wed, 17 Sep 2008 11:55:13 +0400
On Tue, Sep 16, 2008 at 08:41:33PM +0000, Poul-Henning Kamp wrote:
> In message <200809161628.54085.jhb_at_freebsd.org>, John Baldwin writes:
> 
> >The PID isn't the seed, he's using a PID change as a notification that the 
> >process needs to do a re-stir the next time it wants a psuedo-random number 
> >(b/c the PID change means it is now a new process).
> 
> Seems to be a vast overkill to me, in countless other contexts,
> it is the responsibility of the programmer to do what needs done on
> a fork, and I see no reason why this couldn't be likewise.

The situation is not so simple since the library functions can call 
ar4random() internally (like mktemp() family already and always does) and 
the programmer should always know all of such usage (which is impossible) 
or always call arc4random_stir() directly by himself (which no portable 
code will do).

-- 
http://ache.pp.ru/
Received on Wed Sep 17 2008 - 05:55:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:35 UTC