Bug 2128954
| Summary: | rngd from rng-tools-6.15-4.fc37 started, stopped, started, and failed when booting | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Matt Fagnani <matt.fagnani> |
| Component: | rng-tools | Assignee: | Vladislav Dronov (Fedora) <vdronoff+fedora> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 37 | CC: | jaromir.capik, jgarzik, lewk, vdronoff+fedora, vdronov |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-12-30 16:07:49 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Matt Fagnani
2022-09-22 05:36:13 UTC
Hi, Matt, Thank you for a report. Let me provide a research here. These are upstream commits for rng-tools versions: rng-tools-6.15-3 - 172bf0e3 rng-tools-6.15-4 - 6dcc9ec2 Previously jitter source was waiting infinitely if it could not gather enough entropy from system events to start. Usually this is not a problem, since systems have another sources of entropy. In your case: Sep 22 01:10:01 rngd[871]: Initializing available sources Sep 22 01:10:01 rngd[871]: [hwrng ]: Initialization Failed Sep 22 01:10:01 rngd[871]: [rdrand]: Initialization Failed Sep 22 01:10:01 rngd[871]: [jitter]: Initializing AES buffer Sep 22 01:10:08 rngd[871]: [jitter]: Enabling JITTER rng support Sep 22 01:10:08 rngd[871]: [jitter]: Initialized Sep 22 01:10:08 rngd[871]: [rtlsdr]: Initialization Failed you have only jitter as a source of entropy. These commits added a timeout for jitter source so it does not starts up infinitely: c29424f10a0d Adjust jitterentropy library to timeout/fail on long delay 6e14b8bd491b rngd_jitter: make timeout configurable Your log says: Sep 21 23:06:42 rngd[872]: Initializing available sources Sep 21 23:06:42 rngd[872]: [hwrng ]: Initialization Failed Sep 21 23:06:42 rngd[872]: [rdrand]: Initialization Failed Sep 21 23:06:42 rngd[872]: [jitter]: JITTER timeout set to 5 sec <<< THIS Sep 21 23:06:42 rngd[872]: [jitter]: Initializing AES buffer Sep 21 23:06:47 rngd[872]: [jitter]: Unable to obtain AES key, disabling JITTER source Sep 21 23:06:47 rngd[872]: [jitter]: Initialization Failed Sep 21 23:06:47 rngd[872]: [rtlsdr]: Initialization Failed Sep 21 23:06:47 rngd[872]: Can't open any entropy source that jitter source couldn't initialize in 5 seconds (the default timeout), there was not enough random event happening in your system. So rngd has quit, as there were no sources. Please use the following switch (in /etc/sysconfig/rngd) to increase jitter init timeout on your system (a value is in seconds): -O jitter:timeout:$RNGD_JITTER_TIMEOUT PLEASE NOTE, as gathering jitter is an inherently random process there is no certain timeout to 100% guarantee that jitter source gather enough randomness during this timeout. A suggestion is to set a high timeout (like 240) to simulate infinite timeout of a previous rngd version. HTH. I changed RNGD_ARGS="-x pkcs11 -x nist -D daemon:daemon -O jitter:timeout:240" in /etc/sysconfig/rngd. I restarted rngd from rng-tools-6.15-4.fc37 or rebooted a few times. rngd started normally after 6-8 seconds based on the times in the journal such as the following. Dec 27 14:09:02 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=rngd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' Dec 27 14:09:02 rngd[889]: Disabling 7: PKCS11 Entropy generator (pkcs11) Dec 27 14:09:02 rngd[889]: Disabling 5: NIST Network Entropy Beacon (nist) Dec 27 14:09:02 rngd[889]: Initializing available sources Dec 27 14:09:02 rngd[889]: [hwrng ]: Initialization Failed Dec 27 14:09:02 rngd[889]: [rdrand]: Initialization Failed Dec 27 14:09:02 rngd[889]: [jitter]: JITTER timeout set to 240 sec Dec 27 14:09:02 rngd[889]: [jitter]: Initializing AES buffer Dec 27 14:09:02 systemd[1]: Started rngd.service - Hardware RNG Entropy Gatherer Daemon. Dec 27 14:09:09 rngd[889]: [jitter]: Enabling JITTER rng support Dec 27 14:09:09 rngd[889]: [jitter]: Initialized Dec 27 14:09:09 rngd[889]: [rtlsdr]: Initialization Failed Dec 27 14:09:09 rngd[889]: Process privileges have been dropped to 2:2 Thanks. The CPU is an AMD A10-9620P which has the RDRAND instruction/RNG. I read that the kernel was changed not to show the availability of RDRAND on some older AMD CPUs https://lore.kernel.org/lkml/776cb5c2d33e7fd0d2893904724c0e52b394f24a.1565817448.git.thomas.lendacky@amd.com/ So that might be related to why jitter was the only source of entropy on my system. thanks for the link, Matt, interesting read. so you may try "rdrand=force" kernel parameter to disable this rdrand-hiding behavior. with that, i believe, this bz can be closed, please, tell if not. The rngd startup default timeout length might still need to be increased upstream or downstream so that others with similar systems don't have this problem. Unless one looks for this problem with systemctl or journalctl, they might not realize that rngd is failing to start each time since there's no normal notification of it happening. I booted with rdrand=force on the kernel command line. RDRAND started correctly in the rngd journal messages, and rngd still took 7-9 seconds to start with RDRAND enabled. Dec 27 21:41:57 systemd[1]: Started rngd.service - Hardware RNG Entropy Gatherer Daemon. Dec 27 21:41:57 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=rngd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success' Dec 27 21:41:57 rngd[878]: Disabling 7: PKCS11 Entropy generator (pkcs11) Dec 27 21:41:57 rngd[878]: Disabling 5: NIST Network Entropy Beacon (nist) Dec 27 21:41:57 rngd[878]: Initializing available sources Dec 27 21:41:57 rngd[878]: [hwrng ]: Initialization Failed Dec 27 21:41:57 rngd[878]: [rdrand]: Enabling RDRAND rng support Dec 27 21:41:57 rngd[878]: [rdrand]: Initialized Dec 27 21:41:57 rngd[878]: [jitter]: JITTER timeout set to 240 sec Dec 27 21:41:57 rngd[878]: [jitter]: Initializing AES buffer Dec 27 21:42:04 rngd[878]: [jitter]: Enabling JITTER rng support Dec 27 21:42:04 rngd[878]: [jitter]: Initialized Dec 27 21:42:04 rngd[878]: [rtlsdr]: Initialization Failed Dec 27 21:42:04 rngd[878]: Process privileges have been dropped to 2:2 Thanks. (In reply to Matt Fagnani from comment #4) > I booted with rdrand=force on the > kernel command line. RDRAND started correctly in the rngd journal messages, great to hear this. > and rngd still took 7-9 seconds to start with RDRAND enabled. jitter source does not use rdrand, it is a different independent source. so now as you have rdrand you may want to disable jitter (and rtlsdr) sources so they do not slow down rngd's startup. with: -x jitter -x rtlsdr i believe i can close this, please reopen if not. |