Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp581033pxp; Wed, 9 Mar 2022 08:32:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJFpCCMr67BQ71lSiUCPLcvAuF6cwLAILw9ZtpbB6FwsLjdYdMGjnSEY7UMHuozOZfI2fh X-Received: by 2002:a05:6402:510d:b0:416:a24f:2173 with SMTP id m13-20020a056402510d00b00416a24f2173mr279996edd.274.1646843546475; Wed, 09 Mar 2022 08:32:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646843546; cv=none; d=google.com; s=arc-20160816; b=tvs3xjmwkmi4uEhwat6i8+d3q0oUhEpL0nTBo8eUW7mZ5vkTBfkbTuOFIpSvdXe+gF MRxov3amob6iNh+cHi/RtHAgB0sjBEJ4+Ey90f5LyB6e4JGcPq7xk0q6qQU+8C7iGZmr 4lbHqbeLP/eHbGaYvzynhmR7cpBuXyoKwdrKy7HuoY606WrFExGJf29r0gpW2RXcnqIo iinxuZpvep1PK8eEqK7DkzJtt+5dtpZLBuvDR7yOe+9rLmDQgQIRo5eSRdlL+pMINqPb 4Ol6O9qhVytic5iYCub6WZDOeA8mgmmCc7m0SAQ5oSOK/2wrFpd5Li1E4Cskx54sseim 9c5w== 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=E6mu2Rj9sT3PipRUW3bVF5de+F5geviTtH7uXTcG1yk=; b=eozLFd2QrkXsKz4iw45ekhrtXMZYiedI9RlDaPLDF5z/qHsbTCPe0vDrMpVrpzjNqt uVB+AD7D7d2yyjK2Jb4fSn7WOtFTH+voBCCgQfSDSdFZPoUcoHyZhFQE33NY6fFbHXj9 CcFrvbk0gCJK+B+ZMSqpGb1DlXHugLzsahk8o0klbdXq0464Jzaf6mnedd4/qA2hlRhe KAtdiWkAjD8PK1UQFQCwSMNkHvm8+e48ZpD0lQz4xb/V6wVG/5CD7LhFooeICHqG03ZQ +XcGINKiqGTgDAXKfGkR7GkLT2UZVJUu0PAQ8FO6urbbdm2jMb9HvQqDYAd9rwTuJzu6 e1RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WRTP37Ha; 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 z4-20020a17090665c400b006b20854d44bsi1312398ejn.966.2022.03.09.08.31.45; Wed, 09 Mar 2022 08:32:26 -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=WRTP37Ha; 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 S234241AbiCIQER (ORCPT + 99 others); Wed, 9 Mar 2022 11:04:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234308AbiCIQDA (ORCPT ); Wed, 9 Mar 2022 11:03:00 -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 2E58117585A; Wed, 9 Mar 2022 08:02:01 -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 B810361486; Wed, 9 Mar 2022 16:02:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9C4AC340E8; Wed, 9 Mar 2022 16:01:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646841720; bh=gzER/rtF+lYiIgmsa+QygKlUJbf9PTMWtZtRvs2hWTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WRTP37HaWAVSmvwGMfCl/vOBNMXOumxloxGMRPK9W3mz68eu9YJcMi9pqhAA1P8ZG a/yd0lofbgZT5IOalkVBi7hoWTHExM4gEIxOqODeyqM43j3zfvVHa+49QxXM9/oFYY 5VhBjUAtpwnxlHo8xAaMfAk+Tqo+p5Nd3KaoXeR8= 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 , Ben Hutchings Subject: [PATCH 4.9 11/24] Documentation/hw-vuln: Update spectre doc Date: Wed, 9 Mar 2022 16:59:24 +0100 Message-Id: <20220309155856.632962055@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: 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.19] Signed-off-by: Frank van der Linden [bwh: Backported to 4.9: adjust filenames] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- Documentation/hw-vuln/spectre.rst | 42 ++++++++++++++++++++++++------------ Documentation/kernel-parameters.txt | 8 +++++- 2 files changed, 35 insertions(+), 15 deletions(-) --- a/Documentation/hw-vuln/spectre.rst +++ b/Documentation/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/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -4174,8 +4174,12 @@ bytes respectively. Such letter suffixes 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.