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 #16 received at 29773@debbugs.gnu.org (full text, mbox, reply):

Received: (at 29773) by debbugs.gnu.org; 20 Dec 2017 23:07:59 +0000
From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 20 18:07:59 2017
Received: from localhost ([127.0.0.1]:44930 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1eRnSv-0005gv-Sb
	for submit@debbugs.gnu.org; Wed, 20 Dec 2017 18:07:59 -0500
Received: from out3-smtp.messagingengine.com ([66.111.4.27]:39649)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <leo@famulari.name>) id 1eRnSr-0005gl-Ry
 for 29773@debbugs.gnu.org; Wed, 20 Dec 2017 18:07:56 -0500
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44])
 by mailout.nyi.internal (Postfix) with ESMTP id 53FB520AF9;
 Wed, 20 Dec 2017 18:07:53 -0500 (EST)
Received: from frontend1 ([10.202.2.160])
 by compute4.internal (MEProxy); Wed, 20 Dec 2017 18:07:53 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name;
 h=cc:content-type:date:from:in-reply-to:message-id:mime-version
 :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=
 mesmtp; bh=/alZXCY2ikQ4AUYFA5rmhO0fKrZc5LpPwC6GzVO2MME=; b=fsMT0
 MYSg0aqE0OESqbiEdlArvqOaAzYJHeK0AacqDWfUTHJCsrRMAXDxpZ/1SYdoUhub
 6RR/ExG+pRvfQnKJub2ulMz1zfAhY7abhq3QuSGWjmRYpgWxMay/c1ho0oVNOCZQ
 azv4Pj4OwVO3QHmliy0EB/YxkFrJ+jnCTVhe4I=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm1; bh=/alZXCY2ikQ4AUYFA5rmhO0fKrZc5
 LpPwC6GzVO2MME=; b=SKpJSkC3tdNFMAnvpUKgN/AWpsD/M1xa0Lr3jhZp15mqS
 +IISFqSlf+Wn14dh4w+BdUWB+DMlkfNNz57Qu7LaG+aSWCFspPju1MDuS9CTy4Ei
 HY6vYX3d2TqZwIXQ7MPgDuq199KOAsHvTK5LbpuxqStxib20sn+lQX+iW9XOnyoj
 PtTxrFLcbrj6WpOpqmh1WUWeRvOjPhZn1IqKmQBK6zEvtFzYCJI7yCS5LQYt/0XM
 gey0NS4ZcFkvgbBqXb6reAS7adpwYyK+1jCE7vfjntOnTDeYIiew/xQ4OlKXe7Y1
 kjZnPi+9s/JBfkm5XrBvA6SxxS7dVD3PhsZdfgJTw==
X-ME-Sender: <xms:Se06Wp-fAxcQJQByiraNlniqn65D5nxIaRgwpkCdvNwHqNs4YKaKYg>
Received: from localhost (c-73-165-108-70.hsd1.pa.comcast.net [73.165.108.70])
 by mail.messagingengine.com (Postfix) with ESMTPA id F06D67E17D;
 Wed, 20 Dec 2017 18:07:52 -0500 (EST)
Date: Wed, 20 Dec 2017 18:07:51 -0500
From: Leo Famulari <leo@famulari.name>
To: Ludovic Courtès <ludo@gnu.org>
Subject: Re: bug#29773: urandom-seed-service should run earlier in the boot
 process
Message-ID: <20171220230751.GA18857@jasmine.lan>
References: <20171219191348.GA19177@jasmine.lan>
 <87tvwlzop3.fsf@gnu.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT"
Content-Disposition: inline
In-Reply-To: <87tvwlzop3.fsf@gnu.org>
User-Agent: Mutt/1.9.2 (2017-12-15)
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 29773
Cc: 29773@debbugs.gnu.org
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: -0.7 (/)
[Message part 1 (text/plain, inline)]
On Wed, Dec 20, 2017 at 11:19:36AM +0100, Ludovic Courtès wrote:
> There’s a ‘user-processes’ service that serves a similar purpose.
> 
> With the attached patches ‘urandom-seed’ becomes a dependency of
> ‘user-processes’, meaning that daemons & co. start after
> ‘urandom-seed’.
> 
> WDYT?

In general, I think it's a good approach.

Currently, the urandom-seed-service seems to non-deterministically but
typically start after the udev-service, so that /dev/hwrng is always set
up by udev before the urandom-seed-service tries to use it.

With these patches, that's not the case. This breaks the hwrng seeding
feature added in 9a56cf2b5b (services: urandom-seed: Try using a HWRNG
to seed the Linux CRNG at boot).

I'll try rearranging the service dependency graph.

> > Leo Famulari <leo@famulari.name> skribis:
> > 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) 
> 
> I don’t have any of these.  I guess this is most likely to happen when
> running ‘ssh-keygen’ on startup, which isn’t the case on my machine.

Watching a fresh system boot repeatedly, I noticed that the host keys
always seem to be generated immediately after Linux reports "random:
crng init done".

To me, this suggests that OpenSSH is using the getrandom() syscall. If
so, any GuixSD host keys created with glibc >= 2.25 and OpenSSH >= 7.2
should be unpredictable. But I'm not sure if that's what's happening or
not.

> +(define (user-processes-shepherd-service requirements)
> +  "Return the 'user-processes' Shepherd service with dependencies on
> +REQUIREMENTS (a list of service names).
> +
> +This is a synchronization point used to make sure user processes and daemons
> +get started only after crucial initial services have been started---file
> +system mounts, etc.  This is similar to 'target' in systemd."

To clarify, user-processes may be similar to the sysinit target in
systemd. Systemd targets are sort of like run-levels, and there are
several of them, such as the multi-user target, the graphical target,
etc.
[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: Sat Dec 21 16:46:04 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.