Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6167549iog; Thu, 23 Jun 2022 12:46:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1szGGhWx9JwPEYKwEoq647bDdgNxiVySKcdR9Bvc7WSNHShyqkj/QBmWTnZxR/T79Ms4DZ0 X-Received: by 2002:a17:906:6a23:b0:722:e1ba:964c with SMTP id qw35-20020a1709066a2300b00722e1ba964cmr9870296ejc.680.1656013592003; Thu, 23 Jun 2022 12:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656013591; cv=none; d=google.com; s=arc-20160816; b=v05zwyrWwaTOSwP7bvLh73jlZhUubTInH3vRPLLzYHkdqp6uL42+eb3G9fKTJuEz4r pmcX3XOJKq2K08Jzbi7MT1VK6dFnPMnDm+T2ODBhZ0cGHu41/sLKvme6qv1IuVikd04M UcGNF+/4WX4mU17U6z8b9poIlS3oSKisX+J5g7NnmsaIeFypwZTvF6aBXVEOCL2ecKsi vuDeQdQVQS394GJd3lY9EMH9teQPxevFm0ZVs7IyINx9yb7bzmu4E3UjdpoCt7D9TW94 d7bHKPl7zR0lAnxyMkHMcvo0+n27GPL10OJTtdNPKQ0r05j+pLycT7AEkk0WFBmIBWlH AsHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=9Zi7kN2rAf97Y8l/RrFuUuoYtBom0DVPrS2j0CHl/T0=; b=UH5MyYpdopGQUsvnIarjUHAYVCtc0sI34IcJ5gIVx/2PBOFrqeL8ZSgFHTUibQJlhp AV/9r9iGtEp0EY6WCTvLDGpyyclnkodB0p9oys2V0o4c9kyp3izdXdr3qTYf8aSC3WlS PJACN7rwkYqJXQFf3oOfwHq98ihD6FCjU/4zt/I8jMx6UnhImyK256aUkJ7V8hMLNLW2 QxL0N4fxkU9+9Gxf7HEZhKUZePGgN9MymC+5//THWgKr0qYWGrLUOlShbZgBOygNsiZn 2uVBH5UqTxLaBh1xc0e4hIWrWnBbOIWWEg45lFIh3OECkZDvhs7K9QYRz8fVFgR3WeqI U0ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TNYj8V4V; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a056402274900b004358eb8f787si604512edd.447.2022.06.23.12.46.05; Thu, 23 Jun 2022 12:46:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TNYj8V4V; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231574AbiFWTo3 (ORCPT + 99 others); Thu, 23 Jun 2022 15:44:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbiFWToM (ORCPT ); Thu, 23 Jun 2022 15:44:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0094B60E37; Thu, 23 Jun 2022 12:36:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 45D91619E2; Thu, 23 Jun 2022 19:36:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50BCDC341C0; Thu, 23 Jun 2022 19:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656012985; bh=nDfbSGYCTY10pLb2wgmFt1IEf1MTe6t7GSlKVQ2JcT4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TNYj8V4Vk+eOmExRYynKVKPcBCfhQDJxUM4nvDKUQbCJDlLXhl1G35xwsJDd0vx72 AzX0zlP2qu8ObxTIQRvIFsUmCqVIHtybwiKaKtyHXianqPNd8Qd+P2ACY9YCXgq4I7 iPWf01DgDD94W5hX8S/IzHvvAva4fmB8xwnrYOikZBmb01btT9RcFQ7YOrSkLVMovg xjbzZMfeekny02F1E1E1XGk1soGlEHoFCietgUSOe5v79RQhW1UCruedhljPnV50xf gAtM4zl+cqSOgVz/tLnMObKzUZcPdUdf8e5PJcDGAQf9n9+29HChputg/bdbzWun+S GiBiQcg4YrY1g== Date: Thu, 23 Jun 2022 12:36:23 -0700 From: Eric Biggers To: "Jason A. Donenfeld" Cc: LKML , Thomas Gleixner , Linux Crypto Mailing List , stable@vger.kernel.org Subject: Re: [PATCH v4] timekeeping: contribute wall clock to rng on time change Message-ID: References: <20220623191249.1357363-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220623191249.1357363-1-Jason@zx2c4.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Thu, Jun 23, 2022 at 09:12:49PM +0200, Jason A. Donenfeld wrote: > The rng's random_init() function contributes the real time to the rng at > boot time, so that events can at least start in relation to something > particular in the real world. But this clock might not yet be set that > point in boot, so nothing is contributed. In addition, the relation > between minor clock changes from, say, NTP, and the cycle counter is > potentially useful entropic data. > > This commit addresses this by mixing in a time stamp on calls to > settimeofday and adjtimex. No entropy is credited in doing so, so it > doesn't make initialization faster, but it is still useful input to > have. > > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Cc: stable@vger.kernel.org > Signed-off-by: Jason A. Donenfeld > --- > kernel/time/timekeeping.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) Reviewed-by: Eric Biggers - Eric