All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [Bug 12511] New: rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably
@ 2020-01-28 15:37 bugzilla at busybox.net
  2020-01-28 16:03 ` [Buildroot] [Bug 12511] " bugzilla at busybox.net
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2020-01-28 15:37 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=12511

            Bug ID: 12511
           Summary: rng-tools has forced dependency on
                    jitterentropy-library ; It slows boot considerably
           Product: buildroot
           Version: 2019.11.1
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Other
          Assignee: unassigned at buildroot.uclibc.org
          Reporter: axel.voitier at gmail.com
                CC: buildroot at uclibc.org
  Target Milestone: ---

Hello,

Updating from 2019.05 to 2019.11.1, I noticed the boot time on my target (iMX6)
increased by ~20s. Culprit was quickly found: rngd.

Apparently we went from rng-tools 5 to 6.7. A bit more digging led me to figure
out that the actual culprit is the new jitterentropy source added relatively
recently to rng-tools.

This library provide entropy source from CPU timings jitter it seems. That's
probably very nice for system without hardware RNG. But even if you have one,
the jitter source remains enabled by default and slows the start up of rngd
significatively.

Now, the quick solution is to add 'DAEMON_ARGS+="-x jitter"' to
/etc/default/rngd. But first, that might take some digging for affected users
to figure this out.

Second, I don't think it is actually right that buildroot package for rng-tools
force the dependency on jitterentropy-library, as it is not strictly necessary
to compile and install it.
Sure, you want to provide a nice and easy default for users of targets without
HWRNG. But that impacts negatively users who do have HWRNG.

I would suggest to either provide static options for that in menuconfig.
Or, I don't know if it is possible for a .mk package file to reference a kernel
option, but it could be possible to detect if kernel has a driver enabled for
either a /dev/hwrng provider, or a TPM device.
Could also be done from /etc/init.d/S21rngd?


Cheers,
Axel

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 12511] rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably
  2020-01-28 15:37 [Buildroot] [Bug 12511] New: rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably bugzilla at busybox.net
@ 2020-01-28 16:03 ` bugzilla at busybox.net
  2020-01-28 18:31 ` bugzilla at busybox.net
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2020-01-28 16:03 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=12511

Thomas Petazzoni <thomas.petazzoni@free-electrons.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at buildroot.uclibc |matthew.weber at rockwellcolli
                   |.org                        |ns.com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 12511] rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably
  2020-01-28 15:37 [Buildroot] [Bug 12511] New: rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably bugzilla at busybox.net
  2020-01-28 16:03 ` [Buildroot] [Bug 12511] " bugzilla at busybox.net
@ 2020-01-28 18:31 ` bugzilla at busybox.net
  2020-02-05 18:27 ` bugzilla at busybox.net
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2020-01-28 18:31 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=12511

--- Comment #1 from Matt Weber <matthew.weber@rockwellcollins.com> ---
Sorry to hear about the boot delay issue.  The reason it was added by default
was I noticed the init script had handled a case of adding entropy when a hwrng
wasn't present. I didn't realize the impact when hwrng was enabled.

I agree, I think something like a new kconfig sub option named "enable source
jitterentropy" under rngd might be best (with a solid help description
outlining when to enable it).  There isn't a ideal way to get a linux config
option to trigger a dependency in the buildroot build.

We could tailor the initscript and have it check if there is a hwrng enabled by
checking for dev node existence if that is consistance.  However we can't
probably depend on the linux config being present and parse-able.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 12511] rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably
  2020-01-28 15:37 [Buildroot] [Bug 12511] New: rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably bugzilla at busybox.net
  2020-01-28 16:03 ` [Buildroot] [Bug 12511] " bugzilla at busybox.net
  2020-01-28 18:31 ` bugzilla at busybox.net
@ 2020-02-05 18:27 ` bugzilla at busybox.net
  2020-02-06 13:36 ` bugzilla at busybox.net
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2020-02-05 18:27 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=12511

--- Comment #2 from Matt Weber <matthew.weber@rockwellcollins.com> ---
Would you mind testing this proposed fix?
http://patchwork.ozlabs.org/patch/1233971/

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 12511] rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably
  2020-01-28 15:37 [Buildroot] [Bug 12511] New: rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably bugzilla at busybox.net
                   ` (2 preceding siblings ...)
  2020-02-05 18:27 ` bugzilla at busybox.net
@ 2020-02-06 13:36 ` bugzilla at busybox.net
  2020-02-11 15:02 ` bugzilla at busybox.net
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2020-02-06 13:36 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=12511

--- Comment #3 from Axel Voitier <axel.voitier@gmail.com> ---
(In reply to Matt Weber from comment #2)

I can confirm it works in my case.
Although, I am not using systemd, so I cannot test that part of the patch.


Cheers,
Axel

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 12511] rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably
  2020-01-28 15:37 [Buildroot] [Bug 12511] New: rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably bugzilla at busybox.net
                   ` (3 preceding siblings ...)
  2020-02-06 13:36 ` bugzilla at busybox.net
@ 2020-02-11 15:02 ` bugzilla at busybox.net
  2020-02-13 17:10 ` bugzilla at busybox.net
  2021-09-29 20:16 ` bugzilla
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2020-02-11 15:02 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=12511

--- Comment #4 from Matt Weber <matthew.weber@rockwellcollins.com> ---
Looks like there is a updated rng-tools version.  Would you mind testing this
patch without the proposed jitterentropy selection changes I previously
proposed?

http://patchwork.ozlabs.org/patch/1235396/

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 12511] rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably
  2020-01-28 15:37 [Buildroot] [Bug 12511] New: rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably bugzilla at busybox.net
                   ` (4 preceding siblings ...)
  2020-02-11 15:02 ` bugzilla at busybox.net
@ 2020-02-13 17:10 ` bugzilla at busybox.net
  2021-09-29 20:16 ` bugzilla
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla at busybox.net @ 2020-02-13 17:10 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=12511

--- Comment #5 from Matt Weber <matthew.weber@rockwellcollins.com> ---
Yegor noted in the http://patchwork.ozlabs.org/patch/1233971/ thread that the
bump of rng-tools made the startup cost of having jitterentropy as a source
better. 

Axel, I'll let you confirm if you feel this did enough or if we still need to
breakout providing the user an option.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [Bug 12511] rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably
  2020-01-28 15:37 [Buildroot] [Bug 12511] New: rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably bugzilla at busybox.net
                   ` (5 preceding siblings ...)
  2020-02-13 17:10 ` bugzilla at busybox.net
@ 2021-09-29 20:16 ` bugzilla
  6 siblings, 0 replies; 8+ messages in thread
From: bugzilla @ 2021-09-29 20:16 UTC (permalink / raw)
  To: buildroot

https://bugs.busybox.net/show_bug.cgi?id=12511

--- Comment #6 from Scott Bartolett <sbartolett@thorlabs.com> ---
Has this issue been resolved.  I am using Buildroot-2021.08 and targeting the
RPI Zero with no input device.  I need a minimal system for fast boot and so
have removed BusyBox (set Init System to None) and using devtmpfs + mdev. I
have tried all combinations of HW_RANDOM in the kernel and rng-tools,
Jitternentropy Library and NIST Entropy Beacon support.  In all cases there is
a very long delay before finally getting the random: crng init done message.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-29 20:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28 15:37 [Buildroot] [Bug 12511] New: rng-tools has forced dependency on jitterentropy-library ; It slows boot considerably bugzilla at busybox.net
2020-01-28 16:03 ` [Buildroot] [Bug 12511] " bugzilla at busybox.net
2020-01-28 18:31 ` bugzilla at busybox.net
2020-02-05 18:27 ` bugzilla at busybox.net
2020-02-06 13:36 ` bugzilla at busybox.net
2020-02-11 15:02 ` bugzilla at busybox.net
2020-02-13 17:10 ` bugzilla at busybox.net
2021-09-29 20:16 ` bugzilla

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.