Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1566620pxk; Tue, 1 Sep 2020 01:50:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeQQ/Fgz6VeK+1gqSlI9XVPCm86K3AK+jwq5Fw5+lZ4GfNdbmdVMUHlA7YhGt4MsWsOTmr X-Received: by 2002:a50:8523:: with SMTP id 32mr878749edr.282.1598950211402; Tue, 01 Sep 2020 01:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598950211; cv=none; d=google.com; s=arc-20160816; b=feIFba7HRxs8s5trPcouXKcQBbW8qItNpm6nqjqJ+bqk+mzpCn2IUCda2ad9Xw5sJW S/vITxoOHz+Papj9oLSL2+5+Pxq/REXLRQzF9ao1O/Ra2FpJeFOcIUD8+xMwqckfcc01 BfCCMpFIOiUonxc1QIFi8PAdFP1kB3swo6OV3LafFrN1db/mv88ZFfzkW6P+wbiBMOAa dVBbiLCMKNzMpX1xwbpW5IgH4hxIxZTdom0yRAn6/T4JWZbJMd0KpZ0RckMliGSBA6/p ozjjEt61Z1Hz3f7oSQU7h6mFjs2r9ybgYSI96u0DzCYd46W62f1UG/ozmSwCYprlhRUO x1VA== 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=AGctBs2sDmt4ExjN4cAU8I9Yq9CZgsHUVhDgE0odfdA=; b=XofIzMV+cnMMDBF3zWEPGxTEXQ2w/sPQDDA5rqdxG6SI2/+NvbcU02nka7JZOIjI2V Uv8iA1tSuYa0oHO1uiYsqwCAaWVnky5rdWWwbSmLUkrbHkzLw0l/rhJsJL1JOghn6kFm YjNJlYCFpQq6rnIxdY5NM2lsPpE2J/AawZr9TS+pS7W+7c+TICeq+1j3lKyxebV6lfTk Rg/XZUUCpDWfMrmmucHQXj0aEv+w5id0ng8LSKZ5BS1LKQgJnElYkN4hLWuMghLHT2is Qrxp65uviBoinio93DgV+c38T1pVgoPmaraqZcK2CT21yUjCGxeH3iWOx9YkJRQd0vy4 h2/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JZhdAwXL; 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 do17si295663ejc.744.2020.09.01.01.49.48; Tue, 01 Sep 2020 01:50:11 -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=JZhdAwXL; 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 S1727822AbgIAIqa (ORCPT + 99 others); Tue, 1 Sep 2020 04:46:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726293AbgIAIqa (ORCPT ); Tue, 1 Sep 2020 04:46:30 -0400 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D818BC061244; Tue, 1 Sep 2020 01:46:29 -0700 (PDT) Received: by mail-ot1-x344.google.com with SMTP id 109so508499otv.3; Tue, 01 Sep 2020 01:46:29 -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=AGctBs2sDmt4ExjN4cAU8I9Yq9CZgsHUVhDgE0odfdA=; b=JZhdAwXLEqO1maNzgzV4iNSzNEsdWXMsuq8Diw3KiHENmdAXxVsghAgx+O6xiALh19 oJs/xNEWE2efFDO0TbBhYIkpo6y3JlNi3ubrdWFjdwyqor0fpK/PVtAwW1HUENhn8SAC IspZ4Agdi2UA+OhTLiOCc5Mgh4sETgmKUV3S+gDKZ8DGccYff2LtHY/NNgL4sD47/pj0 WR1I9UpVMfVhPVCsX9ldcPVEgpraD27ORyCtgPpTCWQuHnwqDJmcPBdsRUwlWTgDSCgb T71lBH4KkzC4vi70dIBAR3kVSchhk0wTDcs5yb7ncIPr9mheOcc0heDdjtsjPCxx0LWR aWQQ== 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=AGctBs2sDmt4ExjN4cAU8I9Yq9CZgsHUVhDgE0odfdA=; b=I5SXWOcKvFBAGewDaMPif8HED1s2baNvGDsbLlujK4uxQcA1fXLzWWpRC4isL2Qob8 S1XLqiJ9EMYyI3trivjnlg/7CH2nKBTkWB7AXn78aI/thpHN0QZDfHtlA7tHLr9T//rD x4g8M9QFDEXhWx+Jty1QIK3v/hmQlHCawVbI80GBMlXkezlPpGOZGvBJeHm3gmcrgqU1 Z88J7JqmSuQ1uPAudaJAXpMWELOn8jdmVhWPJsiF4n9FxaPLI5e3Kc3BnnzlwBDJNEZ5 7DhNDp3/iqZzUdIQRKfifAyU5osCf5aOEZJzQGywCBHWxKIRuiotXuOI3RP0Zs1n8YXU 5K7A== X-Gm-Message-State: AOAM531wHaMJnBGkJD6VjaTMo7lTyiPHXvnfVJj9tV5w2yX992RvqQaI iL/sCcXAlu7riJv40WTcKut9Km9sV8qlJniOkps= X-Received: by 2002:a9d:7656:: with SMTP id o22mr600508otl.109.1598949987882; Tue, 01 Sep 2020 01:46:27 -0700 (PDT) MIME-Version: 1.0 References: <20200901064302.849-1-w@1wt.eu> <20200901064302.849-2-w@1wt.eu> <20200901083947.GB901@1wt.eu> In-Reply-To: <20200901083947.GB901@1wt.eu> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Tue, 1 Sep 2020 10:46:16 +0200 Message-ID: Subject: Re: [PATCH 1/2] random32: make prandom_u32() output unpredictable To: Willy Tarreau Cc: Yann Ylavic , linux-kernel@vger.kernel.org, Linux Kernel Network Developers , 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 10:39 AM Willy Tarreau wrote: > > On Tue, Sep 01, 2020 at 10:33:40AM +0200, Yann Ylavic wrote: > > On Tue, Sep 1, 2020 at 8:45 AM Willy Tarreau wrote: > > > > > > +/* > > > + * 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/