Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: Sedat Dilek <sedat.dilek@gmail.com>,
	George Spelvin <lkml@sdf.org>, Amit Klein <aksecurity@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	"Jason A. Donenfeld" <Jason@zx2c4.com>,
	Andy Lutomirski <luto@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	tytso@mit.edu, Florian Westphal <fw@strlen.de>,
	Marc Plumb <lkml.mplumb@gmail.com>
Subject: [PATCH 0/2] prandom_u32: make output less predictable
Date: Tue,  1 Sep 2020 08:43:00 +0200	[thread overview]
Message-ID: <20200901064302.849-1-w@1wt.eu> (raw)

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@sdf.org>
Cc: Amit Klein <aksecurity@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: tytso@mit.edu
Cc: Florian Westphal <fw@strlen.de>
Cc: Marc Plumb <lkml.mplumb@gmail.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>

-- 
2.28.0

             reply	other threads:[~2020-09-01  6:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01  6:43 Willy Tarreau [this message]
2020-09-01  6:43 ` [PATCH 1/2] random32: make prandom_u32() output unpredictable Willy Tarreau
2020-09-01  8:33   ` Yann Ylavic
2020-09-01  8:39     ` Willy Tarreau
2020-09-01  8:46       ` Sedat Dilek
2020-09-01  8:56         ` Willy Tarreau
2020-09-01  9:26           ` Sedat Dilek
2020-09-01 13:10   ` David Laight
2020-09-01 13:16     ` Willy Tarreau
     [not found]       ` <CANEQ_+Kuw6cxWRBE6NyXkr=8p3W-1f=o1q91ZESeueEnna9fvw@mail.gmail.com>
2020-09-14 16:16         ` Sedat Dilek
2020-09-14 16:29           ` Willy Tarreau
2020-09-14 16:48             ` Sedat Dilek
2020-09-01  6:43 ` [PATCH 2/2] random32: add noise from network and scheduling activity Willy Tarreau
2020-09-01 10:24   ` Eric Dumazet
2020-09-01 11:57     ` Willy Tarreau
2020-09-01 14:41 ` [PATCH 0/2] prandom_u32: make output less predictable Sedat Dilek
2020-09-01 14:55   ` Willy Tarreau
2020-09-01 15:19     ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200901064302.849-1-w@1wt.eu \
    --to=w@1wt.eu \
    --cc=Jason@zx2c4.com \
    --cc=aksecurity@gmail.com \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml.mplumb@gmail.com \
    --cc=lkml@sdf.org \
    --cc=luto@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=sedat.dilek@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --subject='Re: [PATCH 0/2] prandom_u32: make output less predictable' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).