Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #955159

Bug#923675: debian-installer: consider using haveged to gather entropy

From Cyril Brulebois <kibi@debian.org>
Newsgroups linux.debian.bugs.dist, linux.debian.maint.boot
Subject Bug#923675: debian-installer: consider using haveged to gather entropy
Date 2019-04-20 02:50 +0200
Message-ID <xOMmB-6JA-3@gated-at.bofh.it> (permalink)
References (7 earlier) <xNE7M-65r-3@gated-at.bofh.it> <xxD62-70X-1@gated-at.bofh.it> <xNSu5-6Kd-3@gated-at.bofh.it> <xxD62-70X-1@gated-at.bofh.it> <xNSu5-6Kd-3@gated-at.bofh.it>
Organization Debian

Cross-posted to 2 groups.

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Control: tag -1 patch pending

Hi,

Ben Hutchings <ben@decadent.org.uk> (2019-04-17):
> Ideally it would only be used if there isn't a hardware RNG available.
> Currently we don't include any hardware RNG modules in udebs, but that
> can be changed.  So please first check that:
> 
> * /sys/devices/virtual/misc/hw_random/rng_current is absent or
>   contains "none"
> * (x86 only) /proc/cpuinfo does not mention rdrand (I can't find an
>   arch-independent way to check for this, and Linux doesn't yet
>   support an equivalent feature on any other architecture)
> 
> Something like this should work:
> 
> if [ "$(cat /sys/devices/virtual/misc/hw_random/rng_current 2>/dev/null || echo none)" = none ] \
>    && ! grep -q '^flags\b.*\brdrand\b' /proc/cpuinfo; then
>     # use software entropy daemon
> fi

Many thanks for your input and for the suggested implementation.

I've tweaked it a little so that we log whether haveged is available,
and whether it should be started, in case we need to investigate:
  https://salsa.debian.org/installer-team/rootskel/blob/master/src/lib/debian-installer-startup.d/S50entropy-source


I think I've tested all cases:
 - when haveged-udeb hasn't been added to src:debian-installer's
   pkg-lists yet
 - with the default Skylake-Client in libvirt, which leads to an rdrand
   CPU flag;
 - with a core2duo CPU instead, which has no such flag;
 - with the same CPU, but with a VirtIO RNG enabled, and those extra
   kernel modules in my netboot-gtk image:
     lib/modules/4.19.0-4-amd64/kernel/drivers/char/hw_random/rng-core.ko
     lib/modules/4.19.0-4-amd64/kernel/drivers/char/hw_random/virtio-rng.ko
     lib/modules/4.19.0-4-amd64/kernel/drivers/virtio/virtio.ko
     lib/modules/4.19.0-4-amd64/kernel/drivers/virtio/virtio_ring.ko
   which leads to a virtio_rng.0 in …/hw_random/rng_current.


So I've just uploaded a new version of rootskel (1.129), and pushed a
new commit to debian-installer:
  https://salsa.debian.org/installer-team/debian-installer/commit/c470001925d067b42cdf613339634f4d54ed01b6

The haveged-udeb addition was already uploaded and also ACCEPTED from
NEW. I'll keep an eye on the daily builds.


Cheers,
-- 
Cyril Brulebois (kibi@debian.org)            <https://debamax.com/>
D-I release manager -- Release team member -- Freelance Consultant

Back to linux.debian.bugs.dist | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Bug#923675: Add related bug #916690 info Daniel Lange <DLange@debian.org> - 2019-04-16 09:40 +0200
  Bug#923675: Add related bug #916690 info Petter Reinholdtsen <pere@hungry.com> - 2019-04-16 12:30 +0200
    Bug#923675: Add related bug #916690 info Ben Hutchings <ben@decadent.org.uk> - 2019-04-16 13:10 +0200
      Bug#923675: Add related bug #916690 info Petter Reinholdtsen <pere@hungry.com> - 2019-04-16 14:10 +0200
        Bug#923675: Add related bug #916690 info Ben Hutchings <ben@decadent.org.uk> - 2019-04-16 21:20 +0200
          Bug#923675: Add related bug #916690 info Cyril Brulebois <kibi@debian.org> - 2019-04-16 22:40 +0200
            Bug#923675: debian-installer: consider using haveged to gather entropy Cyril Brulebois <kibi@debian.org> - 2019-04-16 23:50 +0200
              Bug#923675: debian-installer: consider using haveged to gather entropy Steve McIntyre <steve@einval.com> - 2019-04-17 00:30 +0200
              Bug#923675: debian-installer: consider using haveged to gather entropy Jonathan Carter <jonathan@jonathancarter.org> - 2019-04-17 08:30 +0200
              Bug#923675: debian-installer: consider using haveged to gather entropy Ben Hutchings <ben@decadent.org.uk> - 2019-04-17 15:10 +0200
                Bug#923675: debian-installer: consider using haveged to gather entropy Cyril Brulebois <kibi@debian.org> - 2019-04-20 02:50 +0200
                Bug#923675: debian-installer: consider using haveged to gather entropy Holger Levsen <holger@layer-acht.org> - 2019-04-20 10:50 +0200
                Bug#923675: debian-installer: consider using haveged to gather entropy Cyril Brulebois <kibi@debian.org> - 2019-04-20 23:40 +0200
                Bug#923675: debian-installer: consider using haveged to gather entropy Holger Levsen <holger@layer-acht.org> - 2019-04-22 17:10 +0200
                Bug#923675: debian-installer: consider using haveged to gather entropy Cyril Brulebois <kibi@debian.org> - 2019-04-22 19:40 +0200
          Bug#923675: Add related bug #916690 info Petter Reinholdtsen <pere@hungry.com> - 2019-04-16 23:50 +0200
  Bug#923675: Add related bug #916690 info Thorsten Glaser <tg@mirbsd.de> - 2019-04-16 15:40 +0200

csiph-web