From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: bug#23605: /dev/urandom not seeded across reboots Date: Fri, 27 May 2016 21:12:01 -0400 Message-ID: <20160528011201.GA1753@jasmine> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6SoN-0005r9-Su for bug-guix@gnu.org; Fri, 27 May 2016 21:13:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6SoJ-00007O-J2 for bug-guix@gnu.org; Fri, 27 May 2016 21:13:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:58992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6SoI-00007K-Cr for bug-guix@gnu.org; Fri, 27 May 2016 21:13:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1b6SoI-0006bO-AS for bug-guix@gnu.org; Fri, 27 May 2016 21:13:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <87d1obabj8.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 23605@debbugs.gnu.org On Tue, May 24, 2016 at 02:24:59PM +0200, Ludovic Courtès wrote: > Leo Famulari skribis: > > > I realized that we don't seem to be saving any of the entropy in the > > kernel's random pool [0] across reboots. > > > > This means that for some period after boot, /dev/urandom may not be safe > > to use. From random(4): > > Good catch! > > Some comments: > > > +(define %urandom-seed-activation > > + ;; Activation gexp for the urandom seed > > + #~(begin > > + (use-modules (guix build utils)) > > + > > + (mkdir-p "/var/run") > > + (close-port (open-file "/var/run/urandom-seed" "a0b")) > > Or simply ‘open-output-file’. I don't see a way to use (open-output-file) in "append" mode as with (open-file). Without that, the file is cleared before it is read in the following lines.