From owner-freebsd-hackers@freebsd.org Thu Mar 16 13:19:54 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A905BD0CED0; Thu, 16 Mar 2017 13:19:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BC331781; Thu, 16 Mar 2017 13:19:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v2GDJkXC060372 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Mar 2017 15:19:46 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v2GDJkXC060372 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v2GDJktA060371; Thu, 16 Mar 2017 15:19:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 16 Mar 2017 15:19:46 +0200 From: Konstantin Belousov To: Dag-Erling Sm??rgrav Cc: Andrey Chernov , freebsd-security@freebsd.org, freebsd-hackers@freebsd.org, Steven Chamberlain Subject: Re: arc4random weakness Message-ID: <20170316131946.GN16105@kib.kiev.ua> References: <20170313220639.GB65190@pyro.eu.org> <20170315130615.GC25448@pyro.eu.org> <5160183b-9778-59aa-6cf9-118014a588eb@freebsd.org> <86k27pz8sy.fsf@desk.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86k27pz8sy.fsf@desk.des.no> User-Agent: Mutt/1.8.0 (2017-02-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Mar 2017 13:19:54 -0000 On Thu, Mar 16, 2017 at 01:48:45PM +0100, Dag-Erling Sm??rgrav wrote: > Andrey Chernov writes: > > Steven Chamberlain writes: > > > 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. > > Wouldn't it be possible to just set up the page entry but leave it > unmapped, so that it is paged in (and zeroed if necessary) on first > access? Thus, a process that uses arc4random() and fork()s would not > incur a penalty until (and unless) the child uses arc4random() too. This is how the forking code works, without any additional coding, for the INHERIT_ZERO regions as well. > > > It will be better and faster to implement it as fork syscall wrapper > > setting single variable, as it already done for threaded lib. > > fork() and vfork() and pdfork() and... From a security point of view, I > prefer to have it in a single place. > > DES > -- > Dag-Erling Sm??rgrav - des@des.no > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"