Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1783542pxk; Tue, 1 Sep 2020 07:44:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyb4QaLdFd488NS43Ck6o//0GnQ757cc4EaaS7zMB/851nfU9DYeE4IQzocwoScAI0zbsZr X-Received: by 2002:a17:907:70cb:: with SMTP id yk11mr1713814ejb.312.1598971440574; Tue, 01 Sep 2020 07:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598971440; cv=none; d=google.com; s=arc-20160816; b=WSIWGZrLkHVzbGc3semKZmIEQlYUiqsyRjg9LhN6q5r4xzoCkaOl90yXni4cg89eMK +04gUAy1asXWMRIRPIzxndNpTaKYsOHse1ZLULFQ4MRcnG0foEYALzMtOskMEBQJK8e4 z+OzsVHhJE3VTfAhcsXm+b1TMI0vrnQbZFHe2xqvrtZRDBBMW/lFW/Wjio3OD49e94bv O8H1sX0fIC7UiRZ+n2CJoNJ1lYfxfQugXxYAiqTZo/9SX/PAjR3mmId4nrjhmDFlFk+g y2YfjVUdL3BD5cTz6RwgMadeYD6BkkMOoh4UvX9lAWg8jJVgOLOxSYRiyI8HodLiV7KT 9xNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=sZhvalbA03rUwegYGv+Cay08wKnFHq0gcapj8Z9U2kk=; b=KBenK9QcT9elSeXkBlRR7XXmc0vn9SzGWn5GFIPVxDZqRU0ehY0vusubPns9pkyfk8 QqRgK2w0Sp0O5urNCP0jgqtCMYnY5HUcb08JtUMqgxISAFKOEjyT8iwWL/kLkaf9lEK7 SKjQXxZpZ6byIGOTW09A5hsJuX8DZUuuOkgcwGAeL1G1DOr9JScZlGyUN0vk1l+3aCa/ vBXiafZYyrHTx2E78aiTr5BhxklqYJ2Rp3rwBf0GG0mfcPdRjznnttX51pSajTST9IsO ZpCrwtScGt8RnwZI03joRgV5vQBzPxD+WS3Ab27t4VB4C20+mhZbJDHiWfF1ok/NY0Vj sQfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Y/SqwzUN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si680985edv.544.2020.09.01.07.43.36; Tue, 01 Sep 2020 07:44:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Y/SqwzUN"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728337AbgIAOmw (ORCPT + 99 others); Tue, 1 Sep 2020 10:42:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728242AbgIAOl2 (ORCPT ); Tue, 1 Sep 2020 10:41:28 -0400 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE52BC061244; Tue, 1 Sep 2020 07:41:27 -0700 (PDT) Received: by mail-oi1-x242.google.com with SMTP id j21so1336537oii.10; Tue, 01 Sep 2020 07:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=sZhvalbA03rUwegYGv+Cay08wKnFHq0gcapj8Z9U2kk=; b=Y/SqwzUN1T5jUMi6cZ2ZuDXFCwQ9pIW40bV/unURxBXPwk7DRwOLaHDwtTXPzup9gL cEFKY7SCHTeJimhPAs3bFuPsn0kDmnDHqJqlzU9FZmxXnMBjVPM//99pbmwwqN6oIWte cPVMbo+bJSoElNYuopQ8bm3qvB88PXV5tK4HvcEMtbO3qu1BW8WHnx9BmeYzDwOW94IC ce00MEsUDYw8friyEmXWOpscVEu6BASNFxHjNF7w/Je9hjg36WLddNLUiz4ApumVkjXB JCgKn4rBc2l++lCHpIQKhu6u/KNpjBU6MIMXDIe6asHbk3XQ6DA03spR28BYEr5LsOT7 Vn1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=sZhvalbA03rUwegYGv+Cay08wKnFHq0gcapj8Z9U2kk=; b=iWSNWnBFYOKBddw/tSz7QbMmjI3FiAZAfTBljY5JkN2rMNP4lzxmgnEu0fmGm51YxI B5723LYRGFerK1n4bszVMYsb906SpdGa6TduhAnM/iHp7douK7d8pyDMEu1uaH6xTliY tnTlk1HRTlnitzdEM9XAKHRvbl+73FEP1uZUujzXbxzvVCwJZRlU3zJDopVGGitGwKTO C+oO/HDs9N/G5ybi9qyrgz/cH5vXZc/4scLBbtHhMcbPtKiDhsDE2IIcicRzvhThY+QG o6o2cOCvBT7rwhxwj6k1oQFtavqgK0ImIIgiHSEmL6zkRpdmH/6bwUfCfR+KS0jnFV1w lrpw== X-Gm-Message-State: AOAM531QHxhHXjvu7r+nYInNKQ9B3m6Z1H3FqOh/4YY/WLI/1J495FME 9krJuJ9kFmcPc/fvqc/VjcpoyUS/E//KCnjgBKVNg8HMbL0FtQ== X-Received: by 2002:aca:d409:: with SMTP id l9mr1255941oig.70.1598971287129; Tue, 01 Sep 2020 07:41:27 -0700 (PDT) MIME-Version: 1.0 References: <20200901064302.849-1-w@1wt.eu> In-Reply-To: <20200901064302.849-1-w@1wt.eu> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Tue, 1 Sep 2020 16:41:13 +0200 Message-ID: Subject: Re: [PATCH 0/2] prandom_u32: make output less predictable To: Willy Tarreau Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, George Spelvin , Amit Klein , Eric Dumazet , "Jason A. Donenfeld" , Andy Lutomirski , Kees Cook , Thomas Gleixner , Peter Zijlstra , Linus Torvalds , tytso@mit.edu, Florian Westphal , Marc Plumb Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 1, 2020 at 8:43 AM Willy Tarreau wrote: > > 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 > Cc: Amit Klein > Cc: Eric Dumazet > Cc: "Jason A. Donenfeld" > Cc: Andy Lutomirski > Cc: Kees Cook > Cc: Thomas Gleixner > Cc: Peter Zijlstra > Cc: Linus Torvalds > Cc: tytso@mit.edu > Cc: Florian Westphal > Cc: Marc Plumb > Cc: Sedat Dilek > I have tested with the patchset from [1]. ( Later I saw, you dropped "WIP: tcp: reuse incoming skb hash in tcp_conn_request()". ) - Sedat - https://git.kernel.org/pub/scm/linux/kernel/git/wtarreau/prandom.git/log/?h=20200901-siphash-noise > -- > 2.28.0