Re: [PATCH 1/2] random32: make prandom_u32() output unpredictable

From
Sedat Dilek <hidden>
Date
2020-09-01 08:46:33
Also in
lkml
Reply to
Willy Tarreau, 2020-09-01
On Tue, Sep 1, 2020 at 10:39 AM Willy Tarreau [off-list ref] wrote:
On Tue, Sep 01, 2020 at 10:33:40AM +0200, Yann Ylavic wrote:
quoted
On Tue, Sep 1, 2020 at 8:45 AM Willy Tarreau [off-list ref] wrote:
quoted

+/*
+ *     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.
Thanks for offering a new patchset, Willy.

Will you push the updated patchset to your prandom Git - for easy fetching?

Thanks.

- Sedat -

[1] https://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/prandom.git/
Thread (15 messages) 15 messages, 6 authors, last reply 2020-09-01
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help