Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp700386pxp; Fri, 11 Mar 2022 12:45:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJyq2daxIa1+Vc/7/ku3AC78yqQ4PqY05xonlLmZ7b81Ko3XwXbrBJ7tnm5o/VqkLsckcL9u X-Received: by 2002:a17:90a:d681:b0:1be:e3e5:3e6e with SMTP id x1-20020a17090ad68100b001bee3e53e6emr23145918pju.122.1647031504212; Fri, 11 Mar 2022 12:45:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647031504; cv=none; d=google.com; s=arc-20160816; b=ilYLiWSDPtrX6aLPGUg6taBRhFA+uONUcmGYyXLAbZzCGBSUxlcXWbokePDqKOq13+ VL+6hmLMe/GvMEvME/4s7iB+uljZZYLHpnnsPGYxSeR57s5nUXYb2iV6vZlIGjt/Yr2B C7U2defgCoWviYvsbdD2jpyDLn6VHSTApmuMeCb5PV59+ds73xGhfabcitmkNlr+ohpJ D8DrTtiuv73FYAFFwTRb8WSp2Qqw/CGUaBm9EZct4lbZNPT5MkI4Sg5RdZzLTbbxEYU+ 3+/V0Z3XmhVlVtkcohDoXhMIy8r4DAfOEAoUuJiAojqhMQBCZ3EaDUTccHfknttJRlvm CJJA== 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=EoChqYrGdspD5axYy4jODHDs+0z07Yk89AjGdgASItI=; b=iAdPMU1VlJbJN3jSwTKn/txHxKJAWys/vxy411C52OcUMCpoLXptPtJVdntYrGtOFb 4cQRDvKqT55c48HK4L29izZqZEmtZR0mDCeXl0Ip8t+GbvXzi1b+F+vm6+GvFANrfWiM wCAkIsgBYmtSLMYsZkD8ory0ujx+yntNNVe3HT9dPzit8fQEHZ558pis7WfXAtY9m7/a 4dndT+XS45hzu9o+I+zQrVxlDw1K7W5f95VNQzo2X2Hv6KVThDP82oISZlt07e4ydBuO IUCZ57S2BxVgs77y1uH02j06p/Z27RQU3flbuLYVBbtmr6Nr+fgU+X+xa3Vnx6eICJnT Gyrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SAgKYSgK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i16-20020a170902c95000b00151d5970964si8533022pla.5.2022.03.11.12.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 12:45:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=SAgKYSgK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A227A1DED77; Fri, 11 Mar 2022 12:41:29 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244045AbiCJO2V (ORCPT + 99 others); Thu, 10 Mar 2022 09:28:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243529AbiCJOZg (ORCPT ); Thu, 10 Mar 2022 09:25:36 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C01BAF94F5; Thu, 10 Mar 2022 06:22:09 -0800 (PST) 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 5ADBD61B63; Thu, 10 Mar 2022 14:22:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F121C340E8; Thu, 10 Mar 2022 14:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646922128; bh=rSTOUX5LUvBCX6WBogDAqooyuvYNrP66hsRf3uWRExc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SAgKYSgKURonAmjkHsHT5TkFzrDKNLN1m87C12SWq7Bu3n0Ho1Sn9TTVD+lKBTw76 PrdmdBdxsedPGxGPiSLwN4j0iosI563wblcqMqUS74ontKfQI3LkELC1+vXZJYF0V+ PoYI0R9ArEL/fhIOreeg235XjI8jD1OP1DR3oXcY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kim Phillips , Borislav Petkov Subject: [PATCH 4.19 07/33] x86/speculation: Use generic retpoline by default on AMD Date: Thu, 10 Mar 2022 15:18:34 +0100 Message-Id: <20220310140807.965113257@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310140807.749164737@linuxfoundation.org> References: <20220310140807.749164737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Kim Phillips commit 244d00b5dd4755f8df892c86cab35fb2cfd4f14b upstream. AMD retpoline may be susceptible to speculation. The speculation execution window for an incorrect indirect branch prediction using LFENCE/JMP sequence may potentially be large enough to allow exploitation using Spectre V2. By default, don't use retpoline,lfence on AMD. Instead, use the generic retpoline. Signed-off-by: Kim Phillips Signed-off-by: Borislav Petkov Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/bugs.c | 8 -------- 1 file changed, 8 deletions(-) --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -898,14 +898,6 @@ static enum spectre_v2_mitigation __init return SPECTRE_V2_NONE; } - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { - if (!boot_cpu_has(X86_FEATURE_LFENCE_RDTSC)) { - pr_err("LFENCE not serializing, switching to generic retpoline\n"); - return SPECTRE_V2_RETPOLINE; - } - return SPECTRE_V2_LFENCE; - } - return SPECTRE_V2_RETPOLINE; }