Received: by 10.192.165.148 with SMTP id m20csp3213457imm; Sun, 29 Apr 2018 17:13:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqxXaHGUONUEd67xv6nwcsne5uXLoixVAnjBN+lDD+LJl3PJunNN1kxn5RQJ5wDsMlxNl+q X-Received: by 2002:a17:902:4545:: with SMTP id m63-v6mr10723642pld.268.1525047194385; Sun, 29 Apr 2018 17:13:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525047194; cv=none; d=google.com; s=arc-20160816; b=LjZ9aEBxed2aXwSSNV38rHt5RvDgPVpDRKbX9YisNkQ/gyzv2NaQH8kxLZMotPo2/X n2wB71ecUl1Ou/iddAw2h56sBcaz6XiwC9LXsNe4dSVGhfWZbyBeN5yZzHWYNH30EVic xnF2zsmwZTFys37wV9+L1D6mUfXzRWcgTFkb8YJ9SvEaoOmzLnI384zvgAwJWhnNs3ms lb0dxW0qAcv6Go0hVlY19oucWjPrG5A2iumNcNbW9dQLin2gOshjIbq2W/gLHvM+W9rx 1Plyf4LNRPFjkVBHKKY755Z9UtyFHRyAiwShk4IHM3lnk93DZLD/DN4JHIdOCJZJYPhi 0J5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=XpIL97wmWah9WXz5XbIOPXMqBi89FbtowXxTJOp/01E=; b=tP/N1ATjHrGo8HtQGANWz0d0M8HZSvd5Utv89iREmsufHz3daU6QkdcUmZjobOxemv fzzkRnUDL9j6dIhA0o5YbVeexVxdwL6yzvvkKYXiG44gkR5SiCzIAeWv7W6GFAiEUWhn vGXBXWe1i2uew53IXY93SOQ6TwpjC5NX1lltNllz4cLupZWzMiD+wVIYt3rlPCOu00gd MZg4u0WYYtdyFHCRe7J9so3437VwTHcqfV3Q+L/m4jWef3uZSAOaMm3wXMFiHY/CR2Kg vXw6lB9csnxhyJuQaaKJAvixWJLB6yR5BIVjmld+AHNqP7qlziuu2V/fhg651mCK2wia tN9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=leI74+Vt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i14-v6si5273521pgc.250.2018.04.29.17.13.00; Sun, 29 Apr 2018 17:13:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=leI74+Vt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932104AbeD3ALN (ORCPT + 99 others); Sun, 29 Apr 2018 20:11:13 -0400 Received: from imap.thunk.org ([74.207.234.97]:43524 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932071AbeD3ALJ (ORCPT ); Sun, 29 Apr 2018 20:11:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XpIL97wmWah9WXz5XbIOPXMqBi89FbtowXxTJOp/01E=; b=leI74+VtCgc6/kvp3nBjJf10Yu Kf89+sK+ZmfoYI0FCUyoTpVOV4odSuhiyZmefFNOQhDxRXvv/8XHNUwdk08apNOKcCEKHeG3lp1A5 U0VcuC/A/fbk1UsEZiCuuJxSQvqCZXz+mt8PvSt9rMsKYvHntfpVGA0/rGFKQCrhsnTc=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1fCwPL-0006JZ-Tu; Mon, 30 Apr 2018 00:11:07 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 1D3257A0158; Sun, 29 Apr 2018 20:11:07 -0400 (EDT) Date: Sun, 29 Apr 2018 20:11:07 -0400 From: "Theodore Y. Ts'o" To: Sultan Alsawaf Cc: "Jason A. Donenfeld" , Pavel Machek , LKML , Jann Horn Subject: Re: Linux messages full of `random: get_random_u32 called from` Message-ID: <20180430001106.GS5965@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Sultan Alsawaf , "Jason A. Donenfeld" , Pavel Machek , LKML , Jann Horn References: <3eb5761e-7b25-4178-0560-fba5eb43ce6a@gmail.com> <20180427201036.GL5965@thunk.org> <20180429143205.GD13475@amd> <20180429170541.lrzwyihrd6d75rql@sultan-box> <20180429184101.GA31156@amd> <20180429202033.ysmc42mj2rrk3h7p@sultan-box> <20180429220519.GQ5965@thunk.org> <20180429222625.35tedjzkizchudcm@sultan-box> <20180429224928.teg6zyfjxndbcnsn@sultan-box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180429224928.teg6zyfjxndbcnsn@sultan-box> User-Agent: Mutt/1.9.5 (2018-04-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 29, 2018 at 03:49:28PM -0700, Sultan Alsawaf wrote: > On Mon, Apr 30, 2018 at 12:43:48AM +0200, Jason A. Donenfeld wrote: > > > - if ((fast_pool->count < 64) && > > > - !time_after(now, fast_pool->last + HZ)) > > > - return; > > > - > > > > I suspect you still want the rate-limiting in place. But if you _do_ > > want to cheat like this, you could instead just modify the condition > > to only relax the rate limiting when !crng_init(). > > Good idea. Attached a new patch that's less intrusive. It still fixes my issue, > of course. What your patch does is assume that there is a full bit of uncertainty that can be obtained from the information gathered from each interrupt. I *might* be willing to assume that to be valid on x86 systems that have a high resolution cycle counter. But on ARM platforms, especially during system bootup when the user isn't typing anything and SSD's and flash storage tend to have very predictable timing patterns? Not a bet I'd be willing to take. Even with a cycle counter, there's a reason why we assumed that we need to mix in timing results from 64 interrupts or one second's worth before we would give a single bit's worth of entropy credit. - Ted