FS#63738 - [Systemd 243.0-1] systemd-random-seed.service
Attached to Project:
Arch Linux
Opened by Torus (T0t0) - Thursday, 12 September 2019, 16:08 GMT
Last edited by freswa (frederik) - Saturday, 22 February 2020, 16:09 GMT
Opened by Torus (T0t0) - Thursday, 12 September 2019, 16:08 GMT
Last edited by freswa (frederik) - Saturday, 22 February 2020, 16:09 GMT
|
Details
Description:
The systemd-random-seed.service service takes a long time to launch. Additional info: * package version(s): Systemd 243.0-1 * config and/or log files etc: desktop systemd-random-seed[263]: Kernel entropy pool is not initialized yet, waiting until it is. Steps to reproduce: When installing the Systemd 243.0-1 package. |
This task depends upon
Closed by freswa (frederik)
Saturday, 22 February 2020, 16:09 GMT
Reason for closing: Not a bug
Additional comments about closing: https://github.com/systemd/systemd/issue s/13602#issuecomment-539486178
Saturday, 22 February 2020, 16:09 GMT
Reason for closing: Not a bug
Additional comments about closing: https://github.com/systemd/systemd/issue s/13602#issuecomment-539486178
[1] https://github.com/systemd/systemd/commit/26ded55709947d936634f1de0f43dcf88f594621
Edit:
Options to seed the entropy pool:
If the system uses systemd-boot that can use a random-seed to seed the entropy-pool
haveged
the kernel parameter random.trust_cpu=on if the CPU supports RDRAND
Do you have an idea to reduce the start-up time of the service?
Bootloader: grub
CPU: Intel i5-4210M 4th Gen Core Processor
For haveged see [1]
For the kernel parameter see [2] for how to set it and [3] for documentation on what random.trust_cpu=on does
[1] https://wiki.archlinux.org/index.php/Haveged
[2] https://wiki.archlinux.org/index.php/Kernel_parameters
[3] https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
However, are there no security issues to use it?
Thank you.
haveged is an alternative if you trust that more. rngd [1] supports other hardware RNGs if you perfer that.
[1] https://wiki.archlinux.org/index.php/Rng-tools
Start jobs always run at boot time for 'Load/Save Random Seed' and remounting of my drives stall at boot time for about 5 seconds, or so. This behavior only happens in 243.0-1.
`systemd-analyze blame` reflects this change with 'systemd-random-seed.service' being the last service to launch (at 8.758s), whereas before the service was one of the first launched (at around 5-6ms).
What about the other options that have been mentioned?
Are you expecting upstream to revert this behavior? Have you contacted upstream about the issue?
I'm using an intel chip which does have the flag 'rdrand' in /proc/cpuinfo, so I assume it is supported.
I have not tried Haveged. Nor have I contacted upstream. I will look into both, though. Thanks
Anyways, I attached 3 files.
One booting Systemd-243.0-1 with parameter set.
One booting Systemd-243.0-1 NO parameter set.
And one file showing what a 'normal' boot looks like running the downgraded systemd-242.84.2 NO parameter set.
Thanks again.
Systemd243NoParameterSet.txt (205.1 KiB)
OLDSytemd242NoParameter.txt (209.3 KiB)
After a discussion on irc, I was advised not to enable the `random.trust_cpu=on` option because of the security risk. Hopefully a viable solution will be found quickly by the systemd devs.
It's better to wait for this one.
Please also link to the upstream systemd bug report.
For the discussion on irc, the entropy created by intel CPU is not sure. There is a risk of decryption apparently. See on the net for more details.
On the upstream bug report my point is for the systemd developers to find a viable
solution the developers have to be aware of the issue to which a solution is expected.
As per the commit message from [1] the blocking until the random pool is initialized
is a deliberate change. Without an upstream change and without using RDRAND. I have
already suggested two other methods to add entropy to the pool. As an alternative
the service could be disabled which in itself may be a security risk. [2] covers
more on the systemd random seed use in v243.
[1] https://github.com/systemd/systemd/commit/26ded55709947d936634f1de0f43dcf88f594621
[2] https://systemd.io/RANDOM_SEEDS
https://github.com/systemd/systemd/issues/13602
The alternatives you offered me are not much better. I'm thinking of Haveged (see the documentation).
Detailed explanation:
https://askubuntu.com/questions/1070433/will-ubuntu-enable-random-trust-cpu-in-the-kernel-and-what-would-be-the-effect
Some more on the subject:
https://wiki.debian.org/BoottimeEntropyStarvation
Can this be closed now? As has now been repeated by upstream this is intended behavior.
the topic can be closed.
Thanks.