[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200901064302.849-1-w@1wt.eu>
Date: Tue, 1 Sep 2020 08:43:00 +0200
From: Willy Tarreau <w@....eu>
To: linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Cc: Sedat Dilek <sedat.dilek@...il.com>, George Spelvin <lkml@....org>,
Amit Klein <aksecurity@...il.com>,
Eric Dumazet <edumazet@...gle.com>,
"Jason A. Donenfeld" <Jason@...c4.com>,
Andy Lutomirski <luto@...nel.org>,
Kees Cook <keescook@...omium.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>, tytso@....edu,
Florian Westphal <fw@...len.de>,
Marc Plumb <lkml.mplumb@...il.com>
Subject: [PATCH 0/2] prandom_u32: make output less predictable
This is the cleanup of the latest series of prandom_u32 experimentations
consisting in using SipHash instead of Tausworthe to produce the randoms
used by the network stack. The changes to the files were kept minimal,
and the controversial commit that used to take noise from the fast_pool
(f227e3ec3b5c) was reverted. Instead, a dedicated "net_rand_noise" per_cpu
variable is fed from various sources of activities (networking, scheduling)
to perturb the SipHash state using fast, non-trivially predictable data,
instead of keeping it fully deterministic. The goal is essentially to make
any occasional memory leakage or brute-force attempt useless.
The resulting code was verified to be very slightly faster on x86_64 than
what is was with the controversial commit above, though this remains barely
above measurement noise. It was only build-tested on arm & arm64.
George Spelvin (1):
random32: make prandom_u32() output unpredictable
Willy Tarreau (1):
random32: add noise from network and scheduling activity
drivers/char/random.c | 1 -
include/linux/prandom.h | 55 ++++-
kernel/time/timer.c | 9 +-
lib/random32.c | 438 ++++++++++++++++++++++++----------------
net/core/dev.c | 4 +
5 files changed, 326 insertions(+), 181 deletions(-)
Cc: George Spelvin <lkml@....org>
Cc: Amit Klein <aksecurity@...il.com>
Cc: Eric Dumazet <edumazet@...gle.com>
Cc: "Jason A. Donenfeld" <Jason@...c4.com>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Kees Cook <keescook@...omium.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: tytso@....edu
Cc: Florian Westphal <fw@...len.de>
Cc: Marc Plumb <lkml.mplumb@...il.com>
Cc: Sedat Dilek <sedat.dilek@...il.com>
--
2.28.0
Powered by blists - more mailing lists