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

From
Willy Tarreau <w@1wt.eu>
Date
2020-09-01 13:19:21
Also in
lkml
Reply to
David Laight, 2020-09-01
On Tue, Sep 01, 2020 at 01:10:18PM +0000, David Laight wrote:
From: Willy Tarreau
quoted
Sent: 01 September 2020 07:43
...
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;
Isn't jiffies likely to be zero here?
I don't know. But do we really care ? I'd personally have been fine
with not even assigning it in this case and leaving whatever was in
the stack in this case, though it could make some static code analyzer
unhappy.

Willy
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