From: Adrian Bunk <bunk@stusta.de>
To: Mikko Rapeli <mikko.rapeli@bmw.de>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 2/2] openssh: usable sshd depends on rngd from rng-tools
Date: Wed, 8 May 2019 17:07:08 +0300 [thread overview]
Message-ID: <20190508140708.GC25917@localhost> (raw)
In-Reply-To: <1557321969-28686-2-git-send-email-mikko.rapeli@bmw.de>
On Wed, May 08, 2019 at 04:26:09PM +0300, Mikko Rapeli wrote:
> Since openssl 1.1.1 and openssh which uses it, sshd
> startup is delayed. The delays range from few seconds
> to minutes and even to hours. The delays are visible
> in host keys generation and when sshd process is started
> in response to incoming TCP connection but is failing
> to provide SSH version string and clients or tests time out.
>
> In all cases traces show that sshd is waiting for getentropy()
> system call to return from Linux kernel, which returns only
> after kernel side random number pool is initialized. The pool
> is initialized via various entropy source which may be
> missing on embedded development boards or via rngd from
> rng-tools package from userspace. HW random number generation
> and kernel support help but rngd is till needed to feed that data
> back to the Linux kernel.
>
> Example from an NXP imx8 board shows that kernel random number pool
> initialization can take over 400 seconds without rngd,
> and with rngd it is initialized at around 4 seconds after boot.
> The completion of initialization is visible in kernel dmesg with line
> "random: crng init done".
>...
> --- a/meta/recipes-connectivity/openssh/openssh_7.9p1.bb
> +++ b/meta/recipes-connectivity/openssh/openssh_7.9p1.bb
> @@ -148,6 +148,7 @@ FILES_${PN}-keygen = "${bindir}/ssh-keygen"
>
> RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
> RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}"
> +RDEPENDS_${PN}-sshd += "rng-tools"
>...
This should only be an RRECOMMENDS so that people can opt out of it.
E.g. CONFIG_RANDOM_TRUST_CPU in the kernel can solve the same
problem without using rng-tools on some platforms.
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
next prev parent reply other threads:[~2019-05-08 14:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 13:26 [PATCH 1/2] eoqa: use bash to execute SDK test commands Mikko Rapeli
2019-05-08 13:26 ` [PATCH 2/2] openssh: usable sshd depends on rngd from rng-tools Mikko Rapeli
2019-05-08 14:07 ` Adrian Bunk [this message]
2019-05-08 14:22 ` Mikko.Rapeli
2019-05-08 14:38 ` Rasmus Villemoes
2019-05-10 12:18 ` Burton, Ross
2019-05-10 13:15 ` Mikko.Rapeli
2019-05-10 13:23 ` Bruce Ashfield
2019-05-08 15:50 ` Mark Hatle
2019-05-09 7:00 ` Mikko.Rapeli
2019-05-08 13:41 ` [PATCH 1/2] eoqa: use bash to execute SDK test commands Joshua Watt
2019-05-08 13:46 ` Mikko.Rapeli
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=20190508140708.GC25917@localhost \
--to=bunk@stusta.de \
--cc=mikko.rapeli@bmw.de \
--cc=openembedded-core@lists.openembedded.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox