lkml.org 
[lkml]   [2020]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] random32: make prandom_u32() output unpredictable
On Tue, Sep 01, 2020 at 10:33:40AM +0200, Yann Ylavic wrote:
> On Tue, Sep 1, 2020 at 8:45 AM Willy Tarreau <w@1wt.eu> wrote:
> >
> > +/*
> > + * Generate some initially weak seeding values to allow
> > + * the prandom_u32() engine to be started.
> > + */
> > +static int __init prandom_init_early(void)
> > +{
> > + int i;
> > + unsigned long v0, v1, v2, v3;
> > +
> > + if (!arch_get_random_long(&v0))
> > + v0 = jiffies;
> > + if (!arch_get_random_long(&v1))
> > + v0 = random_get_entropy();
>
> Shouldn't the above be:
> v1 = random_get_entropy();
> ?

Very good catch, many thanks Yann! Now fixed in my local tree.

Willy

\
 
 \ /
  Last update: 2020-09-01 10:40    [W:0.077 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site