View previous topic :: View next topic |
Author |
Message |
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Sun May 27, 2018 12:22 pm Post subject: kernel 4.16: random crng hangs boot; symptom: wpa_supplicant |
|
|
Hi all,
I upgraded kernel from 4.14.15 to 4.16.12. All fine but wpa_supplicant. It hangs between 20~70 seconds on first startup at boot (runlevel default). See pastebin for complete log. Hang happens between these two lines: (delay here is 35 seconds)
snipped of log: | 1527422625.852320: wlp1s0: Setting scan request: 0.100000 sec
1527422700.196846: ENGINE: Loading dynamic engine |
/etc/conf.d/wpa_supplicant: | # conf.d file for wpa_supplicant
# uncomment this if wpa_supplicant starts up before your network interface
# is ready and it causes issues
# rc_want="dev-settle"
# Please check man 8 wpa_supplicant for more information about the options
# wpa_supplicant accepts.
#
wpa_supplicant_args="-dd -t -f /tmp/wpa_foo.log" |
/etc/wpa_supplicant/wpa_supplicant.conf: | ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
network={
ssid="hmth"
scan_ssid=1
key_mgmt=WPA-PSK
psk=<secret>
}
network={
ssid="WLAN-573772"
scan_ssid=1
key_mgmt=WPA-PSK
psk=<secret>
}
} |
Anyone any ideas? _________________ hear hear
Last edited by geki on Mon May 28, 2018 7:30 am; edited 1 time in total |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
Posted: Mon May 28, 2018 7:28 am Post subject: kernel 4.16.12: random crng hangs boot process |
|
|
wpa_supplicant is just the symptom. AFAIU it currently, the kernel driver random hangs seeding /dev/random (and the like?) until dmesg message "random: crng init done" appears[0]. To solve this, one should merge sys-apps/rng-tools and add rngd to sysinit boot level to utilize hardware rng. eudev and others need it, too, though they do not hang the boot process. Though, my sandybridge cpus do not have the rdrand feature. There seems to be some sandybridge cpus without that hardware rng feature.
You see something like this:
Code: | # dmesg |grep random
[ 0.988144] random: fast init done
[ 1.670544] random: dd: uninitialized urandom read (512 bytes read)
[ 1.675143] random: mktemp: uninitialized urandom read (10 bytes read)
[ 2.415934] random: salt-master: uninitialized urandom read (32 bytes read)
[ 61.559274] urandom_read: 1 callbacks suppressed
[ 61.559276] random: ddclient: uninitialized urandom read (4 bytes read)
[ 120.910490] random: apache2: uninitialized urandom read (8 bytes read)
[ 120.910505] random: apache2: uninitialized urandom read (8 bytes read)
[ 120.910513] random: apache2: uninitialized urandom read (8 bytes read)
[ 121.163689] random: crng init done
[ 121.163692] random: 2 urandom warning(s) missed due to ratelimiting |
Any ideas? I will dig further... A ha, just found [1]. So, I have to be security concerned but fixes hang for old cpus without hardware rng, it seems.
Good fix is [0]. Enable your specific hardware rng with rngd, not CAAM. Bad fix is revert [1].
[0] https://www.toradex.com/community/questions/18861/random-number-generator-hangs-for-a-long-time.html
[1] https://unix.stackexchange.com/questions/442698/when-i-log-in-it-hangs-until-crng-init-done _________________ hear hear |
|
Back to top |
|
|
geki Advocate
Joined: 13 May 2004 Posts: 2387 Location: Germania
|
|
Back to top |
|
|
IsisTheDamned n00b
Joined: 29 Sep 2004 Posts: 16
|
Posted: Mon Jul 09, 2018 10:36 am Post subject: |
|
|
had the same issue on my machine w/ 4.14.52
I noticed that hammering your keyboard gets you started faster
fixed the problem by installing sys-apps/rng-tools and adding rngd to the default runlevel like this:
Code: |
# emerge sys-apps/rng-tools
# rc-update add rngd default
|
|
|
Back to top |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5947
|
Posted: Mon Jul 09, 2018 6:53 pm Post subject: |
|
|
I had a similar delay recently with using lightdm, installing haveged is another option. _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
|
giro83 n00b
Joined: 24 Aug 2019 Posts: 2
|
Posted: Sat Aug 24, 2019 10:46 pm Post subject: |
|
|
IsisTheDamned wrote: | had the same issue on my machine w/ 4.14.52
I noticed that hammering your keyboard gets you started faster
fixed the problem by installing sys-apps/rng-tools and adding rngd to the default runlevel like this:
Code: |
# emerge sys-apps/rng-tools
# rc-update add rngd default
|
|
I had the same issue, and your suggestion fixed it. But adding the service to 'default' was not sufficient, as it would not start in time. I had to add it to 'boot' instead. |
|
Back to top |
|
|
toralf Developer
Joined: 01 Feb 2004 Posts: 3942 Location: Hamburg
|
Posted: Sun Aug 25, 2019 1:25 pm Post subject: |
|
|
giro83 wrote: | I had to add it to 'boot' instead. | Yep, that's advised. BTW there're few more rng helper packages: Code: | timer_entropyd audio-entropyd haveged | worth to be used. |
|
Back to top |
|
|
|