lkml.org 
[lkml]   [2024]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3] x86/coco: Require seeding RNG with RDRAND on CoCo systems
On Wed, Feb 21, 2024 at 11:47 PM Dave Hansen <dave.hansen@intel.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().

> 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
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/gcc-plugins/latent_entropy_plugin.c#n90


> 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?"

Jason

\
 
 \ /
  Last update: 2024-05-27 15:15    [W:0.146 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site