Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1687096imw; Tue, 5 Jul 2022 13:46:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1taMICmb0EiTcPNJguetfPpmsCV/EP/yhxBZ29S4oSnDRM8hDdxlXyXMbflbBeP0K4E5EUY X-Received: by 2002:a17:90b:4b0e:b0:1ec:dd93:5113 with SMTP id lx14-20020a17090b4b0e00b001ecdd935113mr44721631pjb.12.1657054002511; Tue, 05 Jul 2022 13:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657054002; cv=none; d=google.com; s=arc-20160816; b=AcYSlLQSLWmDy3+OpAh8f503cfmswL9BaS1bSQUrgBeihy+yIhE6QjgQUDNHmaQKVt XJwbdJoabVzc6rIPlvfEO7hyP4DX/CrWNFx00qTAdlm+RPazprej/wbaAxuCfHUysOFx fd+N63KtRZoNT9maG0YTzj6Mqr0gHFaUd5WOZ+m6ZeQ/YjbCSqnddtbML70gjl4rHGNO YYzmDCPUydE9Hn5u4u22m2EBNP1tFtFJwWCdQyLYLU3jWY0hYAU/ufREP+nzg1+xXcps JGXVMgYv7AwOkJMEDxxJg8bDCKPO93dN8cK31ycwhKSWipuowU5ivwXTiYnlH5yDH01t gXzw== 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=Y0U35vMX74kXxtKME+uItAJHsSwmFddMjvSCpjyQPj8=; b=Nwc4KGP18GjTA+MXEwfyGIkeep26QaaXR34QovRsCQdeZDIjotVEGvZ3c31F0HytXW A9UEJsV0n6b3vvUMKtfKI47ys6itLN/Z0ukL7kP/MXKxLBhs+jHvaNvP9+lFT3+y9Kwl oEFavoD5LisjaUNVGGizPIn1JsKnQwU5cfzV+XZ+EbiEa5vsUI0GcNuApdP5+E1Hzilc OySNQZAn0PiKVqMhkqfeY0pr3IL9qgwMavV5HgzFyinuNpsLeQxU6wrRcwbJ/I+I0mEt OlY/5v0VLtCzR4WwhdrQXyG9j+g0gSvTAD1hf2HR4Llo+WR9X5QlOvz8ChALpfbgxuIe IjJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=DiwfS7Ub; 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=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a170902ecc100b0016be52879a1si9215889plh.187.2022.07.05.13.46.30; Tue, 05 Jul 2022 13:46:42 -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=@alien8.de header.s=dkim header.b=DiwfS7Ub; 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=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231486AbiGET5Q (ORCPT + 99 others); Tue, 5 Jul 2022 15:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230095AbiGET5O (ORCPT ); Tue, 5 Jul 2022 15:57:14 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 205DD12609; Tue, 5 Jul 2022 12:57:14 -0700 (PDT) Received: from zn.tnic (p200300ea970ff625329c23fffea6a903.dip0.t-ipconnect.de [IPv6:2003:ea:970f:f625:329c:23ff:fea6:a903]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 563241EC0513; Tue, 5 Jul 2022 21:57:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1657051028; 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: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=Y0U35vMX74kXxtKME+uItAJHsSwmFddMjvSCpjyQPj8=; b=DiwfS7UbthNvF8uPkSvMWijUr+9SR1Oegvu9M94gxrifro3VGXsAzTZgbkkfR+bTkof9CU NEcWkSCBrtbKJnT/X+6bhlEH/oXTb9HMZwuAieiM/e3LdzZe/20wFDfVdGBl07ojky6143 L0dNZFDKdpgatJx+Wz78IitJ+up+C8E= Date: Tue, 5 Jul 2022 21:57:04 +0200 From: Borislav Petkov To: "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 , "H . Peter Anvin" , Greg Kroah-Hartman , Arnd Bergmann Subject: Re: [PATCH] random: remove CONFIG_ARCH_RANDOM and "nordrand" Message-ID: References: <20220705190121.293703-1-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-kernel@vger.kernel.org On Tue, Jul 05, 2022 at 09:44:17PM +0200, Jason A. Donenfeld wrote: > Oh, huh. Maybe in that case I should adjust the message to say "consider > using `random.trust_cpu=0`," which is the thing that would actually make > a security difference. Why isn't that option documented in Documentation/admin-guide/kernel-parameters.txt? > But actually, one thing that wasn't clear to me was: does `nordrand` > affect what userspace sees? While random.c is okay in lots of > circumstances, I could imagine `nordrand` playing a role in preventing > userspace from using it, which might be desirable. Is this the case? If > so, I can remove the nordrand chunk from this patch for v2. If not, I'll > adjust the text to mention `random.trust_cpu=0`. Unfortunately, it doesn't disable the instruction. It would be lovely if we had a switch like that... That's why this message is supposed to be noisy so that people can pay attention at least. > In the sense that random.c can handle mostly any input without making > the quality worse. So, you can't accidentally taint it. The only risk is > if it thinks RDRAND is good and trustable when it isn't, but that's what > `random.trust_cpu=0` is for. 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. Automatically. Not rely on the user to do anything. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette