Skip to content

Commit

Permalink
ACK: Merge tag v4.19.252 of android-4.19-stable
Browse files Browse the repository at this point in the history
• Android Common Kernel Source: https://android.googlesource.com/kernel/common
• Branch: android-4.19-stable

• Commit log (7273 commits):
  FROMGIT: arm64: fix oops in concurrently setting insn_emulation sysctls
  ANDROID: cgroup: Fix for a partially backported patch
  ANDROID: allow add_hwgenerator_randomness() from non-kthread
  Linux 4.19.252
  dmaengine: ti: Add missing put_device in ti_dra7_xbar_route_allocate
  dmaengine: ti: Fix refcount leak in ti_dra7_xbar_route_allocate
  dmaengine: at_xdma: handle errors of at_xdmac_alloc_desc() correctly
  dmaengine: pl330: Fix lockdep warning about non-static key
  ida: don't use BUG_ON() for debugging
  misc: rtsx_usb: set return value in rsp_buf alloc err path
  misc: rtsx_usb: use separate command and response buffers
  misc: rtsx_usb: fix use of dma mapped buffer for usb bulk transfer
  i2c: cadence: Unregister the clk notifier in error path
  selftests: forwarding: fix error message in learning_test
  selftests: forwarding: fix learning_test when h1 supports IFF_UNICAST_FLT
  selftests: forwarding: fix flood_unicast_test when h2 supports IFF_UNICAST_FLT
  ibmvnic: Properly dispose of all skbs during a failover.
  ARM: at91: pm: use proper compatible for sama5d2's rtc
  pinctrl: sunxi: a83t: Fix NAND function name for some pins
  ARM: meson: Fix refcount leak in meson_smp_prepare_cpus
  ...

• Conflicts:
       Documentation/devicetree/bindings/gpio/gpio-altera.txt
       Documentation/devicetree/bindings/mtd/gpmc-nand.txt
       Documentation/devicetree/bindings/net/btusb.txt
       Documentation/devicetree/bindings/net/nfc/nxp-nci.txt
       Documentation/devicetree/bindings/net/nfc/pn544.txt
       Documentation/devicetree/bindings/pinctrl/marvell,armada-37xx-pinctrl.txt
       Documentation/devicetree/bindings/regulator/samsung,s5m8767.txt
       Documentation/devicetree/bindings~HEAD
       arch/Kconfig
       arch/arm/Makefile
       arch/arm64/Kconfig
       arch/arm64/include/asm/cpucaps.h
       arch/arm64/kernel/cpu_errata.c
       arch/arm64/kernel/cpufeature.c
       block/bfq-iosched.c
       block/elevator.c
       drivers/base/core.c
       drivers/block/zram/zram_drv.c
       drivers/char/Kconfig
       drivers/clk/clk.c
       drivers/dma-buf/dma-buf.c
       drivers/hid/hid-ids.h
       drivers/hid/hid-quirks.c
       drivers/iio/adc/qcom-spmi-vadc.c
       drivers/irqchip/irq-gic-v3.c
       drivers/irqchip/qcom-pdc.c
       drivers/md/dm-verity-fec.c
       drivers/md/dm-verity-target.c
       drivers/media/dvb-core/dmxdev.c
       drivers/mmc/core/block.c
       drivers/mmc/core/core.h
       drivers/mmc/core/host.c
       drivers/mmc/core/mmc.c
       drivers/mmc/core/mmc_ops.c
       drivers/mmc/core/queue.c
       drivers/mmc/host/cqhci.c
       drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
       drivers/nfc/st21nfca/se.c
       drivers/nvmem/core.c
       drivers/scsi/ufs/ufshcd.c
       drivers/slimbus/messaging.c
       drivers/slimbus/qcom-ctrl.c
       drivers/slimbus/qcom-ngd-ctrl.c
       drivers/soc/qcom/smp2p.c
       drivers/staging/android/ion/ion.c
       drivers/usb/core/hub.c
       drivers/usb/dwc3/core.c
       drivers/usb/dwc3/debugfs.c
       drivers/usb/dwc3/gadget.c
       drivers/usb/gadget/configfs.c
       drivers/usb/gadget/function/f_accessory.c
       drivers/usb/gadget/function/f_fs.c
       drivers/usb/gadget/function/f_hid.c
       drivers/usb/gadget/function/f_uac1.c
       drivers/usb/gadget/function/f_uac2.c
       drivers/usb/host/xhci.c
       drivers/usb/host/xhci.h
       fs/file_table.c
       fs/incfs/main.c
       include/linux/psi_types.h
       include/linux/sched.h
       include/linux/usb/usbnet.h
       include/trace/events/f2fs.h
       kernel/cpu.c
       kernel/exit.c
       kernel/futex.c
       kernel/locking/lockdep.c
       kernel/power/qos.c
       kernel/sched/cpufreq_schedutil.c
       kernel/sched/fair.c
       kernel/sched/psi.c
       kernel/time/hrtimer.c
       kernel/workqueue.c
       mm/filemap.c
       mm/memory.c
       mm/page_alloc.c
       net/ipv4/tcp_ipv4.c
       net/ipv4/tcp_timer.c
       net/ipv6/tcp_ipv6.c
       net/qrtr/qrtr.c
       net/sctp/input.c
       net/unix/scm.c
       net/wireless/core.c
       security/selinux/avc.c
       sound/core/pcm_native.c

Change-Id: I703b76be961b534879f9acc77fcd4c1d9d46f8a9
Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
  • Loading branch information
Tashar02 committed Jul 28, 2022
2 parents 70df605 + 5d2c9fe commit a32dee2
Show file tree
Hide file tree
Showing 4,838 changed files with 169,788 additions and 103,338 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 9 additions & 3 deletions Documentation/ABI/stable/sysfs-bus-vmbus
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ What: /sys/bus/vmbus/devices/<UUID>/channels/<N>/latency
Date: September. 2017
KernelVersion: 4.14
Contact: Stephen Hemminger <[email protected]>
Description: Channel signaling latency
Description: Channel signaling latency. This file is available only for
performance critical channels (storage, network, etc.) that use
the monitor page mechanism.
Users: Debugging tools

What: /sys/bus/vmbus/devices/<UUID>/channels/<N>/out_mask
Expand All @@ -95,7 +97,9 @@ What: /sys/bus/vmbus/devices/<UUID>/channels/<N>/pending
Date: September. 2017
KernelVersion: 4.14
Contact: Stephen Hemminger <[email protected]>
Description: Channel interrupt pending state
Description: Channel interrupt pending state. This file is available only for
performance critical channels (storage, network, etc.) that use
the monitor page mechanism.
Users: Debugging tools

What: /sys/bus/vmbus/devices/<UUID>/channels/<N>/read_avail
Expand Down Expand Up @@ -137,7 +141,9 @@ What: /sys/bus/vmbus/devices/<UUID>/channels/<N>/monitor_id
Date: January. 2018
KernelVersion: 4.16
Contact: Stephen Hemminger <[email protected]>
Description: Monitor bit associated with channel
Description: Monitor bit associated with channel. This file is available only
for performance critical channels (storage, network, etc.) that
use the monitor page mechanism.
Users: Debugging tools and userspace drivers

What: /sys/bus/vmbus/devices/<UUID>/channels/<N>/ring
Expand Down
26 changes: 24 additions & 2 deletions Documentation/ABI/testing/evm
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,30 @@ Description:
modification of EVM-protected metadata and
disable all further modification of policy

Note that once a key has been loaded, it will no longer be
possible to enable metadata modification.
Echoing a value is additive, the new value is added to the
existing initialization flags.

For example, after::

echo 2 ><securityfs>/evm

another echo can be performed::

echo 1 ><securityfs>/evm

and the resulting value will be 3.

Note that once an HMAC key has been loaded, it will no longer
be possible to enable metadata modification. Signaling that an
HMAC key has been loaded will clear the corresponding flag.
For example, if the current value is 6 (2 and 4 set)::

echo 1 ><securityfs>/evm

will set the new value to 3 (4 cleared).

Loading an HMAC key is the only way to disable metadata
modification.

Until key loading has been signaled EVM can not create
or validate the 'security.evm' xattr, but returns
Expand Down
11 changes: 6 additions & 5 deletions Documentation/ABI/testing/sysfs-ata
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ Description:
described in ATA8 7.16 and 7.17. Only valid if
the device is not a PM.

pio_mode: (RO) Transfer modes supported by the device when
in PIO mode. Mostly used by PATA device.
pio_mode: (RO) PIO transfer mode used by the device.
Mostly used by PATA devices.

xfer_mode: (RO) Current transfer mode
xfer_mode: (RO) Current transfer mode. Mostly used by
PATA devices.

dma_mode: (RO) Transfer modes supported by the device when
in DMA mode. Mostly used by PATA device.
dma_mode: (RO) DMA transfer mode used by the device.
Mostly used by PATA devices.

class: (RO) Device class. Can be "ata" for disk,
"atapi" for packet device, "pmp" for PM, or
Expand Down
2 changes: 1 addition & 1 deletion Documentation/ABI/testing/sysfs-bus-iio-vf610
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
What: /sys/bus/iio/devices/iio:deviceX/conversion_mode
What: /sys/bus/iio/devices/iio:deviceX/in_conversion_mode
KernelVersion: 4.2
Contact: [email protected]
Description:
Expand Down
1 change: 1 addition & 0 deletions Documentation/ABI/testing/sysfs-devices-system-cpu
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ What: /sys/devices/system/cpu/vulnerabilities
/sys/devices/system/cpu/vulnerabilities/srbds
/sys/devices/system/cpu/vulnerabilities/tsx_async_abort
/sys/devices/system/cpu/vulnerabilities/itlb_multihit
/sys/devices/system/cpu/vulnerabilities/mmio_stale_data
Date: January 2018
Contact: Linux kernel mailing list <[email protected]>
Description: Information about CPU vulnerabilities
Expand Down
6 changes: 3 additions & 3 deletions Documentation/admin-guide/devices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2993,10 +2993,10 @@
65 = /dev/infiniband/issm1 Second InfiniBand IsSM device
...
127 = /dev/infiniband/issm63 63rd InfiniBand IsSM device
128 = /dev/infiniband/uverbs0 First InfiniBand verbs device
129 = /dev/infiniband/uverbs1 Second InfiniBand verbs device
192 = /dev/infiniband/uverbs0 First InfiniBand verbs device
193 = /dev/infiniband/uverbs1 Second InfiniBand verbs device
...
159 = /dev/infiniband/uverbs31 31st InfiniBand verbs device
223 = /dev/infiniband/uverbs31 31st InfiniBand verbs device

232 char Biometric Devices
0 = /dev/biometric/sensor0/fingerprint first fingerprint sensor on first device
Expand Down
1 change: 1 addition & 0 deletions Documentation/admin-guide/hw-vuln/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ are configurable at compile, boot or run time.
tsx_async_abort
multihit.rst
special-register-buffer-data-sampling.rst
processor_mmio_stale_data.rst
246 changes: 246 additions & 0 deletions Documentation/admin-guide/hw-vuln/processor_mmio_stale_data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
=========================================
Processor MMIO Stale Data Vulnerabilities
=========================================

Processor MMIO Stale Data Vulnerabilities are a class of memory-mapped I/O
(MMIO) vulnerabilities that can expose data. The sequences of operations for
exposing data range from simple to very complex. Because most of the
vulnerabilities require the attacker to have access to MMIO, many environments
are not affected. System environments using virtualization where MMIO access is
provided to untrusted guests may need mitigation. These vulnerabilities are
not transient execution attacks. However, these vulnerabilities may propagate
stale data into core fill buffers where the data can subsequently be inferred
by an unmitigated transient execution attack. Mitigation for these
vulnerabilities includes a combination of microcode update and software
changes, depending on the platform and usage model. Some of these mitigations
are similar to those used to mitigate Microarchitectural Data Sampling (MDS) or
those used to mitigate Special Register Buffer Data Sampling (SRBDS).

Data Propagators
================
Propagators are operations that result in stale data being copied or moved from
one microarchitectural buffer or register to another. Processor MMIO Stale Data
Vulnerabilities are operations that may result in stale data being directly
read into an architectural, software-visible state or sampled from a buffer or
register.

Fill Buffer Stale Data Propagator (FBSDP)
-----------------------------------------
Stale data may propagate from fill buffers (FB) into the non-coherent portion
of the uncore on some non-coherent writes. Fill buffer propagation by itself
does not make stale data architecturally visible. Stale data must be propagated
to a location where it is subject to reading or sampling.

Sideband Stale Data Propagator (SSDP)
-------------------------------------
The sideband stale data propagator (SSDP) is limited to the client (including
Intel Xeon server E3) uncore implementation. The sideband response buffer is
shared by all client cores. For non-coherent reads that go to sideband
destinations, the uncore logic returns 64 bytes of data to the core, including
both requested data and unrequested stale data, from a transaction buffer and
the sideband response buffer. As a result, stale data from the sideband
response and transaction buffers may now reside in a core fill buffer.

Primary Stale Data Propagator (PSDP)
------------------------------------
The primary stale data propagator (PSDP) is limited to the client (including
Intel Xeon server E3) uncore implementation. Similar to the sideband response
buffer, the primary response buffer is shared by all client cores. For some
processors, MMIO primary reads will return 64 bytes of data to the core fill
buffer including both requested data and unrequested stale data. This is
similar to the sideband stale data propagator.

Vulnerabilities
===============
Device Register Partial Write (DRPW) (CVE-2022-21166)
-----------------------------------------------------
Some endpoint MMIO registers incorrectly handle writes that are smaller than
the register size. Instead of aborting the write or only copying the correct
subset of bytes (for example, 2 bytes for a 2-byte write), more bytes than
specified by the write transaction may be written to the register. On
processors affected by FBSDP, this may expose stale data from the fill buffers
of the core that created the write transaction.

Shared Buffers Data Sampling (SBDS) (CVE-2022-21125)
----------------------------------------------------
After propagators may have moved data around the uncore and copied stale data
into client core fill buffers, processors affected by MFBDS can leak data from
the fill buffer. It is limited to the client (including Intel Xeon server E3)
uncore implementation.

Shared Buffers Data Read (SBDR) (CVE-2022-21123)
------------------------------------------------
It is similar to Shared Buffer Data Sampling (SBDS) except that the data is
directly read into the architectural software-visible state. It is limited to
the client (including Intel Xeon server E3) uncore implementation.

Affected Processors
===================
Not all the CPUs are affected by all the variants. For instance, most
processors for the server market (excluding Intel Xeon E3 processors) are
impacted by only Device Register Partial Write (DRPW).

Below is the list of affected Intel processors [#f1]_:

=================== ============ =========
Common name Family_Model Steppings
=================== ============ =========
HASWELL_X 06_3FH 2,4
SKYLAKE_L 06_4EH 3
BROADWELL_X 06_4FH All
SKYLAKE_X 06_55H 3,4,6,7,11
BROADWELL_D 06_56H 3,4,5
SKYLAKE 06_5EH 3
ICELAKE_X 06_6AH 4,5,6
ICELAKE_D 06_6CH 1
ICELAKE_L 06_7EH 5
ATOM_TREMONT_D 06_86H All
LAKEFIELD 06_8AH 1
KABYLAKE_L 06_8EH 9 to 12
ATOM_TREMONT 06_96H 1
ATOM_TREMONT_L 06_9CH 0
KABYLAKE 06_9EH 9 to 13
COMETLAKE 06_A5H 2,3,5
COMETLAKE_L 06_A6H 0,1
ROCKETLAKE 06_A7H 1
=================== ============ =========

If a CPU is in the affected processor list, but not affected by a variant, it
is indicated by new bits in MSR IA32_ARCH_CAPABILITIES. As described in a later
section, mitigation largely remains the same for all the variants, i.e. to
clear the CPU fill buffers via VERW instruction.

New bits in MSRs
================
Newer processors and microcode update on existing affected processors added new
bits to IA32_ARCH_CAPABILITIES MSR. These bits can be used to enumerate
specific variants of Processor MMIO Stale Data vulnerabilities and mitigation
capability.

MSR IA32_ARCH_CAPABILITIES
--------------------------
Bit 13 - SBDR_SSDP_NO - When set, processor is not affected by either the
Shared Buffers Data Read (SBDR) vulnerability or the sideband stale
data propagator (SSDP).
Bit 14 - FBSDP_NO - When set, processor is not affected by the Fill Buffer
Stale Data Propagator (FBSDP).
Bit 15 - PSDP_NO - When set, processor is not affected by Primary Stale Data
Propagator (PSDP).
Bit 17 - FB_CLEAR - When set, VERW instruction will overwrite CPU fill buffer
values as part of MD_CLEAR operations. Processors that do not
enumerate MDS_NO (meaning they are affected by MDS) but that do
enumerate support for both L1D_FLUSH and MD_CLEAR implicitly enumerate
FB_CLEAR as part of their MD_CLEAR support.
Bit 18 - FB_CLEAR_CTRL - Processor supports read and write to MSR
IA32_MCU_OPT_CTRL[FB_CLEAR_DIS]. On such processors, the FB_CLEAR_DIS
bit can be set to cause the VERW instruction to not perform the
FB_CLEAR action. Not all processors that support FB_CLEAR will support
FB_CLEAR_CTRL.

MSR IA32_MCU_OPT_CTRL
---------------------
Bit 3 - FB_CLEAR_DIS - When set, VERW instruction does not perform the FB_CLEAR
action. This may be useful to reduce the performance impact of FB_CLEAR in
cases where system software deems it warranted (for example, when performance
is more critical, or the untrusted software has no MMIO access). Note that
FB_CLEAR_DIS has no impact on enumeration (for example, it does not change
FB_CLEAR or MD_CLEAR enumeration) and it may not be supported on all processors
that enumerate FB_CLEAR.

Mitigation
==========
Like MDS, all variants of Processor MMIO Stale Data vulnerabilities have the
same mitigation strategy to force the CPU to clear the affected buffers before
an attacker can extract the secrets.

This is achieved by using the otherwise unused and obsolete VERW instruction in
combination with a microcode update. The microcode clears the affected CPU
buffers when the VERW instruction is executed.

Kernel reuses the MDS function to invoke the buffer clearing:

mds_clear_cpu_buffers()

On MDS affected CPUs, the kernel already invokes CPU buffer clear on
kernel/userspace, hypervisor/guest and C-state (idle) transitions. No
additional mitigation is needed on such CPUs.

For CPUs not affected by MDS or TAA, mitigation is needed only for the attacker
with MMIO capability. Therefore, VERW is not required for kernel/userspace. For
virtualization case, VERW is only needed at VMENTER for a guest with MMIO
capability.

Mitigation points
-----------------
Return to user space
^^^^^^^^^^^^^^^^^^^^
Same mitigation as MDS when affected by MDS/TAA, otherwise no mitigation
needed.

C-State transition
^^^^^^^^^^^^^^^^^^
Control register writes by CPU during C-state transition can propagate data
from fill buffer to uncore buffers. Execute VERW before C-state transition to
clear CPU fill buffers.

Guest entry point
^^^^^^^^^^^^^^^^^
Same mitigation as MDS when processor is also affected by MDS/TAA, otherwise
execute VERW at VMENTER only for MMIO capable guests. On CPUs not affected by
MDS/TAA, guest without MMIO access cannot extract secrets using Processor MMIO
Stale Data vulnerabilities, so there is no need to execute VERW for such guests.

Mitigation control on the kernel command line
---------------------------------------------
The kernel command line allows to control the Processor MMIO Stale Data
mitigations at boot time with the option "mmio_stale_data=". The valid
arguments for this option are:

========== =================================================================
full If the CPU is vulnerable, enable mitigation; CPU buffer clearing
on exit to userspace and when entering a VM. Idle transitions are
protected as well. It does not automatically disable SMT.
full,nosmt Same as full, with SMT disabled on vulnerable CPUs. This is the
complete mitigation.
off Disables mitigation completely.
========== =================================================================

If the CPU is affected and mmio_stale_data=off is not supplied on the kernel
command line, then the kernel selects the appropriate mitigation.

Mitigation status information
-----------------------------
The Linux kernel provides a sysfs interface to enumerate the current
vulnerability status of the system: whether the system is vulnerable, and
which mitigations are active. The relevant sysfs file is:

/sys/devices/system/cpu/vulnerabilities/mmio_stale_data

The possible values in this file are:

.. list-table::

* - 'Not affected'
- The processor is not vulnerable
* - 'Vulnerable'
- The processor is vulnerable, but no mitigation enabled
* - 'Vulnerable: Clear CPU buffers attempted, no microcode'
- The processor is vulnerable, but microcode is not updated. The
mitigation is enabled on a best effort basis.
* - 'Mitigation: Clear CPU buffers'
- The processor is vulnerable and the CPU buffer clearing mitigation is
enabled.

If the processor is vulnerable then the following information is appended to
the above information:

======================== ===========================================
'SMT vulnerable' SMT is enabled
'SMT disabled' SMT is disabled
'SMT Host state unknown' Kernel runs in a VM, Host SMT state unknown
======================== ===========================================

References
----------
.. [#f1] Affected Processors
https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html
Loading

0 comments on commit a32dee2

Please sign in to comment.