Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1504878pxb; Sat, 23 Apr 2022 08:24:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymcq6SRA3IXpXOawvQy5VAk2FdT//ObWV6RJSEwAcVU18FNWyQPBs3SmaBZnNsmEyyL7pJ X-Received: by 2002:a17:902:edd1:b0:158:8318:b51e with SMTP id q17-20020a170902edd100b001588318b51emr9805522plk.89.1650727499691; Sat, 23 Apr 2022 08:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650727499; cv=none; d=google.com; s=arc-20160816; b=ivgBgiknZkwzIHaKsPrGaMJFQo0ecPiZK6BpYKKCSbQbLBX4+29v5fBWHldMZ69Unw GTQ5vX20UvjNO3NUewCBoSelxBNJlUrwXpFoRjcubDvB7IAREK+Ove1sVdCp4tbC81zj a8EEu2ydtWMtmmvokZlcCjBU2B2axzuhUR/nfEy7ohtimb9I+IYYcaRr9ucWrgaIskRu 3vNH7zBaL36IRZ7jfge+s6pIuJ38ePAVuvVFua4fboaV1lALHrg1CC5/WbxTTuDMKJWf rrKfiQbYwjd43Yw5KpyBztd3axftdbfdb/2ma44zyWe8DRs0DfHoKrB7PrNEaAKwov0I mPfg== 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=yzboIlk5vJyGJ9lIUicUoHDvMySNFYIAfwJpuAS8VE0=; b=rDGdzJR8LA0RrzoaOMwngNL0f2lpp7ivh67ecpvCjXG8nvJocjXIBwWnshQv409rIJ liEzC4P1GOqrrwNrYPWnCnMQbZIs8okRnf1VavLFWAszqLUgX6+tJ30m+nInoZeQ/rdn OKmHhvQdYM0aDlhoIOI9OJ3GRjHwKGgsZRu2dKtSbDTmD5A20UT8KZ3lUtJMijF4x49C QspI/8/NMh32HnYs+TXk/BPGApebOUvv70J+ZsFxcfNrCM6u9O5X/uj7MbWICIYSqrsC FCqDmSQEp3Rpf+1ePHFUaFDFz6cz9apjdz07Q7wPQG8FLTFLxJj23XNrhT6N77kbx2iP 1z/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=BrTNBu3U; 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=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b4-20020a056a00114400b005056ce10e70si11491180pfm.278.2022.04.23.08.24.29; Sat, 23 Apr 2022 08:24:59 -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=@zx2c4.com header.s=20210105 header.b=BrTNBu3U; 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=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234501AbiDWKDo (ORCPT + 99 others); Sat, 23 Apr 2022 06:03:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234283AbiDWKDn (ORCPT ); Sat, 23 Apr 2022 06:03:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FC9015CF4D; Sat, 23 Apr 2022 03:00:45 -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 E964960EF3; Sat, 23 Apr 2022 10:00:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09578C385A0; Sat, 23 Apr 2022 10:00:40 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="BrTNBu3U" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1650708039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yzboIlk5vJyGJ9lIUicUoHDvMySNFYIAfwJpuAS8VE0=; b=BrTNBu3UPGd/snRKQaW6FCT2ETTW5AjxdyJ6d5OFslB53rAsjYQWfTknmHGingrsxLV4ix yB3Z33fq8ZEu9lWFNSAsBIXFWS69ptmi6XvOsvr/W2o6ZDyCsI3ruk6NWXUUVsrydwnSwy QbHGR2xD+RPJeLJSPg/mehva8mt8n/8= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 7d5a8aa6 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Sat, 23 Apr 2022 10:00:38 +0000 (UTC) Date: Sat, 23 Apr 2022 12:00:33 +0200 From: "Jason A. Donenfeld" To: Sandy Harris Cc: LKML , Linux Crypto Mailing List , Thomas Gleixner , Arnd Bergmann , Theodore Ts'o , Dominik Brodowski , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Thomas Bogendoerfer , Paul Walmsley , Palmer Dabbelt , Albert Ou , "David S . Miller" , Richard Weinberger , Anton Ivanov , Johannes Berg , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , Chris Zankel , Max Filippov , Stephen Boyd , Dinh Nguyen , linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org, linux-xtensa@linux-xtensa.org Subject: Re: [PATCH v5 11/11] random: insist on random_get_entropy() existing in order to simplify Message-ID: References: <20220419111650.1582274-1-Jason@zx2c4.com> <20220419111650.1582274-12-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 Hi Sandy, On Sat, Apr 23, 2022 at 10:24:07AM +0800, Sandy Harris wrote: > On Sat, Apr 23, 2022 at 6:37 AM Jason A. Donenfeld wrote: > > > > All platforms are now guaranteed to provide some value for > > random_get_entropy(). In case some bug leads to this not being so, we > > print a warning, ... > > Would it make sense to test at compile time? If there is no hardware > RNG nor a cycle counter, then the kernel should be compiled with > the gcc latent entropy plugin. Generate a warning suggesting that, > or even an error insisting on it. Unfortunately, as a last ditch warning safeguard against bugs, I don't think that's something we can determine at build time. A lot of this machinery is dynamic. Fortunately a single check at init time brings with it zero appreciable overhead. Jason