Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp580950pxp; Wed, 9 Mar 2022 08:32:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTTvjGvUyAH7t5XDkRwjbLR0NQYFP53ENE4PU6zMpuq74ZkN/mmoiIMXuqbueGTrz9ZzHt X-Received: by 2002:a17:902:f785:b0:14d:d2b6:b7c with SMTP id q5-20020a170902f78500b0014dd2b60b7cmr283710pln.68.1646843542299; Wed, 09 Mar 2022 08:32:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646843542; cv=none; d=google.com; s=arc-20160816; b=CYMcHNBCgVljZP4jNLvknAKVWMP5MFEwe9zrlTZpJB1AexafafjJMMKoIyyKQcCMBP U1eauU4MZTJlwHwTlHIEaEKz5Ocnp+892lVC3n5RYkQYy+o/RT5l9IYT7OSIJ5A7CcbD 1NRyGJgNEYTx4Tl4Lo0c/6C26N1/uvxNarYMsm1GSqFadGXS6oTSFwQKuL4HgWVbcfbA hOkNYaD9NTZfHdn39dQGK0LufsYqDfmEe+vOEnosWJTVJTAsKgLfe/+EJfe+0zhwYO9Y hSkjkI+374Qt75PtneSLs2u2cTAhhcFQ4PvgtLNABxtP2xwOpkK6BcYSNUPgXC+MftZC hvOw== 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=fm2ug3Cj2PdOUtgxDK8NUR/a1Rs/3h6OpApfP+E+rVTQwwxWuxJ9PTN6PxaZLv6aAX go/qMaEbxQ1aUVzI3naXlp5OKAus2dNb5VC0v2u5aIv+Bf0HsOtCj2Wz/lj6px+Br9jj fY+hrdxZtUj9xUb/7GoZ509N0NNjY6ViV052HCnawWCS/wn3lNQm1CLXvxp4mddVHGvh HiK/Sxbon0IelpHU+LHpNwlt1AWGygpglbb6CLN5r62DPiLq7obccGDky+8iw2wDwU0a SA8u2B4oewntfJs02kFu4xvQzs9mIxB1yMecbz2ikSHxbUObq8MyL3QAcigNTWh7qTLJ RC9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KBsom5iJ; 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 d16-20020a656b90000000b00378baddbaabsi2544474pgw.330.2022.03.09.08.31.47; Wed, 09 Mar 2022 08:32:22 -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=KBsom5iJ; 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 S234139AbiCIQDR (ORCPT + 99 others); Wed, 9 Mar 2022 11:03:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234177AbiCIQCh (ORCPT ); Wed, 9 Mar 2022 11:02:37 -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 B226B170D51; Wed, 9 Mar 2022 08:01:38 -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 4FF2C6167E; Wed, 9 Mar 2022 16:01:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 585EAC340F3; Wed, 9 Mar 2022 16:01:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646841697; bh=46jo3Lac9ZQVbErqXQpZ2hY92m8kz18vN57CNImpM3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KBsom5iJ7wNqsoDwHKDHEKubM7PAZ3/GZVR0hlKrg5fJP05YIZ/NzGQ7a/vnsTNSG dtxWj+FSH63lgZowIAd2ui3DWDTSOm5SYgqaAhzk0mftS3hnTbVd7+dFezm07ONIhe rIskyEL87LOykhKbX5lk83qA7RrFbUxPDQJ4E9/o= 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/24] x86/speculation: Use generic retpoline by default on AMD Date: Wed, 9 Mar 2022 16:59:26 +0100 Message-Id: <20220309155856.690698640@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220309155856.295480966@linuxfoundation.org> References: <20220309155856.295480966@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; }