arc4random weakness

Andrey Chernov ache at freebsd.org
Thu Mar 16 19:26:20 UTC 2017


On 16.03.2017 20:24, Xin LI wrote:
> On Wed, Mar 15, 2017 at 1:13 PM, Andrey Chernov <ache at freebsd.org> wrote:
>> On 15.03.2017 16:06, Steven Chamberlain wrote:
>>> Also it is great to see INHERIT_ZERO was added to mmap(2)!
>>
>> It is not so great. For a program which forks very often zeroing even
>> one page will be slowdown. It will be better and faster to implement it
>> as fork syscall wrapper setting single variable, as it already done for
>> threaded lib.
> 
> I think it's exactly what it was done (and unlike a fork wrapper, the
> zeroing only happens on-demand, i.e. when the page is first touched).

Theo kindly explained that zeroing whole page instead of single variable
suits to his newest arc4random better, since clears two structs at once
(including ChaCha state), making some form of backward secrecy.




More information about the freebsd-hackers mailing list