Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp780266pxp; Fri, 11 Mar 2022 14:58:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJznPIGUQZtc1f0rDZfeMBrlw60zyelWU6bcJTqGDvHQ+il0tOpV4OfKIEmNL0ActGEN8UhG X-Received: by 2002:a63:2d8:0:b0:37c:4e75:302c with SMTP id 207-20020a6302d8000000b0037c4e75302cmr10693763pgc.580.1647039516234; Fri, 11 Mar 2022 14:58:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647039516; cv=none; d=google.com; s=arc-20160816; b=xB7bZIGTdCoHWJEYtpSJJz5xAAIEQDcRH/2l87ty1rbojoEIQnwhWFwmGRkBfDtXDu 1n0/svChktpIjW64H1EpTMbG5Bb6TcBJ7H9hfHST8r/U+OA1bDwT/Zyn6tKBfo2Mlmaz r1SGAaFD8nQUC+142NuzkdN1nfeeavIRToXSbCx27rl/wMsd1hN1RAsBaWvFBCXFvQaN KgXrjWXq4FVYdoyEIUUndmj4vwqel+mIByHda493xop4C175rqJ+SZ3lswZPvYvW8TwY Dqr2Zj4pEvNEp8eq8E62NffOv05zMqlSn99Lppzgel5Vf6X+49Ci8qK0vuuA4Qt2xTyu Cjbw== 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=w8EGSLixqNoWKfOaMCKgd+4bCaaZ1CVpZ6CvBl07EsE=; b=J/VwHAmQuK7XZJPTYsASQnFu50KzVXW8Afcrj4APmtVLNQrTYNTX1b9lODH4xJNj1R edyDvUDHBPtzfH6iPujJt0iM3YyN/Hu2/x6FEACUfdxiVtqBDVHVu8322TqrgCt6Mj1F PabzQ+dhXVXyzFUTInEyczfLulorfYHQOBxL03cPckCpWgb0o36AnC16AtcQ3RgYxI/2 b7MYfdY0u0fiYo5SJVstkItK4EE+4XvMzWlmTMeH+Q0QUtKBlur2f5w6/6r+MV7fZMiG XhJp1+AP76gKMuxAVMum0NXyDVPlYYinUcHUmu/z26yy1luxJtFnMMgBuDxxhD+l+hr1 QAKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Nj7ohTmi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id u8-20020a17090341c800b00151d046ad89si9575194ple.35.2022.03.11.14.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:58:36 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Nj7ohTmi; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 1C1D0336941; Fri, 11 Mar 2022 13:55:48 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245236AbiCJOeg (ORCPT + 99 others); Thu, 10 Mar 2022 09:34:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244475AbiCJO25 (ORCPT ); Thu, 10 Mar 2022 09:28:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7346BD21C6; Thu, 10 Mar 2022 06:24:02 -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 9D27EB81E9E; Thu, 10 Mar 2022 14:24:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3E5EC340F3; Thu, 10 Mar 2022 14:23:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646922239; bh=ek27sDL8nRpw3Td5eid2CXK/8pNndPVGVVLB+34CqUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nj7ohTmin9Uh+t1V8vCOd3KCln93YzPj9AOKGxw1eYNLLm+uqlCqLel/rur7CWgDu pbzdoeuyjDYvhHBOygGYRaeSTivr5Rbz3Kdo4L6+st73JBSYkgVZ3QzaQJWnu6K0Rn fkNMlGS/QUSO4/0eDIO0dSV3vuGHY1oO2PbJA1wY= 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 5.10 04/58] Documentation/hw-vuln: Update spectre doc Date: Thu, 10 Mar 2022 15:18:24 +0100 Message-Id: <20220310140812.998038010@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310140812.869208747@linuxfoundation.org> References: <20220310140812.869208747@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: 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 5.10] 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 @@ -4957,8 +4957,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.