All of lore.kernel.org
 help / color / mirror / Atom feed
From: Norbert Lange <nolange79@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/2] package/haveged: Change service file to run early
Date: Mon, 29 Jun 2020 11:55:26 +0200	[thread overview]
Message-ID: <CADYdroNwfd6XJT+TRUV+_uR6qhYDwxGRpNSTFdd-e5xNi6gEFQ@mail.gmail.com> (raw)
In-Reply-To: <20200629093044.eurgl7qjx4xkd3vv@falbala.internal.home.lespocky.de>

Am Mo., 29. Juni 2020 um 11:30 Uhr schrieb Alexander Dahl <post@lespocky.de>:
>
> Hei hei,
>
> On Mon, Jun 29, 2020 at 10:29:38AM +0200, Norbert Lange wrote:
> > Haveged is not entropy, it's a substitute. I dont know how many times I
> > need to point that out.
>
> As far as I understood the source for the entropy haveged collects is
> random timing jitter from the CPU. Could you explain, why that is not
> real entropy, although it passes the FIPS tests? Or point to an
> explanation to learn from?

This is already round 2 of the argumentation, see
http://lists.busybox.net/pipermail/buildroot/2020-June/284465.html

But yes. haveged is still not tapping any entropy the kernel has not available,
it just blows up the low entropy available with a random number generator.
I am not up to speed with FIPS tests, but from a really really long way back
it wasn't a big issue to pass most tests with the Mersenne Twister and a few
bits of true entropy.

Basically it feeds PRNG back to kernel and lets it account as entropy source.

> > The less dependencies, the faster the system can startup (and lesser
> > chances of some stoopid deadlocks).
>
> This might be true in general, but it is not necessarily on embedded
> systems waiting for the kernel's crng to be initialized. If that
> initialization is a requirement and the system has very few entropy
> sources only (think of an embedded device with no network initialized,
> no HID, no sensors, ?) the boot can actually hours or days, seriously.

Yes, don't need to tell me that. But the requested change would make
things worse not better
in times of startup and potentially "quality" entropy.
With systemd, a "before" means just that the process is spawned,
doesn't mean that a single bit
of random was fed back to the kernel.
-   The haveged will spawn at the same time
-   random seed will be delayed (and there might be real entropy from
a long running system now not accounted).

In short:

Want better/faster entropy, use rng-tools, or choose to "trust" the
CPU vendor if instructions are available.
Want to boot faster, substituting real entropy by blowing it up with a
PRNG, pick haveged.

A good PRNG is still not entropy.

Norbert

  reply	other threads:[~2020-06-29  9:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 22:41 [Buildroot] (no subject) Norbert Lange
2020-06-09 22:41 ` [Buildroot] [PATCH v2 1/2] package/haveged: Change service file to run early Norbert Lange
2020-06-25 22:39   ` Norbert Lange
2020-06-29  7:31     ` Jérémy ROSEN
2020-06-29  8:29       ` Norbert Lange
2020-06-29  9:30         ` Alexander Dahl
2020-06-29  9:55           ` Norbert Lange [this message]
2020-06-29 12:41             ` Alexander Dahl
2020-06-29 15:17               ` Norbert Lange
2020-06-29 21:37                 ` Alexander Dahl
2020-06-30  7:46                   ` Norbert Lange
2020-06-30  7:54                     ` Norbert Lange
2020-06-30  8:14                     ` Alexander Dahl
2020-06-29 12:03         ` Jérémy ROSEN
2020-06-29 15:08           ` Norbert Lange
2020-09-13 13:27   ` Thomas Petazzoni
2020-09-14  7:00     ` Jérémy ROSEN
2020-06-09 22:41 ` [Buildroot] [PATCH v2 2/2] package/haveged: bump to version 1.9.9 Norbert Lange
2020-06-10 20:57   ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADYdroNwfd6XJT+TRUV+_uR6qhYDwxGRpNSTFdd-e5xNi6gEFQ@mail.gmail.com \
    --to=nolange79@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.