linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@linux.intel.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: x86@kernel.org, linux-coco@lists.linux.dev,
	linux-kernel@vger.kernel.org, "Borislav Petkov" <bp@alien8.de>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Elena Reshetova" <elena.reshetova@intel.com>,
	"H . Peter Anvin" <hpa@zytor.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
	"Theodore Ts'o" <tytso@mit.edu>,
	"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH] x86/coco: Require seeding RNG with RDRAND on CoCo systems
Date: Fri, 9 Feb 2024 21:09:12 -0800	[thread overview]
Message-ID: <ZccE-LzC3uKyxdGa@tassilo> (raw)
In-Reply-To: <20240209164946.4164052-1-Jason@zx2c4.com>


> +	for (i = 0; i < ARRAY_SIZE(rng_seed); i += longs) {
> +		longs = arch_get_random_longs(&rng_seed[i], ARRAY_SIZE(rng_seed) - i);
> +
> +		/*
> +		 * A zero return value means that the guest is under attack,
> +		 * the hardware is broken, or some other mishap has occurred
> +		 * that means the RNG cannot be properly rng_seeded, which also
> +		 * likely means most crypto inside of the CoCo instance will be
> +		 * broken, defeating the purpose of CoCo in the first place. So
> +		 * just panic here because it's absolutely unsafe to continue
> +		 * executing.
> +		 */
> +		BUG_ON(longs == 0);

BUG_ON doesn't necessarily panic. If you want panic, use panic.

-Andi


  reply	other threads:[~2024-02-10  5:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 16:49 [PATCH] x86/coco: Require seeding RNG with RDRAND on CoCo systems Jason A. Donenfeld
2024-02-10  5:09 ` Andi Kleen [this message]
2024-02-23 19:33 ` Tom Lendacky

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=ZccE-LzC3uKyxdGa@tassilo \
    --to=ak@linux.intel.com \
    --cc=Jason@zx2c4.com \
    --cc=berrange@redhat.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=elena.reshetova@intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tytso@mit.edu \
    --cc=x86@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;
as well as URLs for NNTP newsgroup(s).