From: Johannes Berg <johannes@sipsolutions.net>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>,
linux-um@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org, Anton Ivanov <anton.ivanov@cambridgegreys.com>
Subject: Re: [PATCH v4] um: seed rng using host OS rng
Date: Sun, 17 Jul 2022 12:51:58 +0200 [thread overview]
Message-ID: <3a03bc428ebc5741494a3e05ee98f55be2bdd3ec.camel@sipsolutions.net> (raw)
In-Reply-To: <20220717105051.1539173-1-Jason@zx2c4.com>
On Sun, 2022-07-17 at 12:50 +0200, Jason A. Donenfeld wrote:
> UML generally does not provide access to special CPU instructions like
> RDRAND, and execution tends to be rather deterministic, with no real
> hardware interrupts, making good randomness really very hard, if not
> all together impossible. Not only is this a security eyebrow raiser, but
> it's also quite annoying when trying to do various pieces of UML-based
> automation that takes a long time to boot, if ever.
>
> Fix this by trivially calling getrandom() in the host and using that
> seed as "bootloader randomness", which initializes the rng immediately
> at UML boot.
>
> The old behavior can be restored the same way as on any other arch, by
> way of CONFIG_TRUST_BOOTLOADER_RANDOMNESS=n or
> random.trust_bootloader=0. So seen from that perspective, this just
> makes UML act like other archs, which is positive in its own right.
>
> Additionally, wire up arch_get_random_{int,long}() in the same way, so
> that reseeds can also make use of the host RNG, controllable by
> CONFIG_TRUST_CPU_RANDOMNESS and random.trust_cpu, per usual.
>
> Cc: stable@vger.kernel.org
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> Johannes - I need to take this through random.git, because it relies on
> some other changes living there. Is that okay with you? -Jason
Sure, go ahead, thanks for doing this work!
> Changes v3->v4:
> - Don't include os.h, per Johannes' suggestion.
Thanks.
Acked-by: Johannes Berg <johannes@sipsolutions.net>
johannes
next prev parent reply other threads:[~2022-07-17 10:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 23:27 [PATCH] um: seed rng using host OS rng Jason A. Donenfeld
2022-07-13 6:58 ` Anton Ivanov
2022-07-13 7:03 ` Johannes Berg
2022-07-13 7:05 ` Johannes Berg
2022-07-13 9:53 ` Jason A. Donenfeld
2022-07-13 9:58 ` [PATCH v2] " Jason A. Donenfeld
2022-07-17 8:46 ` [PATCH v3] " Jason A. Donenfeld
2022-07-17 10:50 ` [PATCH v4] " Jason A. Donenfeld
2022-07-17 10:51 ` Johannes Berg [this message]
2022-07-13 7:06 ` [PATCH] " Anton Ivanov
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=3a03bc428ebc5741494a3e05ee98f55be2bdd3ec.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=Jason@zx2c4.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=stable@vger.kernel.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