Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1763838imw; Tue, 5 Jul 2022 15:12:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vo8UKanXeWZEbNOVjIpNCOyMWYmqzgpV8Dh8Gw8jynqMIcInGBGuS0MvLWmJCaP0yZn7zm X-Received: by 2002:a05:6402:2812:b0:439:acad:dfba with SMTP id h18-20020a056402281200b00439acaddfbamr28727359ede.412.1657059145454; Tue, 05 Jul 2022 15:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657059145; cv=none; d=google.com; s=arc-20160816; b=HFoQCX6fj0N8DQu188O2AeuJ2tBFSX5bkedalnNwdhjxDoZH8on6NItqHfYogASE4i F5dzoaMKUWIDWGA8wlwSt+k+N8aAe+fHYZCZJTMT61SvaOEprkOFwS+BK/H6z9fzJK+4 THQhTP976QbHw9CHhm5BtC2Iici6uVwqybr72t3aQ2Ap1c/niAYz8xZF6w33HgXTtGPb pMf6ks07U+/GPb8mUtYm6m6/DFMZCsP3zrulQAoD5auwGEFhc220acAp6oWSaE0jDS5g ypiyhP7yv+CV7zhvGon6R+JD+3X1xfg0A6B+wdbIppHKOdq66iOcZrCYd/GHJ9qqHpR/ yU4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature:dkim-filter; bh=7KDE2gFVvMSgPsHGHe9MxJdE6fru6CX4ADvVbzCKtT8=; b=huvLG6taO90hz70jJ8funNl/9snWhmcftJq7/+xYD5hogS+ZJNC5ZYGKmQQyKMkiDn 2sGPsnu7GRsAhkPzE9o3Y6hq+Kk19RWHUdjw1afqWjp9EvfWHSsI3VjoyVBE8/40Im1B wAt4EesseFCrMp0+nv2v4eZC9DXHv3sr7MrvICAJFm+/yFFDMu3kWyLFjURQ/HhmF3jP +ZEeoHkX7+h4S0TCFpHhUPZ9nSN4ga8h+jMg6zE3PArMFy531tlOxuPMQZ/0yquvWBOQ wFs9B5h2Z97C+ELokzjuwjpSANB6WrIorKbVJWpCDV6NhkpPHdtvO68r0ufokongY+sH OdeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2022060401 header.b=lMkaO2Fb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q24-20020aa7d458000000b004359dd18afcsi16496209edr.20.2022.07.05.15.12.00; Tue, 05 Jul 2022 15:12:25 -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; dkim=pass header.i=@zytor.com header.s=2022060401 header.b=lMkaO2Fb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbiGEVv1 (ORCPT + 99 others); Tue, 5 Jul 2022 17:51:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbiGEVv0 (ORCPT ); Tue, 5 Jul 2022 17:51:26 -0400 Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D36795FC4 for ; Tue, 5 Jul 2022 14:51:23 -0700 (PDT) Received: from [127.0.0.1] ([73.223.250.219]) (authenticated bits=0) by mail.zytor.com (8.17.1/8.15.2) with ESMTPSA id 265LoZui985421 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 5 Jul 2022 14:50:35 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 265LoZui985421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2022060401; t=1657057837; bh=7KDE2gFVvMSgPsHGHe9MxJdE6fru6CX4ADvVbzCKtT8=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=lMkaO2FbzS8H3Ku8woeLDFSXdgUMzhKC15vy7VQdtwYs91XormxkElNRd8Q0jV9i9 eiuEeplg9WtLAgD8dk0P/U/FI2JDZFmhH/T8n6gsuHuQypPNaaPgdlm8lcT3IA826d UzDQl4+77Pv22WQfoIiMSzqQxzQqc1IuTgDtDrtFRoVtuIPrsj1cfJx2OaI3ruVEcd ATP70kCNxi2r3ncyjkBZdYQrBeDR5ggdHco/GkfmlGdkVPVp5wGkZcp5fbUDTgWEvA 6N2BHP8z5Y/b0MLZ6XmVUItrHq/zFjRynAUVqUtBrK9SN/XxO0hSRnfBNnNNBVsgCi U/yxv4tY8favw== Date: Tue, 05 Jul 2022 14:50:34 -0700 From: "H. Peter Anvin" To: Borislav Petkov , "Jason A. Donenfeld" CC: linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Catalin Marinas , Will Deacon , Michael Ellerman , Heiko Carstens , Alexander Gordeev , Thomas Gleixner , Greg Kroah-Hartman , Arnd Bergmann Subject: Re: [PATCH] random: remove CONFIG_ARCH_RANDOM and "nordrand" User-Agent: K-9 Mail for Android In-Reply-To: References: <20220705190121.293703-1-Jason@zx2c4.com> Message-ID: <11C903CC-22A7-48EE-AD63-E71CC8D28B88@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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-kernel@vger.kernel.org On July 5, 2022 12:57:04 PM PDT, Borislav Petkov wrote: >On Tue, Jul 05, 2022 at 09:44:17PM +0200, Jason A=2E Donenfeld wrote: >> Oh, huh=2E Maybe in that case I should adjust the message to say "consi= der >> using `random=2Etrust_cpu=3D0`," which is the thing that would actually= make >> a security difference=2E > >Why isn't that option documented in >Documentation/admin-guide/kernel-parameters=2Etxt? > >> But actually, one thing that wasn't clear to me was: does `nordrand` >> affect what userspace sees? While random=2Ec is okay in lots of >> circumstances, I could imagine `nordrand` playing a role in preventing >> userspace from using it, which might be desirable=2E Is this the case? = If >> so, I can remove the nordrand chunk from this patch for v2=2E If not, I= 'll >> adjust the text to mention `random=2Etrust_cpu=3D0`=2E > >Unfortunately, it doesn't disable the instruction=2E It would be lovely i= f >we had a switch like that=2E=2E=2E > >That's why this message is supposed to be noisy so that people can pay >attention at least=2E > >> In the sense that random=2Ec can handle mostly any input without making >> the quality worse=2E So, you can't accidentally taint it=2E The only ri= sk is >> if it thinks RDRAND is good and trustable when it isn't, but that's wha= t >> `random=2Etrust_cpu=3D0` is for=2E > >And that's why I'm saying that if you detect RDRAND returning the >same thing over and over again, you should simply stop using it=2E >Automatically=2E Not rely on the user to do anything=2E > It's just math=2E The only variable is your confidence level, i=2Ee=2E at = what level do you decide that the likelihood of pure chance is way smaller = than the likelihood of hardware failure=2E For example, the likelihood of m= n-bit samples in a row being identical is 2^-(n*(m-3/2)), and the likeliho= od of the CPU being destroyed by a meterorite in the same microsecond is ab= out 2^-100=2E