Received: by 10.192.165.148 with SMTP id m20csp3958085imm; Mon, 30 Apr 2018 09:12:46 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrxztJnvGRJDARPrcpWn7gmMflNuKjlpR3RcDkCK7/zTdzzcQTby2VkMTmem7GBKbvaDVmV X-Received: by 2002:a17:902:7b90:: with SMTP id w16-v6mr4982522pll.294.1525104766364; Mon, 30 Apr 2018 09:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525104766; cv=none; d=google.com; s=arc-20160816; b=bfu4CdxHPZkp3kQeVjC5iIKZIGHMmGUDnxKiVc8LQpHHRvo3wQgklKYT1RnzohPCd5 qGEoOHu67XD2ZCLzw+fShkW/awO1foeX48ZghJxW1W7ruiNHpFlrP6FVIvCHB9EGKQNZ ZxhtZQI/jUR4jrEgTeC6Nx7zhJjcYQra1w4dKlPuLCwW10AehOVfMOMASoQLp8FEsu7N c7nwt4ECtyPyI73FKR28mXl3INxUi0wJaOAfSXFD2iSmDYWmID2IYgV9LeU88PWaLEsl bkLUuF4Bwh5Pnt+R2fn2LMuZJNzrlTg/Wg/6IU833H1IaFo6/nQtYYRwRAoT++64Wkj0 vtOA== 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=uUfQqeA8BUjZ7XMr3hj8h9WJCx97pMMlK6AqeUFDTIY=; b=jCqmwgWbRN185m3q/hMN1zUwp9/O+4N2fUCYyT3hxi9x/jFnKrdsetAlPuzd69dglT jt0AECJH0juTmNtDNDx6aOjS4F/D36h65jACd5SSeZISz2aA8ABzHtER9MjVeQvROjzt CvCTKvr6YVbgxq3tCIud5w7F5v7F4xmxXEyKywp7v4MtK9sY7qfx4e+EIN0arsIHG2Ej /QGlX/t9hm1HrrWD/2g0y1k9nyUMk1Nn0IkD90BtgbWcjITa8Ghcv8ZMK1ZaM7kCg0Fv 7TY2fB9OC7eeKzPKDcEL4MEsAqwb5bJ3Iu7kQvwMZBw1wDSgaxpk/UR22+h+WZ7ARI8M EpBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@thunk.org header.s=ef5046eb header.b=EZcxzqvC; 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 c129si7019188pfc.367.2018.04.30.09.12.32; Mon, 30 Apr 2018 09:12:46 -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=EZcxzqvC; 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 S1754842AbeD3QLs (ORCPT + 99 others); Mon, 30 Apr 2018 12:11:48 -0400 Received: from imap.thunk.org ([74.207.234.97]:45544 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754631AbeD3QLr (ORCPT ); Mon, 30 Apr 2018 12:11:47 -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=uUfQqeA8BUjZ7XMr3hj8h9WJCx97pMMlK6AqeUFDTIY=; b=EZcxzqvCaqT6HUZzM5fnwUTK5e Fh6YPuGCAVIKbU6vxJIp5B5ZUFmXy5PQ+JdRTDE08vYR49juOUZIEBqW836wIR6c60AYC/vzpMEug lxgJj1L1nORoavJLjWZskmpphCtuYioZLa6jfImLHkU9ul+MUg2OiUD46KDhyb/ibWTo=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.89) (envelope-from ) id 1fDBOy-0001se-AX; Mon, 30 Apr 2018 16:11:44 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id 86BB27A0141; Mon, 30 Apr 2018 12:11:43 -0400 (EDT) Date: Mon, 30 Apr 2018 12:11:43 -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: <20180430161143.GA20585@thunk.org> Mail-Followup-To: "Theodore Y. Ts'o" , Sultan Alsawaf , "Jason A. Donenfeld" , Pavel Machek , LKML , Jann Horn References: <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> <20180430001106.GS5965@thunk.org> <20180430043445.t7wkykxzkhex2isi@sultan-box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180430043445.t7wkykxzkhex2isi@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 09:34:45PM -0700, Sultan Alsawaf wrote: > > What about abusing high-resolution timers to get entropy? Since hrtimers can't > make guarantees down to the nanosecond, there's always a skew between the > requested expiry time and the actual expiry time. > > Please see the attached patch and let me know just how horrible it is. So think about exactly where the possible causes of the skew might be coming from. Look very closely at the software implemntation. The important thing here is to not get hung up on the software abstraction, but to look at the *implementation*. (And if it's an implementation in architecture specific code, we need to look at all architectures.) This applies on the hardware level as hard, but that gets harder because there many possible hardware implemntations in use out there. Remember that that on many systems there may be only single clock crystal, and all other hardware timers maybe derived from that clock using frequency dividers. (At least for everything on the mainboard.) - Ted