Skip to content

Commit 6ac7abb

Browse files
committed
Merge tag 'rolling-lts/wsl/5.15.167.4' into linux-msft-wsl-5.15.y
Signed-off-by: Mitchell Levy <[email protected]>
2 parents 33cad98 + 3b1eeb4 commit 6ac7abb

File tree

2,264 files changed

+34691
-19298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,264 files changed

+34691
-19298
lines changed

Documentation/ABI/testing/sysfs-devices-system-cpu

+1
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ What: /sys/devices/system/cpu/vulnerabilities
517517
/sys/devices/system/cpu/vulnerabilities/mds
518518
/sys/devices/system/cpu/vulnerabilities/meltdown
519519
/sys/devices/system/cpu/vulnerabilities/mmio_stale_data
520+
/sys/devices/system/cpu/vulnerabilities/reg_file_data_sampling
520521
/sys/devices/system/cpu/vulnerabilities/retbleed
521522
/sys/devices/system/cpu/vulnerabilities/spec_store_bypass
522523
/sys/devices/system/cpu/vulnerabilities/spectre_v1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
====================================
4+
File system Monitoring with fanotify
5+
====================================
6+
7+
File system Error Reporting
8+
===========================
9+
10+
Fanotify supports the FAN_FS_ERROR event type for file system-wide error
11+
reporting. It is meant to be used by file system health monitoring
12+
daemons, which listen for these events and take actions (notify
13+
sysadmin, start recovery) when a file system problem is detected.
14+
15+
By design, a FAN_FS_ERROR notification exposes sufficient information
16+
for a monitoring tool to know a problem in the file system has happened.
17+
It doesn't necessarily provide a user space application with semantics
18+
to verify an IO operation was successfully executed. That is out of
19+
scope for this feature. Instead, it is only meant as a framework for
20+
early file system problem detection and reporting recovery tools.
21+
22+
When a file system operation fails, it is common for dozens of kernel
23+
errors to cascade after the initial failure, hiding the original failure
24+
log, which is usually the most useful debug data to troubleshoot the
25+
problem. For this reason, FAN_FS_ERROR tries to report only the first
26+
error that occurred for a file system since the last notification, and
27+
it simply counts additional errors. This ensures that the most
28+
important pieces of information are never lost.
29+
30+
FAN_FS_ERROR requires the fanotify group to be setup with the
31+
FAN_REPORT_FID flag.
32+
33+
At the time of this writing, the only file system that emits FAN_FS_ERROR
34+
notifications is Ext4.
35+
36+
A FAN_FS_ERROR Notification has the following format::
37+
38+
::
39+
40+
[ Notification Metadata (Mandatory) ]
41+
[ Generic Error Record (Mandatory) ]
42+
[ FID record (Mandatory) ]
43+
44+
The order of records is not guaranteed, and new records might be added
45+
in the future. Therefore, applications must not rely on the order and
46+
must be prepared to skip over unknown records. Please refer to
47+
``samples/fanotify/fs-monitor.c`` for an example parser.
48+
49+
Generic error record
50+
--------------------
51+
52+
The generic error record provides enough information for a file system
53+
agnostic tool to learn about a problem in the file system, without
54+
providing any additional details about the problem. This record is
55+
identified by ``struct fanotify_event_info_header.info_type`` being set
56+
to FAN_EVENT_INFO_TYPE_ERROR.
57+
58+
::
59+
60+
struct fanotify_event_info_error {
61+
struct fanotify_event_info_header hdr;
62+
__s32 error;
63+
__u32 error_count;
64+
};
65+
66+
The `error` field identifies the type of error using errno values.
67+
`error_count` tracks the number of errors that occurred and were
68+
suppressed to preserve the original error information, since the last
69+
notification.
70+
71+
FID record
72+
----------
73+
74+
The FID record can be used to uniquely identify the inode that triggered
75+
the error through the combination of fsid and file handle. A file system
76+
specific application can use that information to attempt a recovery
77+
procedure. Errors that are not related to an inode are reported with an
78+
empty file handle of type FILEID_INVALID.

Documentation/admin-guide/hw-vuln/core-scheduling.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ arg4:
6666
will be performed for all tasks in the task group of ``pid``.
6767

6868
arg5:
69-
userspace pointer to an unsigned long for storing the cookie returned by
70-
``PR_SCHED_CORE_GET`` command. Should be 0 for all other commands.
69+
userspace pointer to an unsigned long long for storing the cookie returned
70+
by ``PR_SCHED_CORE_GET`` command. Should be 0 for all other commands.
7171

7272
In order for a process to push a cookie to, or pull a cookie from a process, it
7373
is required to have the ptrace access mode: `PTRACE_MODE_READ_REALCREDS` to the

Documentation/admin-guide/hw-vuln/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ are configurable at compile, boot or run time.
2121
cross-thread-rsb.rst
2222
gather_data_sampling.rst
2323
srso
24+
reg-file-data-sampling
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
==================================
2+
Register File Data Sampling (RFDS)
3+
==================================
4+
5+
Register File Data Sampling (RFDS) is a microarchitectural vulnerability that
6+
only affects Intel Atom parts(also branded as E-cores). RFDS may allow
7+
a malicious actor to infer data values previously used in floating point
8+
registers, vector registers, or integer registers. RFDS does not provide the
9+
ability to choose which data is inferred. CVE-2023-28746 is assigned to RFDS.
10+
11+
Affected Processors
12+
===================
13+
Below is the list of affected Intel processors [#f1]_:
14+
15+
=================== ============
16+
Common name Family_Model
17+
=================== ============
18+
ATOM_GOLDMONT 06_5CH
19+
ATOM_GOLDMONT_D 06_5FH
20+
ATOM_GOLDMONT_PLUS 06_7AH
21+
ATOM_TREMONT_D 06_86H
22+
ATOM_TREMONT 06_96H
23+
ALDERLAKE 06_97H
24+
ALDERLAKE_L 06_9AH
25+
ATOM_TREMONT_L 06_9CH
26+
RAPTORLAKE 06_B7H
27+
RAPTORLAKE_P 06_BAH
28+
ALDERLAKE_N 06_BEH
29+
RAPTORLAKE_S 06_BFH
30+
=================== ============
31+
32+
As an exception to this table, Intel Xeon E family parts ALDERLAKE(06_97H) and
33+
RAPTORLAKE(06_B7H) codenamed Catlow are not affected. They are reported as
34+
vulnerable in Linux because they share the same family/model with an affected
35+
part. Unlike their affected counterparts, they do not enumerate RFDS_CLEAR or
36+
CPUID.HYBRID. This information could be used to distinguish between the
37+
affected and unaffected parts, but it is deemed not worth adding complexity as
38+
the reporting is fixed automatically when these parts enumerate RFDS_NO.
39+
40+
Mitigation
41+
==========
42+
Intel released a microcode update that enables software to clear sensitive
43+
information using the VERW instruction. Like MDS, RFDS deploys the same
44+
mitigation strategy to force the CPU to clear the affected buffers before an
45+
attacker can extract the secrets. This is achieved by using the otherwise
46+
unused and obsolete VERW instruction in combination with a microcode update.
47+
The microcode clears the affected CPU buffers when the VERW instruction is
48+
executed.
49+
50+
Mitigation points
51+
-----------------
52+
VERW is executed by the kernel before returning to user space, and by KVM
53+
before VMentry. None of the affected cores support SMT, so VERW is not required
54+
at C-state transitions.
55+
56+
New bits in IA32_ARCH_CAPABILITIES
57+
----------------------------------
58+
Newer processors and microcode update on existing affected processors added new
59+
bits to IA32_ARCH_CAPABILITIES MSR. These bits can be used to enumerate
60+
vulnerability and mitigation capability:
61+
62+
- Bit 27 - RFDS_NO - When set, processor is not affected by RFDS.
63+
- Bit 28 - RFDS_CLEAR - When set, processor is affected by RFDS, and has the
64+
microcode that clears the affected buffers on VERW execution.
65+
66+
Mitigation control on the kernel command line
67+
---------------------------------------------
68+
The kernel command line allows to control RFDS mitigation at boot time with the
69+
parameter "reg_file_data_sampling=". The valid arguments are:
70+
71+
========== =================================================================
72+
on If the CPU is vulnerable, enable mitigation; CPU buffer clearing
73+
on exit to userspace and before entering a VM.
74+
off Disables mitigation.
75+
========== =================================================================
76+
77+
Mitigation default is selected by CONFIG_MITIGATION_RFDS.
78+
79+
Mitigation status information
80+
-----------------------------
81+
The Linux kernel provides a sysfs interface to enumerate the current
82+
vulnerability status of the system: whether the system is vulnerable, and
83+
which mitigations are active. The relevant sysfs file is:
84+
85+
/sys/devices/system/cpu/vulnerabilities/reg_file_data_sampling
86+
87+
The possible values in this file are:
88+
89+
.. list-table::
90+
91+
* - 'Not affected'
92+
- The processor is not vulnerable
93+
* - 'Vulnerable'
94+
- The processor is vulnerable, but no mitigation enabled
95+
* - 'Vulnerable: No microcode'
96+
- The processor is vulnerable but microcode is not updated.
97+
* - 'Mitigation: Clear Register File'
98+
- The processor is vulnerable and the CPU buffer clearing mitigation is
99+
enabled.
100+
101+
References
102+
----------
103+
.. [#f1] Affected Processors
104+
https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html

Documentation/admin-guide/hw-vuln/spectre.rst

+50-12
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,10 @@ associated with the source address of the indirect branch. Specifically,
138138
the BHB might be shared across privilege levels even in the presence of
139139
Enhanced IBRS.
140140

141-
Currently the only known real-world BHB attack vector is via
142-
unprivileged eBPF. Therefore, it's highly recommended to not enable
143-
unprivileged eBPF, especially when eIBRS is used (without retpolines).
144-
For a full mitigation against BHB attacks, it's recommended to use
145-
retpolines (or eIBRS combined with retpolines).
141+
Previously the only known real-world BHB attack vector was via unprivileged
142+
eBPF. Further research has found attacks that don't require unprivileged eBPF.
143+
For a full mitigation against BHB attacks it is recommended to set BHI_DIS_S or
144+
use the BHB clearing sequence.
146145

147146
Attack scenarios
148147
----------------
@@ -430,6 +429,23 @@ The possible values in this file are:
430429
'PBRSB-eIBRS: Not affected' CPU is not affected by PBRSB
431430
=========================== =======================================================
432431

432+
- Branch History Injection (BHI) protection status:
433+
434+
.. list-table::
435+
436+
* - BHI: Not affected
437+
- System is not affected
438+
* - BHI: Retpoline
439+
- System is protected by retpoline
440+
* - BHI: BHI_DIS_S
441+
- System is protected by BHI_DIS_S
442+
* - BHI: SW loop, KVM SW loop
443+
- System is protected by software clearing sequence
444+
* - BHI: Vulnerable
445+
- System is vulnerable to BHI
446+
* - BHI: Vulnerable, KVM: SW loop
447+
- System is vulnerable; KVM is protected by software clearing sequence
448+
433449
Full mitigation might require a microcode update from the CPU
434450
vendor. When the necessary microcode is not available, the kernel will
435451
report vulnerability.
@@ -484,11 +500,18 @@ Spectre variant 2
484500

485501
Systems which support enhanced IBRS (eIBRS) enable IBRS protection once at
486502
boot, by setting the IBRS bit, and they're automatically protected against
487-
Spectre v2 variant attacks, including cross-thread branch target injections
488-
on SMT systems (STIBP). In other words, eIBRS enables STIBP too.
503+
some Spectre v2 variant attacks. The BHB can still influence the choice of
504+
indirect branch predictor entry, and although branch predictor entries are
505+
isolated between modes when eIBRS is enabled, the BHB itself is not isolated
506+
between modes. Systems which support BHI_DIS_S will set it to protect against
507+
BHI attacks.
489508

490-
Legacy IBRS systems clear the IBRS bit on exit to userspace and
491-
therefore explicitly enable STIBP for that
509+
On Intel's enhanced IBRS systems, this includes cross-thread branch target
510+
injections on SMT systems (STIBP). In other words, Intel eIBRS enables
511+
STIBP, too.
512+
513+
AMD Automatic IBRS does not protect userspace, and Legacy IBRS systems clear
514+
the IBRS bit on exit to userspace, therefore both explicitly enable STIBP.
492515

493516
The retpoline mitigation is turned on by default on vulnerable
494517
CPUs. It can be forced on or off by the administrator
@@ -622,9 +645,10 @@ kernel command line.
622645
retpoline,generic Retpolines
623646
retpoline,lfence LFENCE; indirect branch
624647
retpoline,amd alias for retpoline,lfence
625-
eibrs enhanced IBRS
626-
eibrs,retpoline enhanced IBRS + Retpolines
627-
eibrs,lfence enhanced IBRS + LFENCE
648+
eibrs Enhanced/Auto IBRS
649+
eibrs,retpoline Enhanced/Auto IBRS + Retpolines
650+
eibrs,lfence Enhanced/Auto IBRS + LFENCE
651+
ibrs use IBRS to protect kernel
628652

629653
Not specifying this option is equivalent to
630654
spectre_v2=auto.
@@ -684,6 +708,20 @@ For user space mitigation:
684708
spectre_v2=off. Spectre variant 1 mitigations
685709
cannot be disabled.
686710

711+
spectre_bhi=
712+
713+
[X86] Control mitigation of Branch History Injection
714+
(BHI) vulnerability. This setting affects the deployment
715+
of the HW BHI control and the SW BHB clearing sequence.
716+
717+
on
718+
(default) Enable the HW or SW mitigation as
719+
needed.
720+
off
721+
Disable the mitigation.
722+
723+
For spectre_v2_user see Documentation/admin-guide/kernel-parameters.txt
724+
687725
Mitigation selection guide
688726
--------------------------
689727

Documentation/admin-guide/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ configure specific aspects of kernel behavior to your liking.
8282
edid
8383
efi-stub
8484
ext4
85+
filesystem-monitoring
8586
nfs/index
8687
gpio/index
8788
highuid

0 commit comments

Comments
 (0)