From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sat, 23 Apr 2022 12:00:33 +0200 From: "Jason A. Donenfeld" 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: 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 List-ID: 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