From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65895CCA482 for ; Wed, 6 Jul 2022 06:41:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229921AbiGFGlW (ORCPT ); Wed, 6 Jul 2022 02:41:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbiGFGlT (ORCPT ); Wed, 6 Jul 2022 02:41:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA28B175A1; Tue, 5 Jul 2022 23:41:18 -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 ams.source.kernel.org (Postfix) with ESMTPS id 6ABBFB810B2; Wed, 6 Jul 2022 06:41:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4558C3411C; Wed, 6 Jul 2022 06:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657089676; bh=yRGgIJUHXkz2TXJ4J6jNOpjIOkNNlk8+GJwy5fMiZ+E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UmBMB+TJVrq4Gw9/pfOPUH8FVR53qIvRVpi+/2bZ4Tl0ovU3eWwkhUstZr8i7ntPH sWDra3CbZPk7FcieK4NosMw8F7902e+ydwYQXfv07XZQthiCA/VjT5a1qR9aUOe2LN 7Q6owf5BOUsMUFDooZhriCtR5IVyOMFojtZRxed8= Date: Wed, 6 Jul 2022 08:41:13 +0200 From: Greg Kroah-Hartman 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, Catalin Marinas , Will Deacon , Michael Ellerman , Heiko Carstens , Alexander Gordeev , Thomas Gleixner , Arnd Bergmann Subject: Re: [PATCH v2] random: remove CONFIG_ARCH_RANDOM Message-ID: References: <20220706003225.335768-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220706003225.335768-1-Jason@zx2c4.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 06, 2022 at 02:32:25AM +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. > > So this commit simplifies things down to the two options that are > actually used, and removes the confusing old ones that aren't used or > useful. 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: Heiko Carstens > Cc: Alexander Gordeev > Cc: Thomas Gleixner > Cc: H. Peter Anvin > Cc: Greg Kroah-Hartman > Cc: Arnd Bergmann > Signed-off-by: Jason A. Donenfeld > --- > arch/arm64/Kconfig | 8 -------- > arch/arm64/include/asm/archrandom.h | 10 ---------- > arch/arm64/kernel/cpufeature.c | 2 -- > arch/powerpc/Kconfig | 3 --- > arch/powerpc/include/asm/archrandom.h | 3 --- > arch/powerpc/include/asm/machdep.h | 2 -- > arch/powerpc/platforms/microwatt/Kconfig | 1 - > arch/powerpc/platforms/powernv/Kconfig | 1 - > arch/powerpc/platforms/pseries/Kconfig | 1 - > arch/s390/Kconfig | 15 --------------- > arch/s390/configs/zfcpdump_defconfig | 1 - > arch/s390/crypto/Makefile | 2 +- > arch/s390/include/asm/archrandom.h | 3 --- > arch/x86/Kconfig | 9 --------- > arch/x86/include/asm/archrandom.h | 10 +--------- > arch/x86/kernel/cpu/rdrand.c | 2 -- > drivers/char/Kconfig | 1 - > drivers/char/hw_random/s390-trng.c | 9 --------- > include/linux/random.h | 9 +-------- > .../selftests/wireguard/qemu/kernel.config | 1 - > 20 files changed, 3 insertions(+), 90 deletions(-) Acked-by: Greg Kroah-Hartman From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00B09C433EF for ; Wed, 6 Jul 2022 06:41:58 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Ld91x217gz3c5y for ; Wed, 6 Jul 2022 16:41:57 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=UmBMB+TJ; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=145.40.68.75; helo=ams.source.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=UmBMB+TJ; dkim-atps=neutral Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Ld91H1ZkNz2yZc for ; Wed, 6 Jul 2022 16:41:21 +1000 (AEST) 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 79AEEB81AEC; Wed, 6 Jul 2022 06:41:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4558C3411C; Wed, 6 Jul 2022 06:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657089676; bh=yRGgIJUHXkz2TXJ4J6jNOpjIOkNNlk8+GJwy5fMiZ+E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UmBMB+TJVrq4Gw9/pfOPUH8FVR53qIvRVpi+/2bZ4Tl0ovU3eWwkhUstZr8i7ntPH sWDra3CbZPk7FcieK4NosMw8F7902e+ydwYQXfv07XZQthiCA/VjT5a1qR9aUOe2LN 7Q6owf5BOUsMUFDooZhriCtR5IVyOMFojtZRxed8= Date: Wed, 6 Jul 2022 08:41:13 +0200 From: Greg Kroah-Hartman To: "Jason A. Donenfeld" Subject: Re: [PATCH v2] random: remove CONFIG_ARCH_RANDOM Message-ID: References: <20220706003225.335768-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220706003225.335768-1-Jason@zx2c4.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-s390@vger.kernel.org, Arnd Bergmann , Will Deacon , Catalin Marinas , Heiko Carstens , x86@kernel.org, linux-kernel@vger.kernel.org, Borislav Petkov , "H. Peter Anvin" , Alexander Gordeev , linuxppc-dev@lists.ozlabs.org, Thomas Gleixner , linux-arm-kernel@lists.infradead.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Jul 06, 2022 at 02:32:25AM +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. > > So this commit simplifies things down to the two options that are > actually used, and removes the confusing old ones that aren't used or > useful. 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: Heiko Carstens > Cc: Alexander Gordeev > Cc: Thomas Gleixner > Cc: H. Peter Anvin > Cc: Greg Kroah-Hartman > Cc: Arnd Bergmann > Signed-off-by: Jason A. Donenfeld > --- > arch/arm64/Kconfig | 8 -------- > arch/arm64/include/asm/archrandom.h | 10 ---------- > arch/arm64/kernel/cpufeature.c | 2 -- > arch/powerpc/Kconfig | 3 --- > arch/powerpc/include/asm/archrandom.h | 3 --- > arch/powerpc/include/asm/machdep.h | 2 -- > arch/powerpc/platforms/microwatt/Kconfig | 1 - > arch/powerpc/platforms/powernv/Kconfig | 1 - > arch/powerpc/platforms/pseries/Kconfig | 1 - > arch/s390/Kconfig | 15 --------------- > arch/s390/configs/zfcpdump_defconfig | 1 - > arch/s390/crypto/Makefile | 2 +- > arch/s390/include/asm/archrandom.h | 3 --- > arch/x86/Kconfig | 9 --------- > arch/x86/include/asm/archrandom.h | 10 +--------- > arch/x86/kernel/cpu/rdrand.c | 2 -- > drivers/char/Kconfig | 1 - > drivers/char/hw_random/s390-trng.c | 9 --------- > include/linux/random.h | 9 +-------- > .../selftests/wireguard/qemu/kernel.config | 1 - > 20 files changed, 3 insertions(+), 90 deletions(-) Acked-by: Greg Kroah-Hartman From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B8F9C43334 for ; Wed, 6 Jul 2022 06:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7ZlXiwnzOXfcXD3GukgQjaBxlQQX8iy8DLARjrZWjrU=; b=mqS7N2/Z4Sd6jo oM+0jazzZkwEOycWJZ+UG3Ts3DxN4LYEsLAxJdOprpS6ZV/BC+JyKeYOliVpMe0I2uU/oPjwwpIES nrw65oTXKmWdbILSFOwroPO/ZnrQR6p0LNUVWhlsbvOVNqK18QvQeXf/8sp8/lx2DrmqlVY2KKNfJ 9IK+SOkAQyNnIv21G25Fwovq3Kbmgdi09GbxJ7TFQVSk+lLkXMoLASTKEojXIO/+MjtmWnmPOYIUY 2MM6RZ4hMZc2l5f4bi03ncRuZyhuOXhemd+mOsyh6fk+cyevi2d6oOAMN1AbV6oUpk8uBoK8PUCDU K2s/8tcgbxIbRkVyc38Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8yix-006mSv-L8; Wed, 06 Jul 2022 06:41:23 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8yit-006mR4-E6 for linux-arm-kernel@lists.infradead.org; Wed, 06 Jul 2022 06:41:21 +0000 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 79AEEB81AEC; Wed, 6 Jul 2022 06:41:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4558C3411C; Wed, 6 Jul 2022 06:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657089676; bh=yRGgIJUHXkz2TXJ4J6jNOpjIOkNNlk8+GJwy5fMiZ+E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UmBMB+TJVrq4Gw9/pfOPUH8FVR53qIvRVpi+/2bZ4Tl0ovU3eWwkhUstZr8i7ntPH sWDra3CbZPk7FcieK4NosMw8F7902e+ydwYQXfv07XZQthiCA/VjT5a1qR9aUOe2LN 7Q6owf5BOUsMUFDooZhriCtR5IVyOMFojtZRxed8= Date: Wed, 6 Jul 2022 08:41:13 +0200 From: Greg Kroah-Hartman 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, Catalin Marinas , Will Deacon , Michael Ellerman , Heiko Carstens , Alexander Gordeev , Thomas Gleixner , Arnd Bergmann Subject: Re: [PATCH v2] random: remove CONFIG_ARCH_RANDOM Message-ID: References: <20220706003225.335768-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220706003225.335768-1-Jason@zx2c4.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220705_234119_796123_C7F9A863 X-CRM114-Status: GOOD ( 25.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 06, 2022 at 02:32:25AM +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. > > So this commit simplifies things down to the two options that are > actually used, and removes the confusing old ones that aren't used or > useful. 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: Heiko Carstens > Cc: Alexander Gordeev > Cc: Thomas Gleixner > Cc: H. Peter Anvin > Cc: Greg Kroah-Hartman > Cc: Arnd Bergmann > Signed-off-by: Jason A. Donenfeld > --- > arch/arm64/Kconfig | 8 -------- > arch/arm64/include/asm/archrandom.h | 10 ---------- > arch/arm64/kernel/cpufeature.c | 2 -- > arch/powerpc/Kconfig | 3 --- > arch/powerpc/include/asm/archrandom.h | 3 --- > arch/powerpc/include/asm/machdep.h | 2 -- > arch/powerpc/platforms/microwatt/Kconfig | 1 - > arch/powerpc/platforms/powernv/Kconfig | 1 - > arch/powerpc/platforms/pseries/Kconfig | 1 - > arch/s390/Kconfig | 15 --------------- > arch/s390/configs/zfcpdump_defconfig | 1 - > arch/s390/crypto/Makefile | 2 +- > arch/s390/include/asm/archrandom.h | 3 --- > arch/x86/Kconfig | 9 --------- > arch/x86/include/asm/archrandom.h | 10 +--------- > arch/x86/kernel/cpu/rdrand.c | 2 -- > drivers/char/Kconfig | 1 - > drivers/char/hw_random/s390-trng.c | 9 --------- > include/linux/random.h | 9 +-------- > .../selftests/wireguard/qemu/kernel.config | 1 - > 20 files changed, 3 insertions(+), 90 deletions(-) Acked-by: Greg Kroah-Hartman _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel