lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 21 Feb 2024 18:19:41 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Dave Hansen <dave.hansen@...el.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 Wed, Feb 21, 2024 at 5:55 PM Dave Hansen <dave.hansen@...el.com> wrote:
>
> On 2/21/24 04:32, Jason A. Donenfeld wrote:
> > +__init void cc_random_init(void)
> > +{
> > +     unsigned long rng_seed[32 / sizeof(long)];
>
> My only nit with this is the magic "32".
>
> Why not 16?  Or 64?

32 bytes = 256-bits = what we're targeting. Very normal thing to see
places in the RNG, used all over random.c and lots of platform
drivers. Pretty obvious and straightforward to anyone familiar with
this kind of code. Not the kind of thing you'd want to replace with
some abstracted constant that makes you search.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ