From debbugs-submit-bounces@debbugs.gnu.org Mon May 23 13:59:00 2016 Received: (at submit) by debbugs.gnu.org; 23 May 2016 17:59:00 +0000 Received: from localhost ([127.0.0.1]:35109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b4u83-0005ay-OX for submit@debbugs.gnu.org; Mon, 23 May 2016 13:59:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b4u82-0005al-MV for submit@debbugs.gnu.org; Mon, 23 May 2016 13:58:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4u7u-0006gF-Ak for submit@debbugs.gnu.org; Mon, 23 May 2016 13:58:53 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:58635) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4u7u-0006fa-3t for submit@debbugs.gnu.org; Mon, 23 May 2016 13:58:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4u7r-00043H-2T for bug-guix@gnu.org; Mon, 23 May 2016 13:58:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4u7m-0006dG-LP for bug-guix@gnu.org; Mon, 23 May 2016 13:58:46 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:60331) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4u7l-0006ax-9c for bug-guix@gnu.org; Mon, 23 May 2016 13:58:42 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1377B20723; Mon, 23 May 2016 13:58:33 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Mon, 23 May 2016 13:58:33 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= content-type:date:from:message-id:mime-version:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=Webc0B+W4JhWYLdvw/CV9Hu6/uQ =; b=QnDdQyX0htO1pT3+aVy8o9SuMl6TKm1gtL2EGaLB8xqiN/6MD45Y9gys3oZ P8TrxKjb/IrKC23GtSzWuRbDCGBBiQUCr9Naz5QWeRfFL2Yvjfz/Pq18G8h0CspW jeqOudnEAzeHKd7GH+0ej0WJEP60//xphFnSYmXfjRoLtgg0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=We bc0B+W4JhWYLdvw/CV9Hu6/uQ=; b=iPWq9CEkQ8qGk6wZYBoAq7/y47frTu3xVI 2M6Np3XhJP1y82yWkAfekQGID5iZcK2MAGsBxKUoztsMzazzUWZBNzR78CBNGrav RIASspLN5Mvh+kJukZshWlZ5lPCTHRyiQ3V3GDUt3ZQTnOkovS0IORkgVlw2oj98 DnyKM1LTw= X-Sasl-enc: Qa7WHC5kF/DYGq8jpJ/G0hbKCF08BYVaBYx325Zdag4K 1464026312 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id BC50CF29F6 for ; Mon, 23 May 2016 13:58:32 -0400 (EDT) Date: Mon, 23 May 2016 13:58:32 -0400 From: Leo Famulari To: bug-guix@gnu.org Subject: /dev/urandom not seeded across reboots Message-ID: <20160523175832.GA10646@jasmine> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="VS++wcV0S1rZb1Fb" Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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): --- If a seed file is saved across reboots as recommended below (all major Linux distributions have done this since 2000 at least), [/dev/urandom's] output is cryptographically secure against attackers without local root access as soon as it is reloaded in the boot sequence, and perfectly adequate for network encryption session keys. --- I interpret that text to mean that, without use of a seed file, urandom's output is *not* adequate for network encryption session keys (SSH, TLS, etc) until enough entropy has been gathered. I don't know how long that takes. I've attached my not-yet-working attempt at a urandom-seed-service. I tried to get it working on my own but I need the assistance of some more experienced Guix hackers :) I've also attached a stand-alone Guile script to illustrate what the effect of the service should be. This script does seem to work. I'm sure the use of shell tools could be replaced by Guile. After applying my patch and attempting `guix system vm ...`, I get the attached backtrace. Does anyone have advice about the service? Am I wrong that we need to seed /dev/urandom to make it work properly? [0] See the man page for random(4). --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="random.scm" ;;; Carry some entropy across reboots. Adapted from examples in random(4). ;;; We assume Linux >= 2.6, where the poolsize is always 4096 bits (according to ;;; random(4). Otherwise, the example in random(4) reads the 'poolsize' file and ;;; creates a seed of equal size. ;;; This should be run during system shutdown. It saves some random state as a ;;; seed for /dev/urandom, to be used on the next boot. (define (urandom-shutdown seed) (touch seed) (chmod seed #o600) (write-seed seed)) ;;; This should be run at boot, before starting anything that needs random ;;; numbers (sshd, TLS server, etc). (define (urandom-boot seed) (and (if (file-exists? seed) (zero? (system (string-append "cat " seed " > /dev/urandom"))) (touch seed)) (chmod seed #o600) (write-seed seed))) ;;; On Debian, '/var/lib/urandom/random-seed'. ;;; random(4) suggests '/var/run/random-seed'. (define seed "/tmp/random-seed") (define (write-seed seed) (zero? (system* "dd" "if=/dev/urandom" (string-append "of=" seed) "count=1" "bs=512"))) ;; If Linux is not >= 2.6, then 'bs' ;; must be calculated as shown in ;; random(4). (define (touch file) (close-port (open-file file "a0b"))) --VS++wcV0S1rZb1Fb Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="urandom-seed.patch" diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 96bf8da..4a85ed0 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -32,7 +32,7 @@ #:use-module ((gnu packages linux) #:select (eudev kbd e2fsprogs lvm2 fuse alsa-utils crda gpm)) #:use-module ((gnu packages base) - #:select (canonical-package glibc)) + #:select (canonical-package glibc coreutils)) ; coreutils for `dd`, `cat`. #:use-module (gnu packages package-management) #:use-module (gnu packages lsh) #:use-module (gnu packages lsof) @@ -93,6 +93,8 @@ gpm-service-type gpm-service + urandom-seed-service + %base-services)) ;;; Commentary: @@ -1200,6 +1202,47 @@ extra rules from the packages listed in @var{rules}." "Return a service that uses @var{device} as a swap device." (service swap-service-type device)) +(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")) + (chmod "/var/run/urandom-seed" #o600))) + +(define (urandom-seed-shepherd-service) + "Return a shepherd service for the /dev/urandom seed." + (list (shepherd-service + (documentation "Preserve entropy across reboots for /dev/urandom.") + (provision '(urandom-seed)) + (requirement '(user-processes)) ; whatever provides file-system /var + (start #~(lambda _ + (exec-command + (zero? + (system (string-append "cat " + "/var/run/urandom-seed" + " > /dev/urandom")))))) + (stop #~(lambda _ + (exec-command + (zero? + (system* "dd" "if=/dev/urandom" + (string-append "of=" "/var/run/urandom-seed") + "count=1" "bs=512")))))))) + +(define urandom-seed-service-type + (service-type (name 'urandom-seed) + (extensions + (list (service-extension shepherd-root-service-type + urandom-seed-shepherd-service) + (service-extension activation-service-type + (const %urandom-seed-activation)) + ;; Add urandom-seed to the system profile + ;; Where is profile-service-type defined? + (service-extension profile-service-type list))))) + +(define (urandom-seed-service) + (service urandom-seed-service-type '())) (define-record-type* gpm-configuration make-gpm-configuration gpm-configuration? @@ -1281,6 +1324,7 @@ This is the GNU operating system, welcome!\n\n"))) (static-networking-service "lo" "127.0.0.1" #:provision '(loopback)) (syslog-service) + (urandom-seed-service) (guix-service) (nscd-service) --VS++wcV0S1rZb1Fb Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=backtrace $ ./pre-inst-env guix system vm --no-grafts ~/work/guix/doc/os-config-bare-bones.texi Backtrace: In ice-9/boot-9.scm: 1724: 19 [%start-stack load-stack ...] 1729: 18 [#] In unknown file: ?: 17 [primitive-load "/home/leo/work/guix/scripts/guix"] In guix/ui.scm: 1197: 16 [run-guix-command system "vm" ...] In ice-9/boot-9.scm: 157: 15 [catch srfi-34 # ...] 157: 14 [catch system-error ...] In guix/scripts/system.scm: 882: 13 [#] 788: 12 [process-action vm # #] In guix/store.scm: 1163: 11 [run-with-store # ...] In guix/scripts/system.scm: 800: 10 [# #] 564: 9 [perform-action vm # # ...] In gnu/system/vm.scm: 496: 8 [system-qemu-image/shared-store-script # # # ...] In gnu/system.scm: 601: 7 [operating-system-derivation # # #f] In gnu/services.scm: 573: 6 [loop #] In srfi/srfi-1.scm: 578: 5 [map # (# # #)] In gnu/services.scm: 573: 4 [loop #< type: # parameters: #>] In srfi/srfi-1.scm: 578: 3 [map # (# # #)] In gnu/services.scm: 573: 2 [loop #< type: # parameters: ()>] In srfi/srfi-1.scm: 578: 1 [map # (# # # # ...)] In ice-9/eval.scm: 416: 0 [urandom-seed-shepherd-service ()] ice-9/eval.scm:416:20: In procedure urandom-seed-shepherd-service: ice-9/eval.scm:416:20: Wrong number of arguments to # --VS++wcV0S1rZb1Fb-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 03:05:30 2016 Received: (at 23605) by debbugs.gnu.org; 24 May 2016 07:05:30 +0000 Received: from localhost ([127.0.0.1]:35427 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b56PC-0000Q5-AJ for submit@debbugs.gnu.org; Tue, 24 May 2016 03:05:30 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35299) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b56PA-0000Ps-E9 for 23605@debbugs.gnu.org; Tue, 24 May 2016 03:05:28 -0400 Received: by mail-wm0-f65.google.com with SMTP id f75so3174416wmf.2 for <23605@debbugs.gnu.org>; Tue, 24 May 2016 00:05:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=webmcIl+e+9H+0rPora5OmH1dJ1si4/I1sNs6YSHMWI=; b=eD6xqxS8PloFDK4beebs5+bRrNnLaJJp6wdbq8R/CAiPj3etYdBiEdPyXxTZi2cIdi ky8PLSxZxaKpVweUrPFNYeyID8tNgCB1gQbQSOHuVoJHiWjbXlvyCJ8FWEuj+K5m3QSM J1izAfy9eR/ycsHl0PC63XOqCLuUrvyFmt5BsYcFIcSd96mbOmm4CCKt4++lKjT4nq9t eXQDZTH7OjGWCwBFbANcjyjGlKQb7vzupNiYTUW9H291Zc4gCqEoM+cvBeqH147YXgOf Es92/EGhQOe2jQjunGVrffyA2mqBKZ7vv+Q/o+ShFIZGZvqidR0cs4m496jlFZqnc6ZB Z02Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=webmcIl+e+9H+0rPora5OmH1dJ1si4/I1sNs6YSHMWI=; b=ZOOKdfLjqRo6DTuI7+3KjgaI45LHO8lPzP/JUi73F2THJYA8I1ZBuL0Bh9Gk+R94PP xOME13MH7ef+5QKSnZfXjMNmoDGz16DssxbyyVgic8UOsxE/abiXKHmku0CIUOpU4m32 jFASrKCkuahiqsH2Uaf2iSKEfy3jLTCG7Uc12UYQPedQelUCQTLdatgy3mPAdbX/IA+U 6NeZsZgNVbmVghkryadxLzQRm0zErk6ECKcQ85vPBTvNW4hV/2lD6q5MRKdqs76G0qgk dgc3Kz2uuY48J4wSDdTRxj82yEpogBYyxLwt+XrRHA9G8ZFHCoOQTuWjzJg1oSze42I0 EaLQ== X-Gm-Message-State: AOPr4FVC/5v/ZL75JTxiPuHDptRWWwxJf+R8X02E7spbMmVBEBzfyImlw3irDyCU9ynA7Q== X-Received: by 10.28.5.140 with SMTP id 134mr21752504wmf.80.1464073522742; Tue, 24 May 2016 00:05:22 -0700 (PDT) Received: from T420.taylan (aftr-109-91-36-70.unity-media.net. [109.91.36.70]) by smtp.gmail.com with ESMTPSA id c62sm1991367wmd.1.2016.05.24.00.05.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 May 2016 00:05:22 -0700 (PDT) From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) To: Leo Famulari Subject: Re: bug#23605: /dev/urandom not seeded across reboots References: <20160523175832.GA10646@jasmine> Date: Tue, 24 May 2016 09:05:21 +0200 In-Reply-To: <20160523175832.GA10646@jasmine> (Leo Famulari's message of "Mon, 23 May 2016 13:58:32 -0400") Message-ID: <87shx8j5qm.fsf@T420.taylan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Leo Famulari writes: > 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): > > --- > If a seed file is saved across reboots as recommended below (all major > Linux distributions have done this since 2000 at least), > [/dev/urandom's] output is cryptographically secure against attackers > without local root access as soon as it is reloaded in the boot > sequence, and perfectly adequate for network encryption session keys. > --- > > I interpret that text to mean that, without use of a seed file, > urandom's output is *not* adequate for network encryption session keys > (SSH, TLS, etc) until enough entropy has been gathered. I don't know how > long that takes. > > I've attached my not-yet-working attempt at a urandom-seed-service. I > tried to get it working on my own but I need the assistance of some more > experienced Guix hackers :) > > I've also attached a stand-alone Guile script to illustrate what the > effect of the service should be. This script does seem to work. I'm sure > the use of shell tools could be replaced by Guile. > > After applying my patch and attempting `guix system vm ...`, I get the > attached backtrace. > > Does anyone have advice about the service? Am I wrong that we need to > seed /dev/urandom to make it work properly? > > [0] See the man page for random(4). Yes, this is necessary under Linux if you want urandom to be random enough immediately after boot, and all the distros do it as part of their init. There's also an interesting implication here about the very first time you boot the system and don't have a urandom seed file from the last shutdown yet. I don't know how this is typically handled, given that for instance it's quite possible that a user might generate SSH keys shortly after their first boot of a system. I heard BSD kernels are smarter: /dev/random and urandom are the same file and behave as follows: after boot, until there's enough entropy, they block (behave like Linux /dev/random), and once there's enough entropy they never block (behave like Linux /dev/urandom). No idea how the Hurd does it. Taylan From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 08:25:15 2016 Received: (at 23605) by debbugs.gnu.org; 24 May 2016 12:25:15 +0000 Received: from localhost ([127.0.0.1]:35552 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5BOd-00010W-Gg for submit@debbugs.gnu.org; Tue, 24 May 2016 08:25:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35960) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5BOc-00010J-52 for 23605@debbugs.gnu.org; Tue, 24 May 2016 08:25:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5BOS-0002GZ-Vl for 23605@debbugs.gnu.org; Tue, 24 May 2016 08:25:09 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,PERCENT_RANDOM, RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5BOS-0002GO-SB; Tue, 24 May 2016 08:25:04 -0400 Received: from pluto.bordeaux.inria.fr ([193.50.110.57]:35346 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b5BOQ-0007m1-Lx; Tue, 24 May 2016 08:25:03 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Leo Famulari Subject: Re: bug#23605: /dev/urandom not seeded across reboots References: <20160523175832.GA10646@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 Prairial an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Tue, 24 May 2016 14:24:59 +0200 In-Reply-To: <20160523175832.GA10646@jasmine> (Leo Famulari's message of "Mon, 23 May 2016 13:58:32 -0400") Message-ID: <87d1obabj8.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.6 (---) 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 =E2=80=98open-output-file=E2=80=99. Maybe do: (define %random-seed-file "/var/run/random-seed") to avoid repeating the file name everywhere. > + (start #~(lambda _ > + (exec-command > + (zero? > + (system (string-append "cat " > + "/var/run/urandom-seed" > + " > /dev/urandom")))))) Instead of spawning =E2=80=98cat=E2=80=99, we can do: (when (file-exists? #$%random-seed-file) (call-with-input-file #$%random-seed-file (lambda (seed) (call-with-output-file "/dev/urandom" (lambda (random) (dump-port seed random)))))) #t ;service successfully =E2=80=9Cstarted=E2=80=9D > + (stop #~(lambda _ > + (exec-command > + (zero? > + (system* "dd" "if=3D/dev/urandom" > + (string-append "of=3D" "/var/run/urandom= -seed") > + "count=3D1" "bs=3D512")))))))) Likewise, I would suggest using: (let ((buf (make-bytevector 512))) (call-with-input-file "/dev/urandom" (lambda (random) (get-bytevector-n! random buf 512))) =E2=80=A6) Thanks for looking into it! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 12:16:19 2016 Received: (at 23605) by debbugs.gnu.org; 24 May 2016 16:16:19 +0000 Received: from localhost ([127.0.0.1]:36600 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5F0F-0006Vy-Du for submit@debbugs.gnu.org; Tue, 24 May 2016 12:16:19 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:36786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5F0E-0006Vp-3m for 23605@debbugs.gnu.org; Tue, 24 May 2016 12:16:18 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id DCB1A20861; Tue, 24 May 2016 12:16:17 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Tue, 24 May 2016 12:16:17 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=v2lT49TLX7+QK/MoMqF+ZLVXWr4=; b=e4Mij4 hbhDeKqCI//Q4kyplebPNbhO0APFvbCcNMD8hPOcnhS1pgPtLofZ43djaac1H+wV MGFWxYDwc8vuAW95Rx6jvvw1Ue9tu2pPKT46V8YnjTw1aGn/ag+Mcq6g7l8XlkqJ JmQ0X6SFFP7mCcG9v+bLVHq4xc6zONwbN76Qw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=v2lT49TLX7+QK/M oMqF+ZLVXWr4=; b=Uot+DdsLplJGA1I7YNg+9RwPYiSexcTe9UFLvd91okmp6b9 PQmH7w2kkdAcuj7Crj96GI+C07Aoyzo2sGOXXReeTyVuxgHHZmKtGibg4CuS1laf dvO06GDejEaM/5KukHWZxQuLTIIFOkpW5nmtPRxdpk3SNjmiza0KdBP2WAvg= X-Sasl-enc: fvymxC6Ro9hfe/yii4bX6j1kkoiTKC13i/w77zUFDuYx 1464106577 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 95FCBF2A06; Tue, 24 May 2016 12:16:17 -0400 (EDT) Date: Tue, 24 May 2016 12:16:17 -0400 From: Leo Famulari To: Taylan Ulrich =?utf-8?B?QmF5xLFybMSxL0thbW1lcg==?= Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160524161617.GC29516@jasmine> References: <20160523175832.GA10646@jasmine> <87shx8j5qm.fsf@T420.taylan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87shx8j5qm.fsf@T420.taylan> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tue, May 24, 2016 at 09:05:21AM +0200, Taylan Ulrich Bayırlı/Kammer wrote: > Leo Famulari writes: > > Does anyone have advice about the service? Am I wrong that we need to > > seed /dev/urandom to make it work properly? > > Yes, this is necessary under Linux if you want urandom to be random > enough immediately after boot, and all the distros do it as part of > their init. > > There's also an interesting implication here about the very first time > you boot the system and don't have a urandom seed file from the last > shutdown yet. I don't know how this is typically handled, given that > for instance it's quite possible that a user might generate SSH keys > shortly after their first boot of a system. When I boot a GuixSD VM for the first time [0], it requires me to dance on the keyboard until it has collected ~200 bits of entropy. I assumed this is to properly bootstrap the CSPRNG in /dev/urandom, but I'm not sure. [0] I don't remember if I had to do this on bare metal. From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 12:26:36 2016 Received: (at 23605) by debbugs.gnu.org; 24 May 2016 16:26:36 +0000 Received: from localhost ([127.0.0.1]:36608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5FAC-0006kM-EB for submit@debbugs.gnu.org; Tue, 24 May 2016 12:26:36 -0400 Received: from mail-yw0-f174.google.com ([209.85.161.174]:33332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5FAB-0006kA-1h for 23605@debbugs.gnu.org; Tue, 24 May 2016 12:26:35 -0400 Received: by mail-yw0-f174.google.com with SMTP id h19so21186088ywc.0 for <23605@debbugs.gnu.org>; Tue, 24 May 2016 09:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worcester-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=L7E7m79Hbs059yxp4T2pXZwSI7p+eW3yK90O2UefBl4=; b=SQPNFNZ5i9TRTR5QU/nvlbmv/VakxyIpf8upyYDfcioHy7xqQSBUTPkCjo+XbsC+ng xJKodv2VYP1lNCmrOl2W0RhV4igyr2vDIPdPREv6MkSbf2mR+w+mO1hTJgEAfc48VnmU a63B9pJvN6/r7768s6hqq6koVU+ZaGK11DSHTpdXg0AZf6lN1B5GL+F6mREUEQxrSfxG Lfxee9SLEmgKEKZJuuzHyKY5X5KwV8bYqhFIg8xdDTo04nC3510u9RF6exMSxohZDtGQ gt/4OeRwoCDCDv2yhuzpkzqyLER35YLslMowWiHIVBd/6Rawk/Yk3T9l2PxO/9LiawWT JP6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=L7E7m79Hbs059yxp4T2pXZwSI7p+eW3yK90O2UefBl4=; b=knFyK5t5VOZVR/tQdugWk7CTHC+4ifq2QyogleXwHxJZ0wi+GOKK2upv2IADurXOSo r4NFwQp8COu2cFpHX8mtii+tN3oTPOzx6KAGMSK5eLTInbXpJXltKPTPghqe0DK36Pwp VavC9dBzR4iMEKrXNjp29U8C4vaaG3LGZdKQGAtajH4sm5uY7FTTxVmpTT/o8Pjdyarf r3aoWbl/Yi4XyaU+EXt03ox4HKX3n2Fo7QemzR9sRKflsNvdAcNrvAYQjOsP3FrOMvnG sVBB6gkWDR326l/I7VBSzRNd8inS65suH1fEf4KFvcgJ6VK9rttISm3zFssB++rid5hR bdeA== X-Gm-Message-State: ALyK8tIq1Yt6fl1Cilb0d5g+cwf7kMpFjVoIeyeQFW1dSm6PtSKrOY3GNfULmC5z6pUYEtKwYwv3MU08bXCs1Gjv MIME-Version: 1.0 X-Received: by 10.37.209.147 with SMTP id i141mr2893019ybg.142.1464107189221; Tue, 24 May 2016 09:26:29 -0700 (PDT) Received: by 10.37.56.151 with HTTP; Tue, 24 May 2016 09:26:29 -0700 (PDT) In-Reply-To: <20160524161617.GC29516@jasmine> References: <20160523175832.GA10646@jasmine> <87shx8j5qm.fsf@T420.taylan> <20160524161617.GC29516@jasmine> Date: Tue, 24 May 2016 12:26:29 -0400 Message-ID: Subject: Re: bug#23605: /dev/urandom not seeded across reboots From: "Thompson, David" To: Leo Famulari Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 23605 Cc: =?UTF-8?B?VGF5bGFuIFVscmljaCBCYXnEsXJsxLEvS2FtbWVy?= , 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Tue, May 24, 2016 at 12:16 PM, Leo Famulari wrote: > On Tue, May 24, 2016 at 09:05:21AM +0200, Taylan Ulrich Bay=C4=B1rl=C4=B1= /Kammer wrote: >> Leo Famulari writes: >> > Does anyone have advice about the service? Am I wrong that we need to >> > seed /dev/urandom to make it work properly? >> >> Yes, this is necessary under Linux if you want urandom to be random >> enough immediately after boot, and all the distros do it as part of >> their init. >> >> There's also an interesting implication here about the very first time >> you boot the system and don't have a urandom seed file from the last >> shutdown yet. I don't know how this is typically handled, given that >> for instance it's quite possible that a user might generate SSH keys >> shortly after their first boot of a system. > > When I boot a GuixSD VM for the first time [0], it requires me to dance > on the keyboard until it has collected ~200 bits of entropy. I assumed > this is to properly bootstrap the CSPRNG in /dev/urandom, but I'm not > sure. This is just an annoying feature of GNU lsh. I want to switch my machines to OpenSSH sometime, partly due to this. - Dave From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 13:23:37 2016 Received: (at 23605) by debbugs.gnu.org; 24 May 2016 17:23:37 +0000 Received: from localhost ([127.0.0.1]:36631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5G3M-00084D-RP for submit@debbugs.gnu.org; Tue, 24 May 2016 13:23:37 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:38757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5G3L-000843-2C for 23605@debbugs.gnu.org; Tue, 24 May 2016 13:23:36 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 82CFE20CE3; Tue, 24 May 2016 13:23:34 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Tue, 24 May 2016 13:23:34 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=i4CMlANC6mlfMZJ7d/qNudm7s9M=; b=YSKP+B /rHoQQzXpF+AYJC8J3XS1S4OeePtOIbFghWkclV8AS0oV9Zme0cCnTTehJQaPEWH G3FpPIa8KImeQ5tuFXN09grgVv9TlqgB3VR++y/eoPNb8PUfUHbY6+NO0DK1Yg+g 3ZsSSS6oZUyU5RE4uG7KFM20Kw51DGf8lUct8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=i4CMlANC6mlfMZJ 7d/qNudm7s9M=; b=OEjuKxCsNv2yB3RHlOn8sC2sIPuy6Hc/2RSD+u1G269KtqO 1Wj9c72X6p0kuVIY17I2A3mGCLXJapB4kvdcmiG/rkgiVuvxbNWvtNJHgrM7zRiU FNV+FEC4xWUx73JrC2F+Z5Krc2Xrn6sLI+3DV8UOnK1n7+Z6i++yQu9XsefQ= X-Sasl-enc: puJd7PyqJSKiXQjI7Yyponxzvw+XRTV7jjxyFkr7Td4+ 1464110614 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 36A3AF29F1; Tue, 24 May 2016 13:23:34 -0400 (EDT) Date: Tue, 24 May 2016 13:23:29 -0400 From: Leo Famulari To: "Thompson, David" Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160524172329.GA5216@jasmine> References: <20160523175832.GA10646@jasmine> <87shx8j5qm.fsf@T420.taylan> <20160524161617.GC29516@jasmine> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605 Cc: Taylan Ulrich =?utf-8?B?QmF5xLFybMSxL0thbW1lcg==?= , 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tue, May 24, 2016 at 12:26:29PM -0400, Thompson, David wrote: > On Tue, May 24, 2016 at 12:16 PM, Leo Famulari wrote: > > On Tue, May 24, 2016 at 09:05:21AM +0200, Taylan Ulrich Bayırlı/Kammer wrote: > >> Leo Famulari writes: > >> > Does anyone have advice about the service? Am I wrong that we need to > >> > seed /dev/urandom to make it work properly? > >> > >> Yes, this is necessary under Linux if you want urandom to be random > >> enough immediately after boot, and all the distros do it as part of > >> their init. > >> > >> There's also an interesting implication here about the very first time > >> you boot the system and don't have a urandom seed file from the last > >> shutdown yet. I don't know how this is typically handled, given that > >> for instance it's quite possible that a user might generate SSH keys > >> shortly after their first boot of a system. > > > > When I boot a GuixSD VM for the first time [0], it requires me to dance > > on the keyboard until it has collected ~200 bits of entropy. I assumed > > this is to properly bootstrap the CSPRNG in /dev/urandom, but I'm not > > sure. > > This is just an annoying feature of GNU lsh. I want to switch my > machines to OpenSSH sometime, partly due to this. Well, it seems that this feature might be protecting us against using weak SSH session keys on first boot, if it's doing what I think it's doing... From debbugs-submit-bounces@debbugs.gnu.org Tue May 24 13:29:51 2016 Received: (at 23605) by debbugs.gnu.org; 24 May 2016 17:29:51 +0000 Received: from localhost ([127.0.0.1]:36637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5G9P-0008Cd-IV for submit@debbugs.gnu.org; Tue, 24 May 2016 13:29:51 -0400 Received: from mail-yw0-f181.google.com ([209.85.161.181]:33679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5G9O-0008CR-6l for 23605@debbugs.gnu.org; Tue, 24 May 2016 13:29:50 -0400 Received: by mail-yw0-f181.google.com with SMTP id h19so23030009ywc.0 for <23605@debbugs.gnu.org>; Tue, 24 May 2016 10:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worcester-edu.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=yhOiI3MBX+CGvj+1gKoMWpjLowdEzR1eWvQ89fLGVNM=; b=0TzQL5Y8BpYcABzD1x8/2DBFGFkb13wFImFMNtEix+h46GluhHoVExCyP9EP7m8Ua2 jTxeI6sxbEHXAMnhQczibj39MpgwVaNeHUfdOliJuv6l6BNjQr5J6hRdtYFCuMWj8EiS 3GbdhMekDr1FS9Y/2TNspI9bG9m/NqUcZKNTWWe6q2Gg3fMBW4sx0VwfKOUIAkP9ewXE 7h4mUc32mAII8SQvQBLuqWWsmaqD9jrhZyEC5HgRMzWSkha470Bs1daAvo8NCfZoXL0H IxLs9Vo+SmEqpWSws0DQpV/k2ZyUDWYVR+bFqRQtB249D1B+2YvKyop13z22asXTIwyp Jh4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-transfer-encoding; bh=yhOiI3MBX+CGvj+1gKoMWpjLowdEzR1eWvQ89fLGVNM=; b=Oaf6MPJPuTyGUYfWNMKzYUxhl2bs29KrseaRuObTge8WoZZULnUk2mgNdK/jTYB4+e 1mJDTJlBWFSHlX3EFjsNPFDLWGDXnnBkhgWp5z+rvMZwoZdpw164Glal4Oyxn+jRAoqW JhGmIaYvP3PzVjU2xC+38cMeFtXX9KM5Ah0et7IOSCgayy+PfAJYsFE7vINyHNZaRAR1 zsKHZptwwi2MiKBGB0gGWuaA619hOsDifiRRWAvIVX1adiap5UWiqkFXEz661YHZ3vmB EmkU6QzRIZnFDroZILDJc8NEDDpRVXZeytEuJKJRccvvQ3ioO1ifste1dESbqyegh2Za b1Ng== X-Gm-Message-State: ALyK8tLfq7qgzantyydty+Nz6XVVzGI5FwwT+naW76IaNnaLuDXqpFpNhcMqwIAbRwucQllN2sjB5lqUGKbjXFsy MIME-Version: 1.0 X-Received: by 10.129.158.79 with SMTP id v76mr3457915ywg.282.1464110984521; Tue, 24 May 2016 10:29:44 -0700 (PDT) Received: by 10.37.56.151 with HTTP; Tue, 24 May 2016 10:29:44 -0700 (PDT) In-Reply-To: <20160524172329.GA5216@jasmine> References: <20160523175832.GA10646@jasmine> <87shx8j5qm.fsf@T420.taylan> <20160524161617.GC29516@jasmine> <20160524172329.GA5216@jasmine> Date: Tue, 24 May 2016 13:29:44 -0400 Message-ID: Subject: Re: bug#23605: /dev/urandom not seeded across reboots From: "Thompson, David" To: Leo Famulari Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 23605 Cc: =?UTF-8?B?VGF5bGFuIFVscmljaCBCYXnEsXJsxLEvS2FtbWVy?= , 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Tue, May 24, 2016 at 1:23 PM, Leo Famulari wrote: > On Tue, May 24, 2016 at 12:26:29PM -0400, Thompson, David wrote: >> On Tue, May 24, 2016 at 12:16 PM, Leo Famulari wrote= : >> > On Tue, May 24, 2016 at 09:05:21AM +0200, Taylan Ulrich Bay=C4=B1rl=C4= =B1/Kammer wrote: >> >> Leo Famulari writes: >> >> > Does anyone have advice about the service? Am I wrong that we need = to >> >> > seed /dev/urandom to make it work properly? >> >> >> >> Yes, this is necessary under Linux if you want urandom to be random >> >> enough immediately after boot, and all the distros do it as part of >> >> their init. >> >> >> >> There's also an interesting implication here about the very first tim= e >> >> you boot the system and don't have a urandom seed file from the last >> >> shutdown yet. I don't know how this is typically handled, given that >> >> for instance it's quite possible that a user might generate SSH keys >> >> shortly after their first boot of a system. >> > >> > When I boot a GuixSD VM for the first time [0], it requires me to danc= e >> > on the keyboard until it has collected ~200 bits of entropy. I assumed >> > this is to properly bootstrap the CSPRNG in /dev/urandom, but I'm not >> > sure. >> >> This is just an annoying feature of GNU lsh. I want to switch my >> machines to OpenSSH sometime, partly due to this. > > Well, it seems that this feature might be protecting us against using > weak SSH session keys on first boot, if it's doing what I think it's > doing... It impedes automated provisioning of servers, which OpenSSH does not do. - Dave From debbugs-submit-bounces@debbugs.gnu.org Wed May 25 12:38:25 2016 Received: (at 23605) by debbugs.gnu.org; 25 May 2016 16:38:25 +0000 Received: from localhost ([127.0.0.1]:38492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5bpA-0002oc-S9 for submit@debbugs.gnu.org; Wed, 25 May 2016 12:38:25 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:33703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5bp8-0002oO-1z for 23605@debbugs.gnu.org; Wed, 25 May 2016 12:38:23 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 72518207FF; Wed, 25 May 2016 12:38:18 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 25 May 2016 12:38:18 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=UwJ4QwVsLFDIwP6qjZ5Uo+Wm+u4=; b=WV6rKy O37+pHYjySuAP4dtvNTxZpZ6+8UhSdJ4J0kZr1PAUWZbDrU8Id8Zi/MKAqqOJeMf EDISXRebY21G4OwVA6Huoi6Og25W7Ve6YhF6a4psIvw29r71C19mt+njZs7qZEVu +ZKp9WGudl5IX6bIRtQIferYI9upsPpahCnoQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=UwJ4QwVsLFDIwP6 qjZ5Uo+Wm+u4=; b=JsrGeOyj2M13aR0v68d7Pm2wePI/CP5qx2gjqNCYUg3mWN1 Kgv/vsylGDoo2NsiS/ej81fyc4PmTtZubFRxmEws4KYw1PHAyBYKxeLxC9G5kgUB ooYdJmbhG3G+PlTKoQ/7gJKxEMKn8yeCABH8k8A/qRucMMH93gZxZQ67ttvs= X-Sasl-enc: UmRD7d7cl3vl8RAQ35EL51DnQgJFWSx0Ix5CqDJZOvJi 1464194297 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 07C49F284D; Wed, 25 May 2016 12:38:17 -0400 (EDT) Date: Wed, 25 May 2016 12:38:15 -0400 From: Leo Famulari To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160525163815.GA19996@jasmine> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87d1obabj8.fsf@gnu.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Tue, May 24, 2016 at 02:24:59PM +0200, Ludovic Courtès wrote: > Leo Famulari skribis: > > + (mkdir-p "/var/run") > > + (close-port (open-file "/var/run/urandom-seed" "a0b")) > > Or simply ‘open-output-file’. [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [66.111.4.26 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [66.111.4.26 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 2.8 PERCENT_RANDOM Message has a random macro in it 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Tue, May 24, 2016 at 02:24:59PM +0200, Ludovic Courtès wrote: > Leo Famulari skribis: > > + (mkdir-p "/var/run") > > + (close-port (open-file "/var/run/urandom-seed" "a0b")) > > Or simply ‘open-output-file’. [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [66.111.4.26 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [66.111.4.26 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 2.8 PERCENT_RANDOM Message has a random macro in it 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Tue, May 24, 2016 at 02:24:59PM +0200, Ludovic Courtès wrote: > Leo Famulari skribis: > > + (mkdir-p "/var/run") > > + (close-port (open-file "/var/run/urandom-seed" "a0b")) > > Or simply ‘open-output-file’. Done in the attached diff. > Maybe do: > > (define %random-seed-file > "/var/run/random-seed") Done. > > + (start #~(lambda _ > > + (exec-command > > + (zero? > > + (system (string-append "cat " > > + "/var/run/urandom-seed" > > + " > /dev/urandom")))))) > > Instead of spawning ‘cat’, we can do: > > (when (file-exists? #$%random-seed-file) > (call-with-input-file #$%random-seed-file > (lambda (seed) > (call-with-output-file "/dev/urandom" > (lambda (random) > (dump-port seed random)))))) > #t ;service successfully “started” I think I've done this correctly, as attached, but I can't test it yet since I still get an error: "service: Wrong number of arguments in form (service urandom-seed-service-type)". > > + (stop #~(lambda _ > > + (exec-command > > + (zero? > > + (system* "dd" "if=/dev/urandom" > > + (string-append "of=" "/var/run/urandom-seed") > > + "count=1" "bs=512")))))))) > > Likewise, I would suggest using: > > (let ((buf (make-bytevector 512))) > (call-with-input-file "/dev/urandom" > (lambda (random) > (get-bytevector-n! random buf 512))) > …) I tried to fill in the …, but again, I'm struggling here :p More advice requested! :) --IS0zKkzwUGydFO0o Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="urandom-seed-service.patch" diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 96bf8da..b26fee1 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -93,6 +93,8 @@ gpm-service-type gpm-service + urandom-seed-service + %base-services)) ;;; Commentary: @@ -1200,6 +1202,55 @@ extra rules from the packages listed in @var{rules}." "Return a service that uses @var{device} as a swap device." (service swap-service-type device)) +(define %random-seed-file + "/var/run/random-seed") + +(define %urandom-seed-activation + ;; Activation gexp for the urandom seed + #~(begin + (use-modules (guix build utils)) + + (mkdir-p (dirname %random-seed-file)) + (close-port (open-output-file %random-seed-file)) + (chmod %random-seed-file #o600))) + +(define (urandom-seed-shepherd-service) + "Return a shepherd service for the /dev/urandom seed." + (list (shepherd-service + (documentation "Preserve entropy across reboots for /dev/urandom.") + (provision '(urandom-seed)) + (requirement '(user-processes)) ; whatever provides file-system /var + (start #~(lambda _ + (when (file-exists? #$%random-seed-file) + (call-with-input-file #$%random-seed-file + (lambda (seed) + (call-with-output-file "/dev/urandom" + (lambda (urandom) + (dump-port seed urandom)))))) + #t)) + (stop #~(lambda _ + (let ((buf (make-bytevector 512))) + (call-with-input-file "/dev/urandom" + (lambda (urandom) + (get-bytevector-n! urandom buf 0 512) + (call-with-output-file #$%random-seed-file + (lambda (seed) + (dump-port buf seed))) + #t)))))))) + +(define urandom-seed-service-type + (service-type (name 'urandom-seed) + (extensions + (list (service-extension shepherd-root-service-type + urandom-seed-shepherd-service) + (service-extension activation-service-type + (const %urandom-seed-activation)) + ;; Add urandom-seed to the system profile + ;; Where is profile-service-type defined? + (service-extension profile-service-type list))))) + +(define (urandom-seed-service) + (service urandom-seed-service-type)) (define-record-type* gpm-configuration make-gpm-configuration gpm-configuration? @@ -1281,6 +1332,7 @@ This is the GNU operating system, welcome!\n\n"))) (static-networking-service "lo" "127.0.0.1" #:provision '(loopback)) (syslog-service) + (urandom-seed-service) (guix-service) (nscd-service) --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=backtrace $ ./pre-inst-env guix system vm --no-substitutes ~/work/guix/doc/os-config-bare-bones.texi ;;; note: source file /home/leo/work/guix/gnu/services/base.scm ;;; newer than compiled /home/leo/work/guix/gnu/services/base.go ;;; note: source file /home/leo/work/guix/gnu/services/base.scm ;;; newer than compiled /home/leo/.cache/guile/ccache/2.0-LE-8-2.0/home/leo/work/guix/gnu/services/base.scm.go ice-9/psyntax.scm:1422:32: In procedure expand-macro: ice-9/psyntax.scm:1422:32: Syntax error: gnu/services/base.scm:1253:2: service: Wrong number of arguments in form (service urandom-seed-service-type) --IS0zKkzwUGydFO0o-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 25 12:55:14 2016 Received: (at 23605) by debbugs.gnu.org; 25 May 2016 16:55:15 +0000 Received: from localhost ([127.0.0.1]:38500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5c5S-0003Bj-Na for submit@debbugs.gnu.org; Wed, 25 May 2016 12:55:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44697) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5c5P-0003BV-AC for 23605@debbugs.gnu.org; Wed, 25 May 2016 12:55:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5c5G-0008Cm-CR for 23605@debbugs.gnu.org; Wed, 25 May 2016 12:55:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,PERCENT_RANDOM, RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5c5G-0008BW-8s; Wed, 25 May 2016 12:55:02 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:60032 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b5c5E-0001rt-JG; Wed, 25 May 2016 12:55:00 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Leo Famulari Subject: Re: bug#23605: /dev/urandom not seeded across reboots References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Prairial an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Wed, 25 May 2016 18:54:58 +0200 In-Reply-To: <20160525163815.GA19996@jasmine> (Leo Famulari's message of "Wed, 25 May 2016 12:38:15 -0400") Message-ID: <87vb229ixp.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.6 (---) Leo Famulari skribis: > On Tue, May 24, 2016 at 02:24:59PM +0200, Ludovic Court=C3=A8s wrote: [...] >> Instead of spawning =E2=80=98cat=E2=80=99, we can do: >>=20 >> (when (file-exists? #$%random-seed-file) >> (call-with-input-file #$%random-seed-file >> (lambda (seed) >> (call-with-output-file "/dev/urandom" >> (lambda (random) >> (dump-port seed random)))))) >> #t ;service successfully =E2=80=9Cstarted=E2=80=9D > > I think I've done this correctly, as attached, but I can't test it yet > since I still get an error: "service: Wrong number of arguments in form > (service urandom-seed-service-type)". Yes, it=E2=80=99s: (service TYPE VALUE) but I think there=E2=80=99s no meaningful value for this service, so you co= uld do: (service urandom-seed-service-type #f) [...] > +(define (urandom-seed-shepherd-service) > + "Return a shepherd service for the /dev/urandom seed." > + (list (shepherd-service > + (documentation "Preserve entropy across reboots for /dev/urando= m.") I think you=E2=80=99ll need to specify that additional modules are needed (= for =E2=80=98make-bytevector=E2=80=99, =E2=80=98put-bytevector=E2=80=99, etc.): (shepherd-service ;; =E2=80=A6 (modules `((rnrs bytevectors) (rnrs io ports) ,@%default-modules))) (See (gnu services shepherd) for the definition of =E2=80=98%default-module= s=E2=80=99.) > + (stop #~(lambda _ > + (let ((buf (make-bytevector 512))) > + (call-with-input-file "/dev/urandom" > + (lambda (urandom) > + (get-bytevector-n! urandom buf 0 512) > + (call-with-output-file #$%random-seed-file ^^ Misleading indent here. > + (lambda (seed) > + (dump-port buf seed))) =E2=80=98dump-port=E2=80=99 from (guix build utils) takes an input port as = its 1st argument, and an output port as its 2nd argument. Here BUF is a bytevector, not a port. So instead, this should be: (lambda (seed) (put-bytevector seed buf)) Sounds like you=E2=80=99re pretty much there! :-) Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed May 25 17:53:49 2016 Received: (at 23605) by debbugs.gnu.org; 25 May 2016 21:53:49 +0000 Received: from localhost ([127.0.0.1]:38767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5gkP-0003W0-08 for submit@debbugs.gnu.org; Wed, 25 May 2016 17:53:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5gkN-0003Vo-JN for 23605@debbugs.gnu.org; Wed, 25 May 2016 17:53:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5gkD-0001gV-E9 for 23605@debbugs.gnu.org; Wed, 25 May 2016 17:53:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5gkD-0001gH-B4; Wed, 25 May 2016 17:53:37 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:47776 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b5gkB-0005Ht-HC; Wed, 25 May 2016 17:53:35 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: "Thompson\, David" Subject: Re: bug#23605: /dev/urandom not seeded across reboots References: <20160523175832.GA10646@jasmine> <87shx8j5qm.fsf@T420.taylan> <20160524161617.GC29516@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Prairial an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Wed, 25 May 2016 23:53:33 +0200 In-Reply-To: (David Thompson's message of "Tue, 24 May 2016 12:26:29 -0400") Message-ID: <87a8jd9542.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org, Leo Famulari X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) "Thompson, David" skribis: > On Tue, May 24, 2016 at 12:16 PM, Leo Famulari wrote: [...] >> When I boot a GuixSD VM for the first time [0], it requires me to dance >> on the keyboard until it has collected ~200 bits of entropy. I assumed >> this is to properly bootstrap the CSPRNG in /dev/urandom, but I'm not >> sure. > > This is just an annoying feature of GNU lsh. I want to switch my > machines to OpenSSH sometime, partly due to this. It=E2=80=99s actually =E2=80=98lsh-make-seed=E2=80=99 that does that (info = "(lsh) lsh-make-seed"), and it=E2=80=99s invoked from our =E2=80=98lsh-service=E2= =80=99 when #:initialize? is #t (the default). It=E2=80=99s possible to set #:initialize? to #f, but then you still need to create (or provide) the random seed at some point. At the time people felt that having it default to #t would be less surprising. > It impedes automated provisioning of servers, which OpenSSH does not do. Maybe OpenSSH assumes that the kernel-provided randomness is good enough? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu May 26 12:47:11 2016 Received: (at 23605) by debbugs.gnu.org; 26 May 2016 16:47:11 +0000 Received: from localhost ([127.0.0.1]:40766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5yRD-0007KZ-Ac for submit@debbugs.gnu.org; Thu, 26 May 2016 12:47:11 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:44695) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b5yRB-0007KS-J5 for 23605@debbugs.gnu.org; Thu, 26 May 2016 12:47:10 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 17C9B228DC; Thu, 26 May 2016 12:47:09 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Thu, 26 May 2016 12:47:09 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=mg+/0RVI8wAcOhaNtyZkv/55Tew=; b=wkGitY 6Btk762gAihm3JA+H7CO8YeHW0Jo9FLq8lEw9UK2bbcBQIRZxS2yZdNDTQgRgfCF zHVkL/RMH7XevjrLQIUb2OUk0ZQw+29SzvcArmE6vNIlaJj1jTplsnEZAFj+cg7t eQwIUzqfDjslotFl4WmP2dtrFSnCgOhn+x/k0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=mg+/0RVI8wAcOha NtyZkv/55Tew=; b=oKV/rkJ6VD3K4RUfWHRz0IioOsQjA7rRHJF/sh41FmrfQwu B1MGhWFf9YucZ+2GQGmkfXyCnB3UqiCeiClId0Odxzg+HnU+wRdubTgS1l+HQO1e 7DSHrO5t1+DqJIx3faVWUt/+MuhXmGcB46W3atQ3JSszxybj1rRUS2Pq7/fc= X-Sasl-enc: z13vFa6VbIdqLTAr/zMZtnCd/v6ZLSF0evT9iWyEQ7Lf 1464281228 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 8C37FF2024; Thu, 26 May 2016 12:47:08 -0400 (EDT) Date: Thu, 26 May 2016 12:47:07 -0400 From: Leo Famulari To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160526164707.GA11671@jasmine> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87vb229ixp.fsf@gnu.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Wed, May 25, 2016 at 06:54:58PM +0200, Ludovic Courtès wrote: > > Yes, it’s: > > (service TYPE VALUE) > > but I think there’s no meaningful value for this service, so you could > do: > > (service urandom-seed-service-type #f) [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [66.111.4.27 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 2.8 PERCENT_RANDOM Message has a random macro in it 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Wed, May 25, 2016 at 06:54:58PM +0200, Ludovic Courtès wrote: > > Yes, it’s: > > (service TYPE VALUE) > > but I think there’s no meaningful value for this service, so you could > do: > > (service urandom-seed-service-type #f) [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [66.111.4.27 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 2.8 PERCENT_RANDOM Message has a random macro in it 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, May 25, 2016 at 06:54:58PM +0200, Ludovic Courtès wrote: > > Yes, it’s: > > (service TYPE VALUE) > > but I think there’s no meaningful value for this service, so you could > do: > > (service urandom-seed-service-type #f) I'm struggling to make this work. Do I need to alter the definition of urandom-seed-shepherd-service to accept the boolean? With the attached diff, building a VM fails like this (full backtrace attached): [...] 573: 2 [loop #< type: # parameters: ()>] In srfi/srfi-1.scm: 578: 1 [map # (# # # # ...)] In gnu/services/base.scm: 1217: 0 [urandom-seed-shepherd-service #f] gnu/services/base.scm:1217:0: In procedure urandom-seed-shepherd-service: gnu/services/base.scm:1217:0: Wrong number of arguments to # > Sounds like you’re pretty much there! :-) Almost, I hope! Thanks for your help :) --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=backtrace Backtrace: In ice-9/boot-9.scm: 1724: 19 [%start-stack load-stack ...] 1729: 18 [#] In unknown file: ?: 17 [primitive-load "/home/leo/work/guix/scripts/guix"] In guix/ui.scm: 1201: 16 [run-guix-command system "vm" "/home/leo/tmp/bare-bones.scm"] In ice-9/boot-9.scm: 157: 15 [catch srfi-34 # ...] 157: 14 [catch system-error ...] In guix/scripts/system.scm: 882: 13 [#] 788: 12 [process-action vm ("/home/leo/tmp/bare-bones.scm") ...] In guix/store.scm: 1163: 11 [run-with-store # ...] In guix/scripts/system.scm: 800: 10 [# #] 564: 9 [perform-action vm # # ...] In gnu/system/vm.scm: 496: 8 [system-qemu-image/shared-store-script # # # ...] In gnu/system.scm: 601: 7 [operating-system-derivation # # #f] In gnu/services.scm: 573: 6 [loop #] In srfi/srfi-1.scm: 578: 5 [map # (# # #)] In gnu/services.scm: 573: 4 [loop #< type: # parameters: #>] In srfi/srfi-1.scm: 578: 3 [map # (# # #)] In gnu/services.scm: 573: 2 [loop #< type: # parameters: ()>] In srfi/srfi-1.scm: 578: 1 [map # (# # # # ...)] In gnu/services/base.scm: 1217: 0 [urandom-seed-shepherd-service #f] gnu/services/base.scm:1217:0: In procedure urandom-seed-shepherd-service: gnu/services/base.scm:1217:0: Wrong number of arguments to # --ikeVEW9yuYc//A+q Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="urandom-seed-service.patch" diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 96bf8da..041768f 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -93,6 +93,8 @@ gpm-service-type gpm-service + urandom-seed-service + %base-services)) ;;; Commentary: @@ -1200,6 +1202,57 @@ extra rules from the packages listed in @var{rules}." "Return a service that uses @var{device} as a swap device." (service swap-service-type device)) +(define %random-seed-file + "/var/run/random-seed") + +(define %urandom-seed-activation + ;; Activation gexp for the urandom seed + #~(begin + (use-modules (guix build utils)) + + (mkdir-p (dirname %random-seed-file)) + (close-port (open-output-file %random-seed-file)) + (chmod %random-seed-file #o600))) + +(define (urandom-seed-shepherd-service) + "Return a shepherd service for the /dev/urandom seed." + (shepherd-service + (documentation "Preserve entropy across reboots for /dev/urandom.") + (provision '(urandom-seed)) + (requirement '(user-processes)) ; whatever provides file-systems /var and /dev + (start #~(lambda _ + (when (file-exists? #$%random-seed-file) + (call-with-input-file #$%random-seed-file + (lambda (seed) + (call-with-output-file "/dev/urandom" + (lambda (urandom) + (dump-port seed urandom)))))) + #t)) + (stop #~(lambda _ + (let ((buf (make-bytevector 512))) + (call-with-input-file "/dev/urandom" + (lambda (urandom) + (get-bytevector-n! urandom buf 0 512) + (call-with-output-file #$%random-seed-file + (lambda (seed) + (put-bytevector seed buf))) + #t))))) + (modules `((rnrs bytevectors) + (rnrs io ports) + ,@%default-modules)))) + +(define urandom-seed-service-type + (service-type (name 'urandom-seed) + (extensions + (list (service-extension shepherd-root-service-type + urandom-seed-shepherd-service) + (service-extension activation-service-type + (const %urandom-seed-activation)) + ;; Add urandom-seed to the system profile + (service-extension profile-service-type list))))) + +(define (urandom-seed-service) + (service urandom-seed-service-type #f)) (define-record-type* gpm-configuration make-gpm-configuration gpm-configuration? @@ -1281,6 +1334,7 @@ This is the GNU operating system, welcome!\n\n"))) (static-networking-service "lo" "127.0.0.1" #:provision '(loopback)) (syslog-service) + (urandom-seed-service) (guix-service) (nscd-service) --ikeVEW9yuYc//A+q-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 21:05:30 2016 Received: (at submit) by debbugs.gnu.org; 28 May 2016 01:05:30 +0000 Received: from localhost ([127.0.0.1]:43083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6Sgz-0006Pk-QX for submit@debbugs.gnu.org; Fri, 27 May 2016 21:05:30 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6Sgx-0006PY-QA for submit@debbugs.gnu.org; Fri, 27 May 2016 21:05:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Sgr-0006w5-AW for submit@debbugs.gnu.org; Fri, 27 May 2016 21:05:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: ** X-Spam-Status: No, score=2.6 required=5.0 tests=BAYES_50,PERCENT_RANDOM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Sgr-0006w0-42 for submit@debbugs.gnu.org; Fri, 27 May 2016 21:05:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Sgo-0004BG-8X for bug-guix@gnu.org; Fri, 27 May 2016 21:05:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6Sgk-0006uD-0I for bug-guix@gnu.org; Fri, 27 May 2016 21:05:17 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:33963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6Sgi-0006oR-Lv for bug-guix@gnu.org; Fri, 27 May 2016 21:05:13 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id A4F0A207EE; Fri, 27 May 2016 21:05:03 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Fri, 27 May 2016 21:05:03 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=yB71wiB4XoH1xvPnhkecSCuGRe4=; b=wEWxdZ PfWTG4eMTPNfixPWy7RYvOnwJpR76L5t6Ky4SZzCumZYfZYlGh0Ue9ncwB2cLfNT g5sfWCY2BbrFq4ABDv9qFsYY22N1V2zTH+lylA9tx2YsMkd03Ji2vKFV7nyycCN6 +ziaDbmD6A4uxsHYlXYg6bbvjzNusWYkMdwfw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=yB71wiB4XoH1xvP nhkecSCuGRe4=; b=EeBB5CWnbi8BvmVxxtGSSV4QYxgupgGt3O1m+y1hVATzUdc QIzlCcQedeMtFrTfKVRpZdnSYtxlXqCZb6V9eTEV9tWWgfvMqjjSPPn8Va6Azc4D u+HrlZrwKZjeTtOPXv+t8mtXwDuqH2+r/3mgEn4uys5FkDHHWEUDI2TbGri4= X-Sasl-enc: xhBXw3xzsZQ/SkipLd/XodsyVVRqqABa0IS3eL8Grzh2 1464397503 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 53B1FF29EE for ; Fri, 27 May 2016 21:05:03 -0400 (EDT) Date: Fri, 27 May 2016 21:05:01 -0400 From: Leo Famulari To: bug-guix@gnu.org Subject: Re: /dev/urandom not seeded across reboots Message-ID: <20160528010501.GA1478@jasmine> References: <20160523175832.GA10646@jasmine> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160523175832.GA10646@jasmine> User-Agent: Mutt/1.6.0 (2016-04-01) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Okay, I finally have some code that works! (attached) I tested it by using `inotifywait -m /dev/urandom` [0] to see that /dev/urandom was indeed being open and closed for writing when running `herd {start, stop} urandom-seed`. If you can suggest a way to see exactly what is being written to /dev/urandom, I would like to verify it more fully. If you test it, don't be surprised that the random-seed is empty the first time you start the service. It is `touch`-ed at boot but filled during shutdown. The big caveat is that the only way I could make it work was to use the old service API. I just couldn't figure out how to use the extensible service API for a service that takes to arguments. If this is a problem, then your help is wanted! I also had to change the location of %random-seed-file from /var/run/random-seed to /var/lib/random-seed, because /var/run is cleared upon reboot. This is specified in the FHS standard [1]. Debian puts it at /var/lib/urandom/random-seed. [0] From the inotify-tools package [1] http://www.pathname.com/fhs/pub/fhs-2.3.html#VARRUNRUNTIMEVARIABLEDATA --HcAYCG3uE/tztfnV Content-Type: text/x-diff; charset=iso-8859-1 Content-Disposition: attachment; filename="0001-services-Add-urandom-seed-service.patch" Content-Transfer-Encoding: 8bit >From 8d41d37e2d0f8a0edf7ab9d659d1a2c9315965c1 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 8 May 2016 03:08:46 -0400 Subject: [PATCH] services: Add urandom-seed-service. * gnu/services/base.scm (urandom-seed-service): New procedure. (%random-seed-file, urandom-seed-service-type): New variables. (%urandom-seed-shepherd-service): New procedure. * doc/guix.texi (Base Services): Document it. --- doc/guix.texi | 10 ++++++++++ gnu/services/base.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index bb75425..34a51a8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7355,6 +7355,16 @@ Return a service that runs the Guix build daemon according to Run @var{udev}, which populates the @file{/dev} directory dynamically. @end deffn +@deffn {Scheme Procedure} urandom-seed-service @var{#f} +Save some entropy in @var{%random-seed-file} to seed @file{/dev/urandom} +when rebooting. +@end deffn + +@deftp {Data Type} %random-seed-file +This is where some random bytes are saved by @var{urandom-seed-service} +to seed @file{/dev/urandom} when rebooting. +@end deftp + @deffn {Scheme Procedure} console-keymap-service @var{files} ... @cindex keyboard layout Return a service to load console keymaps from @var{files} using diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 96bf8da..329a989 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -3,6 +3,7 @@ ;;; Copyright 2015, 2016 Alex Kost ;;; Copyright 2015 Mark H Weaver ;;; Copyright 2015 Sou Bunnbu +;;; Copyright 2016 Leo Famulari ;;; ;;; This file is part of GNU Guix. ;;; @@ -93,6 +94,8 @@ gpm-service-type gpm-service + urandom-seed-service + %base-services)) ;;; Commentary: @@ -422,6 +425,53 @@ stopped before 'kill' is called." ;;; +;;; Preserve entropy to seed /dev/urandom on boot. +;;; + +(define %random-seed-file + "/var/lib/random-seed") + +(define %urandom-seed-shepherd-service + (shepherd-service + (documentation "Preserve entropy across reboots for /dev/urandom.") + (provision '(urandom-seed)) + (requirement '(user-processes)) + (start #~(lambda _ + ;; "Activation" + (mkdir-p (dirname #$%random-seed-file)) + (close-port (open-file #$%random-seed-file "a0b")) + (chmod #$%random-seed-file #o600) + ;; On boot, write random seed into /dev/urandom + (when (file-exists? #$%random-seed-file) + (call-with-input-file #$%random-seed-file + (lambda (seed) + (call-with-output-file "/dev/urandom" + (lambda (urandom) + (dump-port seed urandom)))))) + #t)) + (stop #~(lambda _ + ;; During shutdown, write from /dev/urandom into random seed + (let ((buf (make-bytevector 512))) + (call-with-input-file "/dev/urandom" + (lambda (urandom) + (get-bytevector-n! urandom buf 0 512) + (call-with-output-file #$%random-seed-file + (lambda (seed) + (put-bytevector seed buf))) + #t))))) + (modules `((rnrs bytevectors) + (rnrs io ports) + ,@%default-modules)))) + +(define urandom-seed-service-type + (shepherd-service-type 'urandom-seed + (const %urandom-seed-shepherd-service))) + +(define (urandom-seed-service) + (service urandom-seed-service-type #f)) + + +;;; ;;; System-wide environment variables. ;;; @@ -1200,7 +1250,6 @@ extra rules from the packages listed in @var{rules}." "Return a service that uses @var{device} as a swap device." (service swap-service-type device)) - (define-record-type* gpm-configuration make-gpm-configuration gpm-configuration? (gpm gpm-configuration-gpm) ;package @@ -1283,6 +1332,7 @@ This is the GNU operating system, welcome!\n\n"))) (syslog-service) (guix-service) (nscd-service) + (urandom-seed-service) ;; The LVM2 rules are needed as soon as LVM2 or the device-mapper is ;; used, so enable them by default. The FUSE and ALSA rules are -- 2.8.3 --HcAYCG3uE/tztfnV-- From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 21:11:28 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 01:11:28 +0000 Received: from localhost ([127.0.0.1]:43092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6Smm-0006Yu-9d for submit@debbugs.gnu.org; Fri, 27 May 2016 21:11:28 -0400 Received: from mailhub2.soe.uq.edu.au ([130.102.132.209]:57946 helo=newmailhub.uq.edu.au) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6Smk-0006Yl-9D for 23605@debbugs.gnu.org; Fri, 27 May 2016 21:11:27 -0400 Received: from smtp1.soe.uq.edu.au (smtp1.soe.uq.edu.au [10.138.113.40]) by newmailhub.uq.edu.au (8.14.5/8.14.5) with ESMTP id u4S1BMIv042692; Sat, 28 May 2016 11:11:23 +1000 Received: from [192.168.1.105] (static.customers.nuskope.com.au [103.25.181.216] (may be forged)) (authenticated bits=0) by smtp1.soe.uq.edu.au (8.14.5/8.14.5) with ESMTP id u4S1BKbM062752 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 28 May 2016 11:11:21 +1000 Subject: Re: bug#23605: /dev/urandom not seeded across reboots To: Leo Famulari , 23605@debbugs.gnu.org References: <20160523175832.GA10646@jasmine> <20160528010501.GA1478@jasmine> From: Ben Woodcroft Message-ID: <5748F037.4030406@uq.edu.au> Date: Sat, 28 May 2016 11:11:20 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160528010501.GA1478@jasmine> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-UQ-FilterTime: 1464397883 X-Scanned-By: MIMEDefang 2.73 on UQ Mailhub X-Spam-Score: -3.7 (---) X-Debbugs-Envelope-To: 23605 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.7 (---) Hi Leo, On 28/05/16 11:05, Leo Famulari wrote: > Okay, I finally have some code that works! (attached) Is your patch incomplete? ben From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 21:12:04 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 01:12:04 +0000 Received: from localhost ([127.0.0.1]:43096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6SnM-0006a9-Hs for submit@debbugs.gnu.org; Fri, 27 May 2016 21:12:04 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:43339) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6SnK-0006a1-UX for 23605@debbugs.gnu.org; Fri, 27 May 2016 21:12:03 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7F6A320788; Fri, 27 May 2016 21:12:02 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute6.internal (MEProxy); Fri, 27 May 2016 21:12:02 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=avjX8uniySaOfmQmNk1sWx9Ckg4=; b=HwBMLy HbwDeIKc+74YZzl7KWcel9DHRD2ezVUHB7amoSj9rVJfy0XL8bDYiZ62saTit0Cd o6DYcdAUbeRCeVdAWQhsinC5PSgW4pdsipeyAiBa/F7LomDQkefZjKpbwuickhBG Ux6rDtoGjbwtnjgm3MFnmGGQbwj9Ljj2oSN40= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=avjX8uniySaOfmQ mNk1sWx9Ckg4=; b=EpoPZ1us7ZOCnWskxbKrLh7nw8YTudV3EaYn1MjMey0zjUH mtXdMiuHTVAXx/k+Iwtp1PUU3+kSBbcD5WiBEi+zBXrVB6iUDB9dnhO4BfWcparx OP5qsHpLIhLpvKEuxvAyPRBwOOuxTuntJ/HGApy5043jkVCBk5eFzrAnSrzg= X-Sasl-enc: //JtnQRTfk2OQAtUMWvr2rK94z043Gk6S2RSKgW9Gr2T 1464397922 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 31146F2810; Fri, 27 May 2016 21:12:02 -0400 (EDT) Date: Fri, 27 May 2016 21:12:01 -0400 From: Leo Famulari To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#23605: /dev/urandom not seeded across reboots 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87d1obabj8.fsf@gnu.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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. From debbugs-submit-bounces@debbugs.gnu.org Fri May 27 21:45:26 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 01:45:26 +0000 Received: from localhost ([127.0.0.1]:43110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6TJd-0007LJ-Si for submit@debbugs.gnu.org; Fri, 27 May 2016 21:45:26 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:52899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6TJc-0007LC-9f for 23605@debbugs.gnu.org; Fri, 27 May 2016 21:45:24 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D1D03205F8; Fri, 27 May 2016 21:45:23 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Fri, 27 May 2016 21:45:23 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=UNhsH NQMLxKTECso8VMbBICWqYI=; b=zgOvlknepqm14uEYLF630cYVcs923pY257gB6 hmfRGG6hNo2H4UurJ0ICqZj7kmxwDmJEOvKjKoyW69rAn4Ml05JQjKbl1anCCbG1 y+95Nf3oiE30+WMxkMrdY4niX3uI+431mlGfHG74EK7OQnPAAkeyN9pSKsYqnD+l S+sgVM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=UNhsHNQMLxKTECso8VMbBICWqYI=; b=GiDb9 XB9H/VP0uroM5eU9gwpluusg7TCBunB9E+3MxNiugei5oBBWDL5E5gtR925xTB5s VS9Ey4wXvoyA5cEY+8z5Dnj6yXnRHVoeqgkPmcKJw3p57+TqyeKKtfAzBwDCqblU NjnfOEduylv4Kixuh9RiB8Vw+w72rmn64Bwai0= X-Sasl-enc: UvwdhtQ5Rhd0LdP+FqLqk70Mc4QS/hs5KS4xGYai+MRG 1464399923 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 7724DF2848; Fri, 27 May 2016 21:45:23 -0400 (EDT) Date: Fri, 27 May 2016 21:45:22 -0400 From: Leo Famulari To: Ben Woodcroft Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160528014522.GA2454@jasmine> References: <20160523175832.GA10646@jasmine> <20160528010501.GA1478@jasmine> <5748F037.4030406@uq.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5748F037.4030406@uq.edu.au> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sat, May 28, 2016 at 11:11:20AM +1000, Ben Woodcroft wrote: > Hi Leo, > > On 28/05/16 11:05, Leo Famulari wrote: > > Okay, I finally have some code that works! (attached) > Is your patch incomplete? What do you mean? Does it not apply to your source tree? Otherwise, I expect that it's incomplete in the sense that it will require some more revision before being merged into the master branch on Savannah. Your comments are welcome :) From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 05:40:39 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 09:40:39 +0000 Received: from localhost ([127.0.0.1]:43186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6ajX-0001rq-Mr for submit@debbugs.gnu.org; Sat, 28 May 2016 05:40:39 -0400 Received: from mailhub2.soe.uq.edu.au ([130.102.132.209]:38623 helo=newmailhub.uq.edu.au) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6ajW-0001rf-4w for 23605@debbugs.gnu.org; Sat, 28 May 2016 05:40:39 -0400 Received: from smtp1.soe.uq.edu.au (smtp1.soe.uq.edu.au [10.138.113.40]) by newmailhub.uq.edu.au (8.14.5/8.14.5) with ESMTP id u4S9eVcn005960; Sat, 28 May 2016 19:40:33 +1000 Received: from [192.168.1.105] (static.customers.nuskope.com.au [103.25.181.216] (may be forged)) (authenticated bits=0) by smtp1.soe.uq.edu.au (8.14.5/8.14.5) with ESMTP id u4S9eUJU035443 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 28 May 2016 19:40:31 +1000 Subject: Re: bug#23605: /dev/urandom not seeded across reboots To: Leo Famulari References: <20160523175832.GA10646@jasmine> <20160528010501.GA1478@jasmine> <5748F037.4030406@uq.edu.au> <20160528014522.GA2454@jasmine> From: Ben Woodcroft Message-ID: <5749678D.9010707@uq.edu.au> Date: Sat, 28 May 2016 19:40:29 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160528014522.GA2454@jasmine> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-UQ-FilterTime: 1464428434 X-Scanned-By: MIMEDefang 2.73 on UQ Mailhub X-Spam-Score: -3.7 (---) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.7 (---) On 28/05/16 11:45, Leo Famulari wrote: > On Sat, May 28, 2016 at 11:11:20AM +1000, Ben Woodcroft wrote: >> Hi Leo, >> >> On 28/05/16 11:05, Leo Famulari wrote: >>> Okay, I finally have some code that works! (attached) >> Is your patch incomplete? > What do you mean? Does it not apply to your source tree? Oh, nevermind, sorry for the noise. Thunderbird was tripping up on the strange character and not showing me the full diff. ben From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 09:52:14 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 13:52:14 +0000 Received: from localhost ([127.0.0.1]:43286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6ef0-0001LX-2g for submit@debbugs.gnu.org; Sat, 28 May 2016 09:52:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6eey-0001LK-Ij for 23605@debbugs.gnu.org; Sat, 28 May 2016 09:52:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6eep-0006q2-A0 for 23605@debbugs.gnu.org; Sat, 28 May 2016 09:52:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6eep-0006py-6W; Sat, 28 May 2016 09:52:03 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:53678 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b6een-0001Fq-BS; Sat, 28 May 2016 09:52:01 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Leo Famulari Subject: Re: bug#23605: /dev/urandom not seeded across reboots References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160528011201.GA1753@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 Prairial an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Sat, 28 May 2016 15:51:58 +0200 In-Reply-To: <20160528011201.GA1753@jasmine> (Leo Famulari's message of "Fri, 27 May 2016 21:12:01 -0400") Message-ID: <87inxymgsh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) Leo Famulari skribis: > On Tue, May 24, 2016 at 02:24:59PM +0200, Ludovic Court=C3=A8s wrote: >> Leo Famulari skribis: >>=20 >> > 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 sa= fe >> > to use. From random(4): >>=20 >> Good catch! >>=20 >> Some comments: >>=20 >> > +(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")) >>=20 >> Or simply =E2=80=98open-output-file=E2=80=99. > > 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. You=E2=80=99re right, sorry for the confusion. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 09:57:22 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 13:57:23 +0000 Received: from localhost ([127.0.0.1]:44918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6ejy-0001sM-Ne for submit@debbugs.gnu.org; Sat, 28 May 2016 09:57:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6ejw-0001s8-6q for 23605@debbugs.gnu.org; Sat, 28 May 2016 09:57:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6ejn-0007aX-S8 for 23605@debbugs.gnu.org; Sat, 28 May 2016 09:57:15 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6ejn-0007aS-Ok; Sat, 28 May 2016 09:57:11 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:53680 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b6ejl-0001qV-6H; Sat, 28 May 2016 09:57:09 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Leo Famulari Subject: Re: bug#23605: /dev/urandom not seeded across reboots References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> <20160526164707.GA11671@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 Prairial an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Sat, 28 May 2016 15:57:06 +0200 In-Reply-To: <20160526164707.GA11671@jasmine> (Leo Famulari's message of "Thu, 26 May 2016 12:47:07 -0400") Message-ID: <878tyumgjx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) Leo Famulari skribis: > On Wed, May 25, 2016 at 06:54:58PM +0200, Ludovic Court=C3=A8s wrote: >>=20 >> Yes, it=E2=80=99s: >>=20 >> (service TYPE VALUE) >>=20 >> but I think there=E2=80=99s no meaningful value for this service, so you= could >> do: >>=20 >> (service urandom-seed-service-type #f) [...] > gnu/services/base.scm:1217:0: In procedure urandom-seed-shepherd-service: > gnu/services/base.scm:1217:0: Wrong number of arguments to # [...] > +(define (urandom-seed-shepherd-service) [...] > +(define urandom-seed-service-type > + (service-type (name 'urandom-seed) > + (extensions > + (list (service-extension shepherd-root-service-type > + urandom-seed-shepherd-service) Service extension procedures are called with one argument, which is the service=E2=80=99s value (info "(guix) Service Reference"). Usually, the service=E2=80=99s value is a configuration object, but in this case, the service=E2=80=99s value doesn=E2=80=99t matter, so you could simp= ly write: (define (urandom-seed-shepherd-service _) =E2=80=A6) > + ;; Add urandom-seed to the system profile > + (service-extension profile-service-type list))))) The =E2=80=98profile-service-type=E2=80=99 represents the system profile, i= .e., /run/current-system/profile. Extending it means adding a package to it. But here, IIUC, there=E2=80=99s no package to be added to the profile, so y= ou should just remove it. Last round and we=E2=80=99re done! :-) Thanks for persevering, and sorry it=E2=80=99s not easier. Maybe you=E2=80= =99ll have ideas on how to improve the manual and/or the API? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 14:05:38 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 18:05:38 +0000 Received: from localhost ([127.0.0.1]:45020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6icE-0000sz-4n for submit@debbugs.gnu.org; Sat, 28 May 2016 14:05:38 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:59656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6icC-0000sr-IX for 23605@debbugs.gnu.org; Sat, 28 May 2016 14:05:36 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 2F6C52052A; Sat, 28 May 2016 14:05:36 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 28 May 2016 14:05:36 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=qQXaWvPFhAiKH3gd2DGYjNgxg78=; b=0gm2og Xiq1Bwaqt5DqzK+1kTBQUs3tIEy8KnQh5sR4q0YGm8hbBCPDJQPvr3IxKrVLZob2 h77fkUWUJdrhQzCxVY2/Fi82JG0ideLJvbRr/1LJlQJpy/OMJQBK4higN71HlqpV iWzjo7dJ0O74Qx71GDwX+nFku7c3b+wD+joYU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=qQXaWvPFhAiKH3g d2DGYjNgxg78=; b=Z1/plbJNmyY79aAe7HwFIxZglgQNd6NlCXFoKPlpN0svwEc MGbQA+QZqQnygYR/vcdySlqJpiHH+0En3PlIq+PU97+6EEOLdOjTHpcWUyMTUGhv VDyaIuZIKwgo/88ST7/M+9hsYsEbG6D1gYaN5LDgBOmwoyaX7sp2c2i185kg= X-Sasl-enc: frb6pOWn+nFx11fhInFhJ3UCzPmUWBGAD6RsQu9Iup10 1464458735 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id CBDE3CCD26; Sat, 28 May 2016 14:05:35 -0400 (EDT) Date: Sat, 28 May 2016 14:05:35 -0400 From: Leo Famulari To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160528180535.GA27711@jasmine> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> <20160526164707.GA11671@jasmine> <878tyumgjx.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <878tyumgjx.fsf@gnu.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sat, May 28, 2016 at 03:57:06PM +0200, Ludovic Courtès wrote: > Leo Famulari skribis: > > On Wed, May 25, 2016 at 06:54:58PM +0200, Ludovic Courtès wrote: > Usually, the service’s value is a configuration object, but in this > case, the service’s value doesn’t matter, so you could simply write: > > (define (urandom-seed-shepherd-service _) > …) > > > + ;; Add urandom-seed to the system profile > > + (service-extension profile-service-type list))))) > > The ‘profile-service-type’ represents the system profile, i.e., > /run/current-system/profile. Extending it means adding a package to > it. > > But here, IIUC, there’s no package to be added to the profile, so you > should just remove it. > > Last round and we’re done! :-) [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [66.111.4.27 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [66.111.4.27 listed in wl.mailspike.net] 2.8 PERCENT_RANDOM Message has a random macro in it 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sat, May 28, 2016 at 03:57:06PM +0200, Ludovic Courtès wrote: > Leo Famulari skribis: > > On Wed, May 25, 2016 at 06:54:58PM +0200, Ludovic Courtès wrote: > Usually, the service’s value is a configuration object, but in this > case, the service’s value doesn’t matter, so you could simply write: > > (define (urandom-seed-shepherd-service _) > …) > > > + ;; Add urandom-seed to the system profile > > + (service-extension profile-service-type list))))) > > The ‘profile-service-type’ represents the system profile, i.e., > /run/current-system/profile. Extending it means adding a package to > it. > > But here, IIUC, there’s no package to be added to the profile, so you > should just remove it. > > Last round and we’re done! :-) [...] Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [66.111.4.27 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [66.111.4.27 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 2.8 PERCENT_RANDOM Message has a random macro in it 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Sat, May 28, 2016 at 03:57:06PM +0200, Ludovic Courtès wrote: > Leo Famulari skribis: > > On Wed, May 25, 2016 at 06:54:58PM +0200, Ludovic Courtès wrote: > Usually, the service’s value is a configuration object, but in this > case, the service’s value doesn’t matter, so you could simply write: > > (define (urandom-seed-shepherd-service _) > …) > > > + ;; Add urandom-seed to the system profile > > + (service-extension profile-service-type list))))) > > The ‘profile-service-type’ represents the system profile, i.e., > /run/current-system/profile. Extending it means adding a package to > it. > > But here, IIUC, there’s no package to be added to the profile, so you > should just remove it. > > Last round and we’re done! :-) Please find my latest patch attached. It seems to work for me! --MGYHOYXEY6WxJCY8 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-services-Add-urandom-seed-service.patch" >From 18979451b1af7eebaa354c1753ad4c90af288589 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sat, 28 May 2016 13:41:21 -0400 Subject: [PATCH] services: Add urandom-seed-service. * gnu/services/base.scm (urandom-seed-service): New procedure. (%random-seed-file, urandom-seed-service-type): New variables. (%urandom-seed-shepherd-service): New procedure. * doc/guix.texi (Base Services): Document it. --- doc/guix.texi | 10 +++++++++ gnu/services/base.scm | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index bb75425..34a51a8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7355,6 +7355,16 @@ Return a service that runs the Guix build daemon according to Run @var{udev}, which populates the @file{/dev} directory dynamically. @end deffn +@deffn {Scheme Procedure} urandom-seed-service @var{#f} +Save some entropy in @var{%random-seed-file} to seed @file{/dev/urandom} +when rebooting. +@end deffn + +@deftp {Data Type} %random-seed-file +This is where some random bytes are saved by @var{urandom-seed-service} +to seed @file{/dev/urandom} when rebooting. +@end deftp + @deffn {Scheme Procedure} console-keymap-service @var{files} ... @cindex keyboard layout Return a service to load console keymaps from @var{files} using diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 96bf8da..032f713 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -93,6 +93,8 @@ gpm-service-type gpm-service + urandom-seed-service + %base-services)) ;;; Commentary: @@ -422,6 +424,63 @@ stopped before 'kill' is called." ;;; +;;; Preserve entropy to seed /dev/urandom on boot. +;;; + +(define %random-seed-file + "/var/lib/random-seed") + +(define %urandom-seed-activation + ;; Activation gexp for the urandom seed + #~(begin + (use-modules (guix build utils)) + + (mkdir-p (dirname #$%random-seed-file)) + (close-port (open-file #$%random-seed-file "a0b")) + (chmod #$%random-seed-file #o600))) + +(define (urandom-seed-shepherd-service _) + "Return a shepherd service for the /dev/urandom seed." + (list (shepherd-service + (documentation "Preserve entropy across reboots for /dev/urandom.") + (provision '(urandom-seed)) + (requirement '(user-processes)) + (start #~(lambda _ + ;; On boot, write random seed into /dev/urandom. + (when (file-exists? #$%random-seed-file) + (call-with-input-file #$%random-seed-file + (lambda (seed) + (call-with-output-file "/dev/urandom" + (lambda (urandom) + (dump-port seed urandom)))))) + #t)) + (stop #~(lambda _ + ;; During shutdown, write from /dev/urandom into random seed. + (let ((buf (make-bytevector 512))) + (call-with-input-file "/dev/urandom" + (lambda (urandom) + (get-bytevector-n! urandom buf 0 512) + (call-with-output-file #$%random-seed-file + (lambda (seed) + (put-bytevector seed buf))) + #t))))) + (modules `((rnrs bytevectors) + (rnrs io ports) + ,@%default-modules))))) + +(define urandom-seed-service-type + (service-type (name 'urandom-seed) + (extensions + (list (service-extension shepherd-root-service-type + urandom-seed-shepherd-service) + (service-extension activation-service-type + (const %urandom-seed-activation)))))) + +(define (urandom-seed-service) + (service urandom-seed-service-type #f)) + + +;;; ;;; System-wide environment variables. ;;; @@ -1200,7 +1259,6 @@ extra rules from the packages listed in @var{rules}." "Return a service that uses @var{device} as a swap device." (service swap-service-type device)) - (define-record-type* gpm-configuration make-gpm-configuration gpm-configuration? (gpm gpm-configuration-gpm) ;package @@ -1281,6 +1339,7 @@ This is the GNU operating system, welcome!\n\n"))) (static-networking-service "lo" "127.0.0.1" #:provision '(loopback)) (syslog-service) + (urandom-seed-service) (guix-service) (nscd-service) -- 2.8.3 --MGYHOYXEY6WxJCY8-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 14:10:12 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 18:10:12 +0000 Received: from localhost ([127.0.0.1]:45027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6igd-00012s-QB for submit@debbugs.gnu.org; Sat, 28 May 2016 14:10:11 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:49503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6igc-00012m-8c for 23605@debbugs.gnu.org; Sat, 28 May 2016 14:10:10 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1372D204AE; Sat, 28 May 2016 14:10:10 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sat, 28 May 2016 14:10:10 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=ulID+ FE+bSgkKFTd0LYp1yOkpk4=; b=PSHuvz0JqfWghfDyT1k/pUeloJqKGcIHprMrt BW0V7IoOT9/XkzuO3+fvxyTbE+pt2BmfT2fkEdkosPZw/fyop+x5HUYf9Io0z2B4 mht5AYikGqAw8AViJdLTjIyB+3XuFXWn+pbuD9Qz057U4yhY6iLypHAOWXgz2VlK nY13wM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=ulID+FE+bSgkKFTd0LYp1yOkpk4=; b=h7sxT sZnZncf1X+wjGSmW7BgJolGOeOX617cB9JtsXeHzRAyAuqqSUWqqdr9DUdiymFJJ Vz23ihmVhau3bA+dlurtjldQVlPtan6d3Wn4oUy9PjkTSFBk1DeyhSsL0wcillnb gq1sa/rkPm9Smo6yfR8dUUgjuDS4a5Zbg92HiI= X-Sasl-enc: Odc2rtZFaikX9HHiAtQC1tn/9xLK4KestqqLCTKIEr+I 1464459009 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id AD061CCD34; Sat, 28 May 2016 14:10:09 -0400 (EDT) Date: Sat, 28 May 2016 14:10:09 -0400 From: Leo Famulari To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160528181009.GA27844@jasmine> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> <20160526164707.GA11671@jasmine> <878tyumgjx.fsf@gnu.org> <20160528180535.GA27711@jasmine> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160528180535.GA27711@jasmine> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sat, May 28, 2016 at 02:05:35PM -0400, Leo Famulari wrote: > Please find my latest patch attached. It seems to work for me! I forgot to add a copyright line for myself in this version. I'll put it in for the next patch or when merging. From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 14:26:26 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 18:26:26 +0000 Received: from localhost ([127.0.0.1]:45037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6iwM-0001TI-8d for submit@debbugs.gnu.org; Sat, 28 May 2016 14:26:26 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:39425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6iwK-0001TB-Ne for 23605@debbugs.gnu.org; Sat, 28 May 2016 14:26:24 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 7B3002070E; Sat, 28 May 2016 14:26:24 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Sat, 28 May 2016 14:26:24 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=fYTyk qxqryztt1whMVyV9Bbftfw=; b=0BzP1t48zIluZd+utdnOxp+t/9UqzdqPkYoyx 2FKsPhPPb0xwpz9K8U4nrsnjl9AzuI0BXq0nEsiHW24+9eE7Bg6qC3d9bmwLcEBY jWPdpEEmSOoINfamt8B8px3Epn05W0dcbvhepdImxg+mpx8qQI24XSgugNbCzinj /SbtBE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=fYTykqxqryztt1whMVyV9Bbftfw=; b=fv4Uf O0f2x+a/+/XAh/unuyemJ33oaDH8yPw3JhQSLqs/CKmy2ZlokCRadUhgN1oSNro3 cLCQwCk3Mmoa4Y8yU10kZ9p9CSDXAmFiJ9HwzqCcDidKA5HZ6nLzbP7Yhw53l1P7 VnlUx1m+t5iYWEF+7mGP+wcxoXMNzp2pAsw1xk= X-Sasl-enc: MDCfcuq2LhijrLFBdeIbNO7FuGQQZSGk2U1QDV20/ICp 1464459984 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 33D32CCD88; Sat, 28 May 2016 14:26:24 -0400 (EDT) Date: Sat, 28 May 2016 14:26:23 -0400 From: Leo Famulari To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160528182623.GA28209@jasmine> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> <20160526164707.GA11671@jasmine> <878tyumgjx.fsf@gnu.org> <20160528180535.GA27711@jasmine> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160528180535.GA27711@jasmine> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sat, May 28, 2016 at 02:05:35PM -0400, Leo Famulari wrote: > Please find my latest patch attached. It seems to work for me! I'm currently reconfiguring my GuixSD system with this patch to make sure bad things don't happen the first time the user halts and the seed file does not exist. Or something like that. Just to see what happens. So far, I tested this by generating VM images. From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 16:41:07 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 20:41:07 +0000 Received: from localhost ([127.0.0.1]:45069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6l2g-0004Ys-Pt for submit@debbugs.gnu.org; Sat, 28 May 2016 16:41:06 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:35747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6l2e-0004Yk-NY for 23605@debbugs.gnu.org; Sat, 28 May 2016 16:41:05 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id D30422023F; Sat, 28 May 2016 16:41:02 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Sat, 28 May 2016 16:41:02 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=6XKVL AqIUrSRjFdjafKTGfZSNFA=; b=lFt0m49KPd84/36vvGBewefCeM0mvZ4SxfDaO Pa0zjRrNAw5mtqsb+z37n4QhxHa67AbWhjNgX38w0WBqlQL52tfFqAIwP0ZOMA0y deIB0qSk9H8iAOfcRgeGb/KnL7dRbR6sykALHxSBGfDN4vUhsQsSJOBOyLznTPUc YGEVOA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=6XKVLAqIUrSRjFdjafKTGfZSNFA=; b=WaFCo wTfcnA/+MBjacA8eWUAt/++rdOYm3asB7OtKXwrCBGQ+5ZilEnwYwaXi7mxbMT4J UuEq8mzvpdavwNyAWGeRN0dFe8xDsn+w+rZVOWqLMvFti9HHvwTcuUBKO2Axrdrz QkG1VBpGtTCpaGbHCMl9skBrpz2H3rcXRDN9os= X-Sasl-enc: IvCAdZVD37ws1oqYgPQz9NmU4naAVSjuRzq894JTnzJ1 1464468062 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 89950CCD9A; Sat, 28 May 2016 16:41:02 -0400 (EDT) Date: Sat, 28 May 2016 16:41:01 -0400 From: Leo Famulari To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160528204101.GA31520@jasmine> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> <20160526164707.GA11671@jasmine> <878tyumgjx.fsf@gnu.org> <20160528180535.GA27711@jasmine> <20160528182623.GA28209@jasmine> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160528182623.GA28209@jasmine> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sat, May 28, 2016 at 02:26:23PM -0400, Leo Famulari wrote: > On Sat, May 28, 2016 at 02:05:35PM -0400, Leo Famulari wrote: > > Please find my latest patch attached. It seems to work for me! > > I'm currently reconfiguring my GuixSD system with this patch to make > sure bad things don't happen the first time the user halts and the seed > file does not exist. Or something like that. Just to see what happens. No problems. After reconfiguring, the service is started and there is a zero-byte file at /var/lib/random-seed. From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 16:53:24 2016 Received: (at 23605) by debbugs.gnu.org; 28 May 2016 20:53:24 +0000 Received: from localhost ([127.0.0.1]:45073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6lEZ-0004pW-Vv for submit@debbugs.gnu.org; Sat, 28 May 2016 16:53:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50639) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6lEY-0004pH-0v for 23605@debbugs.gnu.org; Sat, 28 May 2016 16:53:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6lEO-0005Jn-7A for 23605@debbugs.gnu.org; Sat, 28 May 2016 16:53:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,PERCENT_RANDOM, RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6lEO-0005Ji-3x; Sat, 28 May 2016 16:53:12 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:58568 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b6lEM-0006Fy-8g; Sat, 28 May 2016 16:53:10 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Leo Famulari Subject: Re: bug#23605: /dev/urandom not seeded across reboots References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> <20160526164707.GA11671@jasmine> <878tyumgjx.fsf@gnu.org> <20160528180535.GA27711@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 Prairial an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Sat, 28 May 2016 22:53:08 +0200 In-Reply-To: <20160528180535.GA27711@jasmine> (Leo Famulari's message of "Sat, 28 May 2016 14:05:35 -0400") Message-ID: <87oa7pj45n.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.6 (---) Leo Famulari skribis: > Please find my latest patch attached. It seems to work for me! \o/ > From 18979451b1af7eebaa354c1753ad4c90af288589 Mon Sep 17 00:00:00 2001 > From: Leo Famulari > Date: Sat, 28 May 2016 13:41:21 -0400 > Subject: [PATCH] services: Add urandom-seed-service. Add =E2=80=9CFixes .=E2=80=9D > * gnu/services/base.scm (urandom-seed-service): New procedure. > (%random-seed-file, urandom-seed-service-type): New variables. > (%urandom-seed-shepherd-service): New procedure. Mention the addition to =E2=80=98%base-services=E2=80=99 too. > * doc/guix.texi (Base Services): Document it. [...] > +@deftp {Data Type} %random-seed-file Should be: @defvr {Scheme Variable} %random-seed-file > +This is where some random bytes are saved by @var{urandom-seed-service} s/This is where/This is the name of the file where/ > +to seed @file{/dev/urandom} when rebooting. Maybe add =E2=80=9CIt defaults to @file{/var/run/=E2=80=A6}.=E2=80=9D OK with these changes. Thanks a lot! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 20:01:02 2016 Received: (at 23605) by debbugs.gnu.org; 29 May 2016 00:01:02 +0000 Received: from localhost ([127.0.0.1]:45128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6oAA-0002VQ-8X for submit@debbugs.gnu.org; Sat, 28 May 2016 20:01:02 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:58012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6oA8-0002Ut-IL for 23605@debbugs.gnu.org; Sat, 28 May 2016 20:01:00 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E5560206FD; Sat, 28 May 2016 20:00:59 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sat, 28 May 2016 20:00:59 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=oKgGRUPBFvOuBIAH5vtUAT669Uk=; b=UFErBM NnZq+TQimKtr/WnJxil0AoeUBvcJk+/W/2JlbY7oap+xyTPBC1+s0/qYhs0L+AOI jUXwTANgPNHhTr5ODtip4COvnoIcq3zLPn48ui/s6DVIOgAp6aMrQut0tw9i5W47 WlAT5bRl3YZ5ygmLY+A7sMJRh190bPNR+YPEk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=oKgGRUPBFvOuBIA H5vtUAT669Uk=; b=hG0iiJWBrIrLfeap5VjqrLeJzeqvThPTC+Zkk7dFmlLloSz xd3UiLoT6S0YF2W7M2GnF7bXlyGB1rKWjPeUOQWoHkD5xTtCNIhcSd4grqlKlX3E UUXyzp8iT9e+diIC3iJKcV/jLK70VIEDW8AEjejM1Ia227aJLTPaGZRsyie4= X-Sasl-enc: E9GMf4zifcVZfO3yDbRzLkFsIZZZ87DluhLaFAOdPdl4 1464480059 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id 8D85ECCD88; Sat, 28 May 2016 20:00:59 -0400 (EDT) Date: Sat, 28 May 2016 20:00:58 -0400 From: Leo Famulari To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160529000058.GA6182@jasmine> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> <20160526164707.GA11671@jasmine> <878tyumgjx.fsf@gnu.org> <20160528180535.GA27711@jasmine> <87oa7pj45n.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87oa7pj45n.fsf@gnu.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605 Cc: 23605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sat, May 28, 2016 at 10:53:08PM +0200, Ludovic Courts wrote: > > OK with these changes. Done as a535e12226! From debbugs-submit-bounces@debbugs.gnu.org Sat May 28 20:04:33 2016 Received: (at 23605-done) by debbugs.gnu.org; 29 May 2016 00:04:34 +0000 Received: from localhost ([127.0.0.1]:45132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6oDZ-0002al-OG for submit@debbugs.gnu.org; Sat, 28 May 2016 20:04:33 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:42893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b6oDY-0002ae-6E for 23605-done@debbugs.gnu.org; Sat, 28 May 2016 20:04:32 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 13F2B2013F; Sat, 28 May 2016 20:04:32 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sat, 28 May 2016 20:04:32 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=famulari.name; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=YqssJ7rQyWTcWVvih8jsXs1FK5Y=; b=IAgUWU dbx6I3L0OIasXh3/jtj6StjqiPNqzDGrrgbLwTO5a8cN7H7HDTtQPzgzJOvYlBFY 7t9cQAom8N2oYuu1TxyOv/vpNswMzbgtWTNzG3tLUz1sG3oYXT2PFp6LHxjFqDRK jfySTAFWXCJ5bY6uJ2TEpWo0MHOLfUYl6M/h0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=YqssJ7rQyWTcWVv ih8jsXs1FK5Y=; b=o0tWR1/zGxY8hwijY+1KhgkJeaivREIx8HQmAcOUx76vlYr Tb2lrF24cDVjA9Q2ru5cNNXcpEDnm0mzIXgKU9PenRK1mY6TeB8hCKSq0srij2MQ f6a3vBrMr3ofd8Juyxuu9YI9Dkqwu7lI/+FQKaBHexPABqikVBiJBIdg+2VE= X-Sasl-enc: oqEDznZXaago11AGTc7wvHDK2+FFntdqkkzAemxuGFJx 1464480271 Received: from localhost (c-73-188-17-148.hsd1.pa.comcast.net [73.188.17.148]) by mail.messagingengine.com (Postfix) with ESMTPA id C4B89CCD24 for <23605-done@debbugs.gnu.org>; Sat, 28 May 2016 20:04:31 -0400 (EDT) Date: Sat, 28 May 2016 20:04:31 -0400 From: Leo Famulari To: 23605-done@debbugs.gnu.org Subject: Re: bug#23605: /dev/urandom not seeded across reboots Message-ID: <20160529000431.GA6304@jasmine> References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> <20160526164707.GA11671@jasmine> <878tyumgjx.fsf@gnu.org> <20160528180535.GA27711@jasmine> <87oa7pj45n.fsf@gnu.org> <20160529000058.GA6182@jasmine> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160529000058.GA6182@jasmine> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23605-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sat, May 28, 2016 at 08:00:58PM -0400, Leo Famulari wrote: > On Sat, May 28, 2016 at 10:53:08PM +0200, Ludovic Courts wrote: > > > > OK with these changes. > > Done as a535e12226! From debbugs-submit-bounces@debbugs.gnu.org Sun May 29 16:23:30 2016 Received: (at 23605-done) by debbugs.gnu.org; 29 May 2016 20:23:30 +0000 Received: from localhost ([127.0.0.1]:46656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b77FB-00036i-PP for submit@debbugs.gnu.org; Sun, 29 May 2016 16:23:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b77FA-00036W-0v for 23605-done@debbugs.gnu.org; Sun, 29 May 2016 16:23:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b77F0-0004jP-VE for 23605-done@debbugs.gnu.org; Sun, 29 May 2016 16:23:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:57576) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b77F0-0004iv-SN; Sun, 29 May 2016 16:23:18 -0400 Received: from reverse-83.fdn.fr ([80.67.176.83]:60890 helo=pluto) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1b77Ez-000211-3o; Sun, 29 May 2016 16:23:17 -0400 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Leo Famulari Subject: Re: bug#23605: /dev/urandom not seeded across reboots References: <20160523175832.GA10646@jasmine> <87d1obabj8.fsf@gnu.org> <20160525163815.GA19996@jasmine> <87vb229ixp.fsf@gnu.org> <20160526164707.GA11671@jasmine> <878tyumgjx.fsf@gnu.org> <20160528180535.GA27711@jasmine> <87oa7pj45n.fsf@gnu.org> <20160529000058.GA6182@jasmine> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 Prairial an 224 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Sun, 29 May 2016 22:23:14 +0200 In-Reply-To: <20160529000058.GA6182@jasmine> (Leo Famulari's message of "Sat, 28 May 2016 20:00:58 -0400") Message-ID: <87r3ckvcjx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 23605-done Cc: 23605-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.4 (------) Leo Famulari skribis: > On Sat, May 28, 2016 at 10:53:08PM +0200, Ludovic Court=C3=A8s wrote: >>=20 >> OK with these changes. > > Done as a535e12226! Thank you! Ludo=E2=80=99. From unknown Mon Aug 18 11:21:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 27 Jun 2016 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator