GNU bug report logs

#29773 urandom-seed-service should run earlier in the boot process

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

Received: (at submit) by debbugs.gnu.org; 19 Dec 2017 19:14:08 +0000
From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 19 14:14:08 2017
Received: from localhost ([127.0.0.1]:42654 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1eRNL5-0004Wf-N5
	for submit@debbugs.gnu.org; Tue, 19 Dec 2017 14:14:07 -0500
Received: from eggs.gnu.org ([208.118.235.92]:50867)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@famulari.name>) id 1eRNL4-0004WE-7c
 for submit@debbugs.gnu.org; Tue, 19 Dec 2017 14:14:06 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <leo@famulari.name>) id 1eRNKx-0008Iy-OM
 for submit@debbugs.gnu.org; Tue, 19 Dec 2017 14:14:00 -0500
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]:47974)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <leo@famulari.name>) id 1eRNKx-0008Ip-JY
 for submit@debbugs.gnu.org; Tue, 19 Dec 2017 14:13:59 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41798)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <leo@famulari.name>) id 1eRNKw-0005OT-8e
 for bug-guix@gnu.org; Tue, 19 Dec 2017 14:13:59 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <leo@famulari.name>) id 1eRNKt-0008GR-1g
 for bug-guix@gnu.org; Tue, 19 Dec 2017 14:13:58 -0500
Received: from out3-smtp.messagingengine.com ([66.111.4.27]:59759)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <leo@famulari.name>) id 1eRNKs-0008DS-Ps
 for bug-guix@gnu.org; Tue, 19 Dec 2017 14:13:54 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id E173520BA1;
 Tue, 19 Dec 2017 14:13:50 -0500 (EST)
Received: from frontend2 ([10.202.2.161])
 by compute4.internal (MEProxy); Tue, 19 Dec 2017 14:13:50 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=content-type:date:from:message-id:mime-version:subject:to
 :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=Is+nf1k+3EdKsQ
 SVVd+lxExKXYsPtS8cjsSd7oDFwyI=; b=0eS3oKFzjGfRlZBDvUHhOwQWyuvozI
 V91Iep0WpwC8XEMfCLMVEKf9EUXKfTz23WzRrtf6h0G8Uo0DlJLQgXxmrjySAy0L
 4zRXwM503k2e6fLCUtQvKTS/Y8fxXkb74kaO2CyFYeDaBX//fmQnPenb8aPzJPbb
 vg2StBmYdnudw=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=content-type:date:from:message-id
 :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; bh=Is+nf1k+3EdKsQSVVd+lxExKXYsPtS8cjsSd7oDFwyI=; b=Y95sjbNT
 zCI0bwQ2k76gMugIebCdR0XFIrpPQb22rZmYLt95KgLxj4455nTV0Zg/eqFEPAqi
 itke76YP8UcIooKkWVix/kCfjrkDuwqMzuvlkbneew+dPnLieLD0ZBLNXPXhJZRK
 0x33EiC3lqEUfx/Fja2XroGLAzyuuhNP6wabLp3yoWZQD+5pT5aC5Q5EUlMJDUvn
 mnSnWHtjBeQOt3bNAMaFvYc4yCakJ0g8Jt/eJFMJ6+eT7WYFharhNz6xFm7a5Pho
 65gwv3lH3LyURMFr07nXNB9VxMpoBCyNYlQgx5KHr7L49E9DxzPif5GxP+SvYhr5
 fJWJrUi53yETrA==
X-ME-Sender: <xms:7mQ5WlnweE_C340NY23A_iMn9QmlxHPo5ZxKUgiS2gYmHdS05zZyHg>
Received: from localhost (unknown [172.58.201.122])
 by mail.messagingengine.com (Postfix) with ESMTPA id 93E9F24009
 for <bug-guix@gnu.org>; Tue, 19 Dec 2017 14:13:50 -0500 (EST)
Date: Tue, 19 Dec 2017 14:13:48 -0500
From: Leo Famulari <leo@famulari.name>
To: bug-guix@gnu.org
Subject: urandom-seed-service should run earlier in the boot process
Message-ID: <20171219191348.GA19177@jasmine.lan>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB"
Content-Disposition: inline
User-Agent: Mutt/1.9.2 (2017-12-15)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
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: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -4.1 (----)
[Message part 1 (text/plain, inline)]
The urandom-seed-service preserves some of the Linux cryptographic
random number generator's (CRNG) pool across reboots so that freshly
booted systems have access to unpredictable psuedorandom numbers. It
also tries to take advantage of whatever is backing /dev/hwrng.

However, the urandom-seed-service may not be started before certain
applications that assume a good source of randomness.

In some cases, the applications require some random data before any
services are started, during activation. For example, our OpenSSH
service generates its host keys during activation. And even if it
generated host keys during the start of the OpenSSH service, that
service does not depend on urandom-seed-service. [0]

In systemd, there is an abstract sysinit "target" that basically serves
as a checkpoint. All the lower-level system initialization is required
before the sysinit.target is met, and the rest of the services depend on
sysinit. The random seeding is part of sysinit. I've reproduced a graph
of this in [1].

In practice, I'm not sure if it matters. I'd appreciate if GuixSD users
could check /var/log/messages for warnings like this one and report
them:

random: application: uninitialized urandom read (16 bytes read) 

And I'd also appreciate any feedback or ideas for improvement in this
area.

[0] See the attached service graph of a bare-bones system with OpenSSH.
[1] from: <https://www.freedesktop.org/software/systemd/man/bootup.html>

local-fs-pre.target
         |
         v
(various mounts and   (various swap   (various cryptsetup
 fsck services...)     devices...)        devices...)       (various low-level   (various low-level
         |                  |                  |             services: udevd,     API VFS mounts:
         v                  v                  v             tmpfiles, random     mqueue, configfs,
  local-fs.target      swap.target     cryptsetup.target    seed, sysctl, ...)      debugfs, ...)
         |                  |                  |                    |                    |
         \__________________|_________________ | ___________________|____________________/
                                              \|/
                                               v
                                        sysinit.target
                                               |
          ____________________________________/|\________________________________________
         /                  |                  |                    |                    \
         |                  |                  |                    |                    |
         v                  v                  |                    v                    v
     (various           (various               |                (various          rescue.service
    timers...)          paths...)              |               sockets...)               |
         |                  |                  |                    |                    v
         v                  v                  |                    v              rescue.target
   timers.target      paths.target             |             sockets.target
         |                  |                  |                    |
         v                  \_________________ | ___________________/
                                              \|/
                                               v
                                         basic.target
                                               |
          ____________________________________/|                                 emergency.service
         /                  |                  |                                         |
         |                  |                  |                                         v
         v                  v                  v                                 emergency.target
     display-        (various system    (various system
 manager.service         services           services)
         |             required for            |
         |            graphical UIs)           v
         |                  |           multi-user.target
         |                  |                  |
         \_________________ | _________________/
                           \|/
                            v
                  graphical.target
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Mon Dec 30 17:37:33 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.