Commit 675f176b authored by David S. Miller's avatar David S. Miller
Browse files

Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net



Some of the devlink bits were tricky, but I think I got it right.

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 84cb1b53 ec35307e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ Aleksey Gorelov <aleksey_gorelov@phoenix.com>
Alexander Lobakin <alobakin@pm.me> <alobakin@dlink.ru>
Alexander Lobakin <alobakin@pm.me> <alobakin@marvell.com>
Alexander Lobakin <alobakin@pm.me> <bloodyreaper@yandex.ru>
Alexander Mikhalitsyn <alexander@mihalicyn.com> <alexander.mikhalitsyn@virtuozzo.com>
Alexander Mikhalitsyn <alexander@mihalicyn.com> <aleksandr.mikhalitsyn@canonical.com>
Alexandre Belloni <alexandre.belloni@bootlin.com> <alexandre.belloni@free-electrons.com>
Alexei Starovoitov <ast@kernel.org> <alexei.starovoitov@gmail.com>
Alexei Starovoitov <ast@kernel.org> <ast@fb.com>
+92 −0
Original line number Diff line number Diff line

.. SPDX-License-Identifier: GPL-2.0

Cross-Thread Return Address Predictions
=======================================

Certain AMD and Hygon processors are subject to a cross-thread return address
predictions vulnerability. When running in SMT mode and one sibling thread
transitions out of C0 state, the other sibling thread could use return target
predictions from the sibling thread that transitioned out of C0.

The Spectre v2 mitigations protect the Linux kernel, as it fills the return
address prediction entries with safe targets when context switching to the idle
thread. However, KVM does allow a VMM to prevent exiting guest mode when
transitioning out of C0. This could result in a guest-controlled return target
being consumed by the sibling thread.

Affected processors
-------------------

The following CPUs are vulnerable:

    - AMD Family 17h processors
    - Hygon Family 18h processors

Related CVEs
------------

The following CVE entry is related to this issue:

   ==============  =======================================
   CVE-2022-27672  Cross-Thread Return Address Predictions
   ==============  =======================================

Problem
-------

Affected SMT-capable processors support 1T and 2T modes of execution when SMT
is enabled. In 2T mode, both threads in a core are executing code. For the
processor core to enter 1T mode, it is required that one of the threads
requests to transition out of the C0 state. This can be communicated with the
HLT instruction or with an MWAIT instruction that requests non-C0.
When the thread re-enters the C0 state, the processor transitions back
to 2T mode, assuming the other thread is also still in C0 state.

In affected processors, the return address predictor (RAP) is partitioned
depending on the SMT mode. For instance, in 2T mode each thread uses a private
16-entry RAP, but in 1T mode, the active thread uses a 32-entry RAP. Upon
transition between 1T/2T mode, the RAP contents are not modified but the RAP
pointers (which control the next return target to use for predictions) may
change. This behavior may result in return targets from one SMT thread being
used by RET predictions in the sibling thread following a 1T/2T switch. In
particular, a RET instruction executed immediately after a transition to 1T may
use a return target from the thread that just became idle. In theory, this
could lead to information disclosure if the return targets used do not come
from trustworthy code.

Attack scenarios
----------------

An attack can be mounted on affected processors by performing a series of CALL
instructions with targeted return locations and then transitioning out of C0
state.

Mitigation mechanism
--------------------

Before entering idle state, the kernel context switches to the idle thread. The
context switch fills the RAP entries (referred to as the RSB in Linux) with safe
targets by performing a sequence of CALL instructions.

Prevent a guest VM from directly putting the processor into an idle state by
intercepting HLT and MWAIT instructions.

Both mitigations are required to fully address this issue.

Mitigation control on the kernel command line
---------------------------------------------

Use existing Spectre v2 mitigations that will fill the RSB on context switch.

Mitigation control for KVM - module parameter
---------------------------------------------

By default, the KVM hypervisor mitigates this issue by intercepting guest
attempts to transition out of C0. A VMM can use the KVM_CAP_X86_DISABLE_EXITS
capability to override those interceptions, but since this is not common, the
mitigation that covers this path is not enabled by default.

The mitigation for the KVM_CAP_X86_DISABLE_EXITS capability can be turned on
using the boolean module parameter mitigate_smt_rsb, e.g.:
        kvm.mitigate_smt_rsb=1
+1 −0
Original line number Diff line number Diff line
@@ -18,3 +18,4 @@ are configurable at compile, boot or run time.
   core-scheduling.rst
   l1d_flush.rst
   processor_mmio_stale_data.rst
   cross-thread-rsb.rst
+8 −10
Original line number Diff line number Diff line
@@ -16135,7 +16135,7 @@ F: drivers/pci/controller/pci-v3-semi.c
PCI ENDPOINT SUBSYSTEM
M:	Lorenzo Pieralisi <lpieralisi@kernel.org>
R:	Krzysztof Wilczyński <kw@linux.com>
M:	Krzysztof Wilczyński <kw@linux.com>
R:	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
R:	Kishon Vijay Abraham I <kishon@kernel.org>
L:	linux-pci@vger.kernel.org
@@ -16143,7 +16143,7 @@ S: Supported
Q:	https://patchwork.kernel.org/project/linux-pci/list/
B:	https://bugzilla.kernel.org
C:	irc://irc.oftc.net/linux-pci
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git
F:	Documentation/PCI/endpoint/*
F:	Documentation/misc-devices/pci-endpoint-test.rst
F:	drivers/misc/pci_endpoint_test.c
@@ -16178,7 +16178,7 @@ S: Supported
Q:	https://patchwork.kernel.org/project/linux-pci/list/
B:	https://bugzilla.kernel.org
C:	irc://irc.oftc.net/linux-pci
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git
F:	Documentation/driver-api/pci/p2pdma.rst
F:	drivers/pci/p2pdma.c
F:	include/linux/pci-p2pdma.h
@@ -16200,14 +16200,14 @@ F: drivers/pci/controller/pci-xgene-msi.c
PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS
M:	Lorenzo Pieralisi <lpieralisi@kernel.org>
M:	Krzysztof Wilczyński <kw@linux.com>
R:	Rob Herring <robh@kernel.org>
R:	Krzysztof Wilczyński <kw@linux.com>
L:	linux-pci@vger.kernel.org
S:	Supported
Q:	https://patchwork.kernel.org/project/linux-pci/list/
B:	https://bugzilla.kernel.org
C:	irc://irc.oftc.net/linux-pci
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git
F:	Documentation/devicetree/bindings/pci/
F:	drivers/pci/controller/
F:	drivers/pci/pci-bridge-emul.c
@@ -16220,7 +16220,7 @@ S: Supported
Q:	https://patchwork.kernel.org/project/linux-pci/list/
B:	https://bugzilla.kernel.org
C:	irc://irc.oftc.net/linux-pci
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git
F:	Documentation/PCI/
F:	Documentation/devicetree/bindings/pci/
F:	arch/x86/kernel/early-quirks.c
@@ -20120,6 +20120,7 @@ F: drivers/watchdog/sunplus_wdt.c
SUPERH
M:	Yoshinori Sato <ysato@users.sourceforge.jp>
M:	Rich Felker <dalias@libc.org>
M:	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
L:	linux-sh@vger.kernel.org
S:	Maintained
Q:	http://patchwork.kernel.org/project/linux-sh/list/
@@ -20352,8 +20353,7 @@ S: Maintained
F:	drivers/platform/x86/system76_acpi.c
SYSV FILESYSTEM
M:	Christoph Hellwig <hch@infradead.org>
S:	Maintained
S:	Orphan
F:	Documentation/filesystems/sysv-fs.rst
F:	fs/sysv/
F:	include/linux/sysv_fs.h
@@ -21848,11 +21848,9 @@ W: http://en.wikipedia.org/wiki/Util-linux
T:	git git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
UUID HELPERS
M:	Christoph Hellwig <hch@lst.de>
R:	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
L:	linux-kernel@vger.kernel.org
S:	Maintained
T:	git git://git.infradead.org/users/hch/uuid.git
F:	include/linux/uuid.h
F:	include/uapi/linux/uuid.h
F:	lib/test_uuid.c
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
VERSION = 6
PATCHLEVEL = 2
SUBLEVEL = 0
EXTRAVERSION = -rc7
EXTRAVERSION = -rc8
NAME = Hurr durr I'ma ninja sloth

# *DOCUMENTATION*
Loading