Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1895808pxp; Thu, 10 Mar 2022 14:30:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJwi7HuIw1G11X4M1X7gxEIT3WpvwjLkF+qoNbO9eJCUSmktyzUrOqDLQ1DVZ8NZ/BJ8C30U X-Received: by 2002:a17:906:5d08:b0:6da:b4ea:937 with SMTP id g8-20020a1709065d0800b006dab4ea0937mr6161393ejt.446.1646951455433; Thu, 10 Mar 2022 14:30:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646951455; cv=none; d=google.com; s=arc-20160816; b=zIbsAmpOMsnHoWNv8g05WUCc8B9Wo26h/NZ76TPduk8dbtzc0DyFPB5LA9PwJvehEp bUK/jOUt4EJvVAg/0Vy8NJWc2dYLKeaoQUvvap0QDZbCRaREaPsVaGxE64idMolkXoV/ UPTpiCet37f1ICDj/ebr74SlVHQYyP8PKTzKYOoenHV9ApV+68F6bNlJIiFwdc64hDPn oyevBLB0hXHRH05GdCHvSE9IDL45Z18G0Nnkh9GXS1XHCuW+TpyZBw/lz1dlLDm7Ndui B6Dd3UuIOw2O2oJWwG6TTQyLYObk5ewcxcsN1u6uPfVic+TbJ8Pl+6YpVwIf/zO6Dvj4 q6Vw== 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=xPSgHLW8zBaOvjimPCrVvwBr3hk/PscGHtyBIyXufEc=; b=UqFOL4p1hm9IQlVzW11mdoOkJ1Ef7U1D6WvpnqtB2HBxpAhZzmp2yjtrAmMkEGKKnU i3wzl7KoaR70MkG/d7I2zkteN6fxDPoc24Qb5JM+3+LEsyf1MfyDz1V7oNlZB3UqhywG JZSpQTPTJkYCBVJQzM9QJlUSk01Cy3QvwG9c9RXrtZpmHtOs4s7XzWecdYOKIfcwUk+i vQ4z4gIpPBaPR1w2l/4YjhNS+uzhpECZqWs+bjMwvIBgUvU/Fo/y/a+7B813pYoqwYDN zSbi63l4q0cqdH6F2i4CBnxuV04P1J7YwAMYeohNlqLEAT6dg6aoIxK8LfduBP4FlGII y/aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ss8lsf10; 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 t15-20020a056402524f00b004164ad7c899si4315949edd.518.2022.03.10.14.30.32; Thu, 10 Mar 2022 14:30:55 -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=ss8lsf10; 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 S243840AbiCJO1t (ORCPT + 99 others); Thu, 10 Mar 2022 09:27:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243589AbiCJOZN (ORCPT ); Thu, 10 Mar 2022 09:25:13 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 130BB1617F2; Thu, 10 Mar 2022 06:21:49 -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 4A1BAB8267D; Thu, 10 Mar 2022 14:21:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95B3CC340E8; Thu, 10 Mar 2022 14:21:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646922091; bh=EbrEZQ50EN7O9KAn4zxvfpRaHNZyBkM467lX/zI6ot8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ss8lsf10FJuo4DvZEPhXp1ZTGsSxcDoJFA7Hodb+9Mj/qqvIMRMX6+hHxEmtZmLCg 3/lIvLZ5MNfe8nrJaQXVHywDIUEAJ5hFh0hBn4waT1es+8fOIS5qEupVBOZmCc7KYB nOaYot3QrqE+SW8LziS/fGdzW9sDp9Sd6cEevoQ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Borislav Petkov , Thomas Gleixner , Frank van der Linden Subject: [PATCH 4.14 05/31] Documentation/hw-vuln: Update spectre doc Date: Thu, 10 Mar 2022 15:18:18 +0100 Message-Id: <20220310140807.688038300@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310140807.524313448@linuxfoundation.org> References: <20220310140807.524313448@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: Peter Zijlstra commit 5ad3eb1132453b9795ce5fd4572b1c18b292cca9 upstream. Update the doc with the new fun. [ bp: Massage commit message. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner [fllinden@amazon.com: backported to 4.14] Signed-off-by: Frank van der Linden Signed-off-by: Greg Kroah-Hartman --- Documentation/admin-guide/hw-vuln/spectre.rst | 42 ++++++++++++++++-------- Documentation/admin-guide/kernel-parameters.txt | 8 +++- 2 files changed, 35 insertions(+), 15 deletions(-) --- a/Documentation/admin-guide/hw-vuln/spectre.rst +++ b/Documentation/admin-guide/hw-vuln/spectre.rst @@ -131,6 +131,19 @@ steer its indirect branch speculations t speculative execution's side effects left in level 1 cache to infer the victim's data. +Yet another variant 2 attack vector is for the attacker to poison the +Branch History Buffer (BHB) to speculatively steer an indirect branch +to a specific Branch Target Buffer (BTB) entry, even if the entry isn't +associated with the source address of the indirect branch. Specifically, +the BHB might be shared across privilege levels even in the presence of +Enhanced IBRS. + +Currently the only known real-world BHB attack vector is via +unprivileged eBPF. Therefore, it's highly recommended to not enable +unprivileged eBPF, especially when eIBRS is used (without retpolines). +For a full mitigation against BHB attacks, it's recommended to use +retpolines (or eIBRS combined with retpolines). + Attack scenarios ---------------- @@ -364,13 +377,15 @@ The possible values in this file are: - Kernel status: - ==================================== ================================= - 'Not affected' The processor is not vulnerable - 'Vulnerable' Vulnerable, no mitigation - 'Mitigation: Full generic retpoline' Software-focused mitigation - 'Mitigation: Full AMD retpoline' AMD-specific software mitigation - 'Mitigation: Enhanced IBRS' Hardware-focused mitigation - ==================================== ================================= + ======================================== ================================= + 'Not affected' The processor is not vulnerable + 'Mitigation: None' Vulnerable, no mitigation + 'Mitigation: Retpolines' Use Retpoline thunks + 'Mitigation: LFENCE' Use LFENCE instructions + 'Mitigation: Enhanced IBRS' Hardware-focused mitigation + 'Mitigation: Enhanced IBRS + Retpolines' Hardware-focused + Retpolines + 'Mitigation: Enhanced IBRS + LFENCE' Hardware-focused + LFENCE + ======================================== ================================= - Firmware status: Show if Indirect Branch Restricted Speculation (IBRS) is used to protect against Spectre variant 2 attacks when calling firmware (x86 only). @@ -584,12 +599,13 @@ kernel command line. Specific mitigations can also be selected manually: - retpoline - replace indirect branches - retpoline,generic - google's original retpoline - retpoline,amd - AMD-specific minimal thunk + retpoline auto pick between generic,lfence + retpoline,generic Retpolines + retpoline,lfence LFENCE; indirect branch + retpoline,amd alias for retpoline,lfence + eibrs enhanced IBRS + eibrs,retpoline enhanced IBRS + Retpolines + eibrs,lfence enhanced IBRS + LFENCE Not specifying this option is equivalent to spectre_v2=auto. --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -4150,8 +4150,12 @@ Specific mitigations can also be selected manually: retpoline - replace indirect branches - retpoline,generic - google's original retpoline - retpoline,amd - AMD-specific minimal thunk + retpoline,generic - Retpolines + retpoline,lfence - LFENCE; indirect branch + retpoline,amd - alias for retpoline,lfence + eibrs - enhanced IBRS + eibrs,retpoline - enhanced IBRS + Retpolines + eibrs,lfence - enhanced IBRS + LFENCE Not specifying this option is equivalent to spectre_v2=auto.