Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1791355pxp; Thu, 10 Mar 2022 12:15:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDSqilELPes4h2Fhh9U0qzZ+7aDqG1rhLDNQ7FF7nl3k0tGhC7aesef96W0FScpomkRcAm X-Received: by 2002:a17:906:a08b:b0:6cf:65bc:e7de with SMTP id q11-20020a170906a08b00b006cf65bce7demr5757819ejy.220.1646943315990; Thu, 10 Mar 2022 12:15:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646943315; cv=none; d=google.com; s=arc-20160816; b=fF0T15d7RUlqRskwlcsaM6HST6tVPt8YLdHOwxFd+OsEYTKR7GFF/mMpMt1ci8F3xk uYnUeBEGbjaou1GYk/PUFsiGNbLgNdZZkNGUlcBdO6uF/KYmknA9AESvq+D+L5jRHTA4 /G8tTHdk1l2IpDOT8s9/02LhflMFyl46KYhSphHKo+Yo6NiQRcZg+AxnGM/QMquanS61 +lfCOE0UoP1IEKhwl4hXWORokuVNgnK4v4CNr2dCUblFgZcdY9mlCruo7ge7/a0WtURu YPk3HKHHl+P4dK5k7s7Lmwoc42tppk9xfpP7HLO0k54M9zYH1lbpZZyZlXS4yrQBedkw MK7w== 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=gMYZcgSD/QimfXHPRWxgK+eBVnN3oyp6Pe4iEGwbrs8=; b=iqfPygShfpe+yRq+ah4lOJKlLrZlUJyjjgyVYNjNeh+5BIb/07vLoXYNq+auBb71p/ S5joN0+BNun1j2gGjLoauITRHscSjgcUjGA6nH+/nndZprGiPA6ZIRXaECRGyPURXuln TJs3rmWIvjBxysiNbBGkGzXqgLkFdZ0WCXqosy8t8U42YVnXH/0d+FB7WSxzWOn93zly KytyW3FBPt4oyBBB4qewxOwViAsO7ObIA3oMTcK420THVdL34pNeQeOgRNw5xwqG8AjJ /E7p4lEo1DW94YiY+6weaUJuSag6FlbT6nTVgJ9F6Wkwip/iuNPyKDwTOjI0iBmtH1Pf Shlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w24GdvgC; 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 c12-20020a05640227cc00b0041649af58a7si4666368ede.19.2022.03.10.12.14.53; Thu, 10 Mar 2022 12:15:15 -0800 (PST) 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=w24GdvgC; 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 S243415AbiCJOVs (ORCPT + 99 others); Thu, 10 Mar 2022 09:21:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243790AbiCJOSW (ORCPT ); Thu, 10 Mar 2022 09:18:22 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF001166A63; Thu, 10 Mar 2022 06:14:47 -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 ams.source.kernel.org (Postfix) with ESMTPS id 817ADB8267C; Thu, 10 Mar 2022 14:14:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB655C340E8; Thu, 10 Mar 2022 14:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646921659; bh=46jo3Lac9ZQVbErqXQpZ2hY92m8kz18vN57CNImpM3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w24GdvgCZfFFDOl78pFEUSTB3WoXQy3ObqCWXqBbL2NQrkn2dISFtMDFqFc3nxltH MLyLKyt9QnoeV46y1NlKifCORRs0sDb5EaLO6BmUneRmaQ7LJRTZYPZyPHuJFJ4fdZ OP5uo2ADNhAmf0R2uRYFcFHI5KEA8tkA/grc9gA0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kim Phillips , Borislav Petkov , Ben Hutchings Subject: [PATCH 4.9 13/38] x86/speculation: Use generic retpoline by default on AMD Date: Thu, 10 Mar 2022 15:13:26 +0100 Message-Id: <20220310140808.524922163@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310140808.136149678@linuxfoundation.org> References: <20220310140808.136149678@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=-7.6 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: 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: Ben Hutchings 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 @@ -897,14 +897,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; }