[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5648f43d-76e4-4396-b626-411d60657c93@intel.com>
Date: Wed, 21 Feb 2024 15:35:28 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: "Jason A. Donenfeld" <Jason@...c4.com>
Cc: x86@...nel.org, linux-coco@...ts.linux.dev, linux-kernel@...r.kernel.org,
Borislav Petkov <bp@...en8.de>, Daniel P . Berrangé
<berrange@...hat.com>, Dave Hansen <dave.hansen@...ux.intel.com>,
Elena Reshetova <elena.reshetova@...el.com>, "H . Peter Anvin"
<hpa@...or.com>, Ingo Molnar <mingo@...hat.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Theodore Ts'o <tytso@....edu>, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v3] x86/coco: Require seeding RNG with RDRAND on CoCo
systems
On 2/21/24 15:09, Jason A. Donenfeld wrote:
> On Wed, Feb 21, 2024 at 11:47 PM Dave Hansen <dave.hansen@...el.com> wrote:
>> OK, so we're trying to get 256 bits of seed data from RDRAND?
>
> Yes. This fills a 32-byte buffer of longs up with output from
> arch_get_random_longs().
That's what it's doing mechanically, but what's the end goal?
>> But no pattern I could discern. Did you mean something different by
>> "platform drivers"?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/um/kernel/um_arch.c#n413
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/char/random.c#n655
Gotcha.
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/gcc-plugins/latent_entropy_plugin.c#n90
Isn't that one 32 HOST_WIDE_INTs and not 32 bytes? :)
>> If we're going to have arch/x86-specific crud, it would be great to make
>> it obvious and straightforward to those of us simple folk that are
>> familiar with arch/x86 code.
>
> If you insist, I'll stick a local `enum { RANDOM_BYTES_COUNT = 32 }`
> in that function or something. Seems unnecessary to me but if that's
> what you need no problem. Would that suffice? Or a different variable
> name? Or a comment on "what is 32 about?"
"what is 32 about?" would be great. What's the goal, and why is 32
enough to reach that goal?
Powered by blists - more mailing lists