Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp633216pxb; Thu, 31 Mar 2022 13:29:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVBfNiLv8CnaqZIAee4yFpFEnKgl9utz8oCIipGPXOM5oWPohs3gjERKyDLDNAnmisyZ3A X-Received: by 2002:a17:907:6d96:b0:6df:f199:6a7c with SMTP id sb22-20020a1709076d9600b006dff1996a7cmr6645156ejc.137.1648758573995; Thu, 31 Mar 2022 13:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648758573; cv=none; d=google.com; s=arc-20160816; b=OvuXP6srN4KC839w6Z7t9SgB3JdaSmYn+ZgQsvAVDxptzE/X+u3h/ne7Mf4ZuLkFXG hFoMv9JTjZDOPTPV+sZ3xVNLfQ4/ZDgOS+D3SqzOHAM94N32824Cxzr2aY4Z3Mykxo3z RPl6ymEVL8QpPxHXPXYMuqRQ5UCgYhCjPIGW7viQhR6ZkA1RQlE1+WVveCe7txnPgzBq WKqYERWN4rkhrVLSOzG+KAlA6e/tBTwlj9sLHC9o8AMUqXZH5MhhVykoldUBaS19MqVq CMqNtPTLf939f7DDkRrPTZ6hSxjyz6JF8xYJ76lyvwlE+nFXydFvfhNDqjywekOE99WI ihwA== 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; bh=ZNv++AcmuD7y1Z7j+BKhGhHt4Kjd2Ffp/f3F1X3jawc=; b=QpK64YiQdoq90CZwEjYb4sJL+wbCPOJWLUl6a49isRSRKv8h2twWwXwI4HACNcc1ie oof9ErScPyEYwGuuJ30I3L+fgCbAGEQxebHzJfQWHizwVHsLH8Fw04py9WFTbSRryTGg d/USLW+o93QX8HQEswNFzXRyFhTb1xldGZkEZcF5zdGq1CTWL3U3+YSV1eoZENJsPzsd 0mtk4KD2RP7PI0502OcgiSnuya+D+uUStVo/YrZudcc6z2dnD1xUZhKqHLtygub3L8pP Ui0XtHfUp8n2jz5xqZAoFL8TXgRTEB8MPw6i6yh7q0SmJfSTf5QZxXV/Yeid5NjeEJ1h StMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f7-20020a1709064dc700b006df76385ea4si309303ejw.836.2022.03.31.13.29.08; Thu, 31 Mar 2022 13:29:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232658AbiCaR5P (ORCPT + 99 others); Thu, 31 Mar 2022 13:57:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232316AbiCaR5O (ORCPT ); Thu, 31 Mar 2022 13:57:14 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 811022220D5; Thu, 31 Mar 2022 10:55:26 -0700 (PDT) Received: from cwcc.thunk.org (pool-108-7-220-252.bstnma.fios.verizon.net [108.7.220.252]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 22VHtKuR015132 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 31 Mar 2022 13:55:21 -0400 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 9166115C003E; Thu, 31 Mar 2022 13:55:20 -0400 (EDT) Date: Thu, 31 Mar 2022 13:55:20 -0400 From: "Theodore Ts'o" To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Dominik Brodowski Subject: Re: [PATCH v2] random: mix build-time latent entropy into pool at init Message-ID: References: <20220331150706.124075-1-Jason@zx2c4.com> <20220331152641.169301-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220331152641.169301-1-Jason@zx2c4.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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-kernel@vger.kernel.org On Thu, Mar 31, 2022 at 11:26:41AM -0400, Jason A. Donenfeld wrote: > Prior, the "input_pool_data" array needed no real initialization, and so > it was easy to mark it with __latent_entropy to populate it during > compile-time. In switching to using a hash function, this required us to > specifically initialize it to some specific state, which means we > dropped the __latent_entropy attribute. An unfortunate side effect was > this meant the pool was no longer seeded using compile-time random data. > In order to bring this back, we declare an array in rand_initialize() > with __latent_entropy and call mix_pool_bytes() on that at init, which > accomplishes the same thing as before. We make this __initconst, so that > it doesn't take up space at runtime after init. > > Fixes: 6e8ec2552c7d ("random: use computational hash for entropy extraction") > Cc: Dominik Brodowski > Cc: Theodore Ts'o > Signed-off-by: Jason A. Donenfeld LGTM Reviewed-by: Theodore Ts'o