lkml.org 
[lkml]   [2022]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-12-01 01:18    [W:0.070 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site