Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp866850imw; Wed, 13 Jul 2022 09:21:12 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vBM6MFTc5tu0/6qBNsgTYafKbnn8XR5FeGPmbpTlCgA8Tpf+AioKaQKUmCapBFBPxOg4yT X-Received: by 2002:a17:907:3e03:b0:722:e694:438 with SMTP id hp3-20020a1709073e0300b00722e6940438mr4174213ejc.755.1657729272259; Wed, 13 Jul 2022 09:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657729272; cv=none; d=google.com; s=arc-20160816; b=WLQGA2KOig2Un9rmsCE00rcw2yvJt7gdEo0wTyCauyUC3FOTdq7SfUQCTHRDbxx6hh QvrrnDqyecSbEKdpw+t4WaO3Auro3TiTwHc2uU/qwsfMeBFJQyF2ETCG97CV1XghD2bj wHWyTMFN0+Dk3eZgHaM6SET1WCXJGpxPDdtDCQ5ThQnaAHapLZRHZmHUo25eTNp6zyEF rzChTQ9wcxq3BLSuCZl3tj7MRloSCu0k5RMExbRv8MibrCBvTAJuUEIXRqpEDY/JPlql JWQLKfpFXLyOVpxTiuXli4CIFiQ6FuiGXsBS8VRjRamrlmGci80c9VEb1AjJc4s+C12x PbNg== 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; bh=L5jopzr7z55kUQEHFTb8X+T9cOJJ6+wOdbCrR6Y+cZk=; b=yRJVIWJVXUT9NbAoxvLMQayY/+HbC/T6iC+ABhDtZlcgtVCTGYOwibWXSmaXZZj600 z5WB9UDNjUnCDytR/5xB4pfsvbwao6smdN/M6B41zcphCuMBfs2+W58ETrSzwAgltmVA RnrjHosA7ZUZ9I15b/XFy/v3uq99dVi2TqWe3viBJ9wUYkYVNSt9IGpytuPfb9B0ZP/H dQTucb3x5vQ2WUqZ1rs4Tluj3fwJBHJdw9r026gyGKmFIBuektQQhlHn7dMQm9+3XOx7 OP8ox0TCUuFPgYpM9jGdiOBxnavGdAyapcBW5NkHpCfDBgHbbo1yT+Pyk2eczFUyDfsZ awHg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y19-20020a056402441300b0043ac342b26dsi22479156eda.203.2022.07.13.09.20.46; Wed, 13 Jul 2022 09:21:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236806AbiGMPqZ (ORCPT + 99 others); Wed, 13 Jul 2022 11:46:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230520AbiGMPqY (ORCPT ); Wed, 13 Jul 2022 11:46:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 732234D4D1; Wed, 13 Jul 2022 08:46:23 -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 0A81F6193B; Wed, 13 Jul 2022 15:46:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38FD3C3411E; Wed, 13 Jul 2022 15:46:19 +0000 (UTC) Date: Wed, 13 Jul 2022 16:46:15 +0100 From: Catalin Marinas To: "Jason A. Donenfeld" Cc: Borislav Petkov , "H. Peter Anvin" , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Will Deacon , Michael Ellerman , Heiko Carstens , Alexander Gordeev , Thomas Gleixner , Greg Kroah-Hartman , Arnd Bergmann , Borislav Petkov Subject: Re: [PATCH v5] random: remove CONFIG_ARCH_RANDOM Message-ID: References: <20220706143521.459565-1-Jason@zx2c4.com> <20220708004032.733426-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220708004032.733426-1-Jason@zx2c4.com> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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-kernel@vger.kernel.org On Fri, Jul 08, 2022 at 02:40:32AM +0200, Jason A. Donenfeld wrote: > When RDRAND was introduced, there was much discussion on whether it > should be trusted and how the kernel should handle that. Initially, two > mechanisms cropped up, CONFIG_ARCH_RANDOM, a compile time switch, and > "nordrand", a boot-time switch. > > Later the thinking evolved. With a properly designed RNG, using RDRAND > values alone won't harm anything, even if the outputs are malicious. > Rather, the issue is whether those values are being *trusted* to be good > or not. And so a new set of options were introduced as the real > ones that people use -- CONFIG_RANDOM_TRUST_CPU and "random.trust_cpu". > With these options, RDRAND is used, but it's not always credited. So in > the worst case, it does nothing, and in the best case, maybe it helps. > > Along the way, CONFIG_ARCH_RANDOM's meaning got sort of pulled into the > center and became something certain platforms force-select. > > The old options don't really help with much, and it's a bit odd to have > special handling for these instructions when the kernel can deal fine > with the existence or untrusted existence or broken existence or > non-existence of that CPU capability. > > Simplify the situation by removing CONFIG_ARCH_RANDOM and using the > ordinary asm-generic fallback pattern instead, keeping the two options > that are actually used. For now it leaves "nordrand" for now, as the > removal of that will take a different route. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Michael Ellerman > Cc: Alexander Gordeev > Cc: Thomas Gleixner > Cc: H. Peter Anvin > Acked-by: Borislav Petkov > Acked-by: Heiko Carstens > Acked-by: Greg Kroah-Hartman > Signed-off-by: Jason A. Donenfeld For arm64: Acked-by: Catalin Marinas