[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y4fx87227hQfLrFq@zx2c4.com>
Date: Thu, 1 Dec 2022 01:14:43 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: David Laight <David.Laight@...LAB.COM>
Cc: 'Thomas Gleixner' <tglx@...utronix.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"patches@...ts.linux.dev" <patches@...ts.linux.dev>,
"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Adhemerval Zanella Netto <adhemerval.zanella@...aro.org>,
Carlos O'Donell <carlos@...hat.com>,
Florian Weimer <fweimer@...hat.com>,
Arnd Bergmann <arnd@...db.de>,
Christian Brauner <brauner@...nel.org>
Subject: Re: [PATCH v10 1/4] random: add vgetrandom_alloc() syscall
On Wed, Nov 30, 2022 at 10:39:38PM +0000, David Laight wrote:
> > struct vgetrandom_state {
> > union {
> > struct {
> > u8 batch[CHACHA_BLOCK_SIZE * 3 / 2];
> > u32 key[CHACHA_KEY_SIZE / sizeof(u32)];
> > };
> > u8 batch_key[CHACHA_BLOCK_SIZE * 2];
> > };
> > unsigned long generation;
> > u8 pos;
> > bool in_use;
> > };
> >
> > Plus some kernel doc which explains what this is about.
>
> That structure looks horrid - especially for something shared
> between entities.
> The 'unsigned long' should be either u32 or u64.
This struct isn't shared. It's used only by user mode code.
There may well be other issues with that long, though.
Jason
Powered by blists - more mailing lists