Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6267009rwb; Tue, 9 Aug 2022 12:04:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR6BPf+abu5cgT8faeKM7lmNmxdKisO+iiXG9psDAY1Hwok0KJVKlhmVLZUQxZQdnTxQGfdY X-Received: by 2002:a17:902:9307:b0:170:d739:a3cf with SMTP id bc7-20020a170902930700b00170d739a3cfmr5499681plb.127.1660071880259; Tue, 09 Aug 2022 12:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660071880; cv=none; d=google.com; s=arc-20160816; b=pR+wlV594eCfRTlwrEkuv+bn7ID9QMA9e22OQ4wLXN/F7G6lQryFf6YTKnr/+QehAf 8KmTIv0At3BtA+3dUS0khY+tfOY8IHTfFQHvmtg24heD9knK8RjXtN6yIlqPhM4Lw2rO /sOYSjhYOaGAWDXlMAR1q0lu5v7Akn7lTScxarJ0Hclm2VnkwUjEtIKazo0Et/05KbRK /y4F+14T8BrarDgnRgXo+Dsp1A+zVeBdQTNr9ANTQb9hKLGD/8DL+fMvgZfXtDS/T1gm cUFhoTmxpzU3i7MqUhw6xveoVbCrIMIaV6RcQ+YzmGL8G2hjv4+LraThNiIM0YsYiY8M wGDA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0gJBqo+r/69ZkK/yxnbpT/FTNoDujeOAEulv6d2DQ5k=; b=Ud5RD7Piunoiz+Mc7oXggO8w2cYWS3PdD3sUmm66rjE4lcSTb/xtrWHN1MijzXsbFb zgTXQ+qBKs5XMXRPtUlXLhEEVafmzwavgtzBwHRugM8tmZgy+SPH2qXWzBJ3c6+VA7mQ 3CgpEs6CBk6A6yxZSkxpSzsfUdrW1Bcoh7mqJ7+9XJp0IO3rIF6rZKkkmQaq4iA1kpOL py6FQ4YDGZV1LwuqfTObtvysJpFSWNBmueZWIPGhBSYUXQipVFpfSZnGd2rSgusq+JA/ RJNOxK6pdAyYomUF8J2M5Rojf8+nZ/zUTkEqKaZILtWUXLD4+HWNYMzQKa5vjw74XF6C tANQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0VLQxqus; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a170902f70a00b0016d69a69685si14834516plo.622.2022.08.09.12.04.18; Tue, 09 Aug 2022 12:04:40 -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=@linuxfoundation.org header.s=korg header.b=0VLQxqus; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343700AbiHISNb (ORCPT + 99 others); Tue, 9 Aug 2022 14:13:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345792AbiHISLp (ORCPT ); Tue, 9 Aug 2022 14:11:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 434672B1A1; Tue, 9 Aug 2022 11:04:51 -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 7706961070; Tue, 9 Aug 2022 18:04:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE977C433D6; Tue, 9 Aug 2022 18:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660068289; bh=S2xxbuptJ7V+bMWXdehtQv+Fi2QhUDp4XHIgVKjwTfM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0VLQxqus1+xsRqbvBsMZdCcgE7DdY0MfB9ildAqe1u2t02MT39/eP8Lj0zBARpdfL xpDxAlF0rYiX7OqjRunfdrCoNV3hzizIzy2wGMivvQzeqMOYCQ3azBqVHsxssGX6cS d54PCbHwY/7bKjiu5TNH+kJ3ncC36JHFIdbeur+c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Hutchings , Borislav Petkov Subject: [PATCH 5.15 01/30] x86/speculation: Make all RETbleed mitigations 64-bit only Date: Tue, 9 Aug 2022 20:00:26 +0200 Message-Id: <20220809175514.322531397@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220809175514.276643253@linuxfoundation.org> References: <20220809175514.276643253@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 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-kernel@vger.kernel.org From: Ben Hutchings commit b648ab487f31bc4c38941bc770ea97fe394304bb upstream. The mitigations for RETBleed are currently ineffective on x86_32 since entry_32.S does not use the required macros. However, for an x86_32 target, the kconfig symbols for them are still enabled by default and /sys/devices/system/cpu/vulnerabilities/retbleed will wrongly report that mitigations are in place. Make all of these symbols depend on X86_64, and only enable RETHUNK by default on X86_64. Fixes: f43b9876e857 ("x86/retbleed: Add fine grained Kconfig knobs") Signed-off-by: Ben Hutchings Signed-off-by: Borislav Petkov Cc: Link: https://lore.kernel.org/r/YtwSR3NNsWp1ohfV@decadent.org.uk [bwh: Backported to 5.10/5.15/5.18: adjust context] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- arch/x86/Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2427,7 +2427,7 @@ config RETPOLINE config RETHUNK bool "Enable return-thunks" depends on RETPOLINE && CC_HAS_RETURN_THUNK - default y + default y if X86_64 help Compile the kernel with the return-thunks compiler option to guard against kernel-to-user data leaks by avoiding return speculation. @@ -2436,21 +2436,21 @@ config RETHUNK config CPU_UNRET_ENTRY bool "Enable UNRET on kernel entry" - depends on CPU_SUP_AMD && RETHUNK + depends on CPU_SUP_AMD && RETHUNK && X86_64 default y help Compile the kernel with support for the retbleed=unret mitigation. config CPU_IBPB_ENTRY bool "Enable IBPB on kernel entry" - depends on CPU_SUP_AMD + depends on CPU_SUP_AMD && X86_64 default y help Compile the kernel with support for the retbleed=ibpb mitigation. config CPU_IBRS_ENTRY bool "Enable IBRS on kernel entry" - depends on CPU_SUP_INTEL + depends on CPU_SUP_INTEL && X86_64 default y help Compile the kernel with support for the spectre_v2=ibrs mitigation.