Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2866472pxb; Thu, 10 Feb 2022 07:16:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxklQKb7r45mw/E/0AVJY+B+vtbdaHPFpjgMtaani7cwyLh9V8z0/QuiZNhwHzUvked/qLr X-Received: by 2002:a17:902:b215:: with SMTP id t21mr7989243plr.73.1644506203050; Thu, 10 Feb 2022 07:16:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644506203; cv=none; d=google.com; s=arc-20160816; b=tp4xnkcxdts9EIrpjuVAtHLizsvBHPrUrd4ofFnmJcqDkKEsdACWJ2+6VCBYei4K3c chS4giclfe1Qh4mr6nrGlGJOyD86Iwc1i5EroWZCOS9bhjmaJ7EqyUarp0hmg79zJpL0 Ou6d/WXl1VDWjp8D2j9ye3Bw8vnQ4HzQZnWDImQD+NOIVpcDxWjfIdXVl04OMNJg/8yN 1gzNF9MIK+pKJrBTfp32qPqCwxa9Us5Q8kqPRf90g28Xa0Y1goBKwDnRwD+oSxBU/J3A mu24RJADxIe3jW9Uk7p1AIJe6LTr6qW5k05XPGrZGJtikDd4LciErGdt6WBCdRjpsNzV yMeg== 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=pVh3j3Tw1rbhPwbsiv07D8jQP9frccpzsBvaih26V4o=; b=EKbWV1iT/M1Ole/bImOBzYZDEc/53iZYa3yM41ZPs0BcwKwqL0cpGrFmQ1CpHihYh9 g+GlDm2XpC/nlkg9fK3DkjcIHH3e7lhfMpvBb4BTCYwb1Z8/RDyB5i9Wklsw6reN2gUi fpoLv1Kl0kvqH9zak1T1kE82ILSrVBRvLRCHJxnoFkV/ref+fNKo4MbwwvTR69Xen7yo 5HwVD/wT0YuQMffZZCMqz/9nynYsvRO5jXWu6I8TGJ8j1AKB3LsJiCuDtEofxgYPWnX0 2YCMq1I6v1wybzhlvRXoRtngNDAZvRXk+6h3AkCuInb3QrVMYgglf2Ypz4u15ykuw75q STAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HeMXFDvT; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x11si1570694pjo.188.2022.02.10.07.16.22; Thu, 10 Feb 2022 07:16:43 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=HeMXFDvT; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240998AbiBJO51 (ORCPT + 99 others); Thu, 10 Feb 2022 09:57:27 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:42578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243290AbiBJO51 (ORCPT ); Thu, 10 Feb 2022 09:57:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 326EFC4C for ; Thu, 10 Feb 2022 06:57:28 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id DD61BB8255A for ; Thu, 10 Feb 2022 14:57:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E84B3C004E1; Thu, 10 Feb 2022 14:57:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644505045; bh=g5OVObHyNbVOVMOpI+RbP9Dm6TmTnDorPAxu51sTyK0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HeMXFDvTS4lkAD49E/arEOU0+C2gy8ccxs7evDVnJ/h4qK/R0+z9BFHuMdjJer6Qo AzO6gPYEXiuyETNnSzwScIizvOIOTVKJomiCpPTGfuCo2J5FgdXmgy4gZdQyo/bFej RzWSIeZv7ZImGyyXobnQQmnyfKxVM1wMjipwuzNY= Date: Thu, 10 Feb 2022 15:57:22 +0100 From: Greg Kroah-Hartman To: Sandy Harris Cc: Linux Crypto Mailing List , Ted Ts'o , "Jason A. Donenfeld" , Herbert Xu Subject: Re: [PATCH 0/4] random: change usage of arch_get_random_long() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 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, Feb 10, 2022 at 10:28:26PM +0800, Sandy Harris wrote: > This series of patches is not strictly necessary, but it is a > significant improvement. > > The current code has a sequence in several places that calls one or > more of arch_get_random_long() or related functions, checks the return > value(s) and on failure falls back to random_get_entropy(). These > patches provide get_source_long(), which is intended to replace all > such sequences. > > This is better in several ways. It never wastes effort by calling > arch_get_random_long() et al. when the relevant config variables are > not set. If config variables for a hardware rng or the latent entropy > plugin are set, then it uses those instead. It does not deliver raw > output from any of these sources, but masks it by mixing with stored > random data. In the fallback case it gives much more random output > > In the cases where a good source is available, this adds a little > overhead, but not much. It also saves some by not trying > arch_get-random_long() unnecessarily. > > If no better source is available, get_source_long() falls back to > get_xtea_long(), an internal-use-only pseudorandom generator based on > the xtea block cipher. In general, that is considerably more expensive > than random_get_entropy(), but also provably much stronger. > > With no good source, there is still a problem at boot; xtea cannot > become secure until it is properly keyed. It does become safe > eventually, and in the meanwhile it is certainly no worse than > random_get_entropy(). This patch series is not actually threaded at all, and is totally whitespace damaged. How did you send it? Try using 'git send-email' next time to correctly thread them and not corrupt them so that they are unusable :( thanks, greg k-h