public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Jon DeVree <nuxi@vault24.org>
Cc: linux-kernel@vger.kernel.org, Jason@zx2c4.com
Subject: Re: [PATCH] random: fix CRNG initialization when random.trust_cpu=1
Date: Fri, 19 Apr 2019 23:35:46 -0400	[thread overview]
Message-ID: <20190420033546.GA5539@mit.edu> (raw)
In-Reply-To: <20190319172846.30741-1-nuxi@vault24.org>

On Tue, Mar 19, 2019 at 01:28:47PM -0400, Jon DeVree wrote:
> When the system boots with random.trust_cpu=1 it doesn't initialize the
> per-NUMA CRNGs because it skips the rest of the CRNG startup code. This
> means that the code from 1e7f583af67b ("random: make /dev/urandom scalable
> for silly userspace programs") is not used when random.trust_cpu=1.
> 
> crash> dmesg | grep random:
> [    0.000000] random: get_random_bytes called from start_kernel+0x94/0x530 with crng_init=0
> [    0.314029] random: crng done (trusting CPU's manufacturer)
> crash> print crng_node_pool
> $6 = (struct crng_state **) 0x0
> 
> After adding the missing call to numa_crng_init() the per-NUMA CRNGs are
> initialized again:
> 
> crash> dmesg | grep random:
> [    0.000000] random: get_random_bytes called from start_kernel+0x94/0x530 with crng_init=0
> [    0.314031] random: crng done (trusting CPU's manufacturer)
> crash> print crng_node_pool
> $1 = (struct crng_state **) 0xffff9a915f4014a0
> 
> The call to invalidate_batched_entropy() was also missing. This is
> important for architectures like PPC and S390 which only have the
> arch_get_random_seed_* functions.
> 
> Fixes: 39a8883a2b98 ("random: add a config option to trust the CPU's hwrng")
> Signed-off-by: Jon DeVree <nuxi@vault24.org>

Thanks, applied.

					- Ted

      reply	other threads:[~2019-04-20  3:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-19 17:28 [PATCH] random: fix CRNG initialization when random.trust_cpu=1 Jon DeVree
2019-04-20  3:35 ` Theodore Ts'o [this message]

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=20190420033546.GA5539@mit.edu \
    --to=tytso@mit.edu \
    --cc=Jason@zx2c4.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuxi@vault24.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