-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'rolling-lts/wsl/5.15.167.4' into linux-msft-wsl-5.15.y
Signed-off-by: Mitchell Levy <[email protected]>
- Loading branch information
Showing
2,264 changed files
with
34,691 additions
and
19,298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
.. SPDX-License-Identifier: GPL-2.0 | ||
==================================== | ||
File system Monitoring with fanotify | ||
==================================== | ||
|
||
File system Error Reporting | ||
=========================== | ||
|
||
Fanotify supports the FAN_FS_ERROR event type for file system-wide error | ||
reporting. It is meant to be used by file system health monitoring | ||
daemons, which listen for these events and take actions (notify | ||
sysadmin, start recovery) when a file system problem is detected. | ||
|
||
By design, a FAN_FS_ERROR notification exposes sufficient information | ||
for a monitoring tool to know a problem in the file system has happened. | ||
It doesn't necessarily provide a user space application with semantics | ||
to verify an IO operation was successfully executed. That is out of | ||
scope for this feature. Instead, it is only meant as a framework for | ||
early file system problem detection and reporting recovery tools. | ||
|
||
When a file system operation fails, it is common for dozens of kernel | ||
errors to cascade after the initial failure, hiding the original failure | ||
log, which is usually the most useful debug data to troubleshoot the | ||
problem. For this reason, FAN_FS_ERROR tries to report only the first | ||
error that occurred for a file system since the last notification, and | ||
it simply counts additional errors. This ensures that the most | ||
important pieces of information are never lost. | ||
|
||
FAN_FS_ERROR requires the fanotify group to be setup with the | ||
FAN_REPORT_FID flag. | ||
|
||
At the time of this writing, the only file system that emits FAN_FS_ERROR | ||
notifications is Ext4. | ||
|
||
A FAN_FS_ERROR Notification has the following format:: | ||
|
||
:: | ||
|
||
[ Notification Metadata (Mandatory) ] | ||
[ Generic Error Record (Mandatory) ] | ||
[ FID record (Mandatory) ] | ||
|
||
The order of records is not guaranteed, and new records might be added | ||
in the future. Therefore, applications must not rely on the order and | ||
must be prepared to skip over unknown records. Please refer to | ||
``samples/fanotify/fs-monitor.c`` for an example parser. | ||
|
||
Generic error record | ||
-------------------- | ||
|
||
The generic error record provides enough information for a file system | ||
agnostic tool to learn about a problem in the file system, without | ||
providing any additional details about the problem. This record is | ||
identified by ``struct fanotify_event_info_header.info_type`` being set | ||
to FAN_EVENT_INFO_TYPE_ERROR. | ||
|
||
:: | ||
|
||
struct fanotify_event_info_error { | ||
struct fanotify_event_info_header hdr; | ||
__s32 error; | ||
__u32 error_count; | ||
}; | ||
|
||
The `error` field identifies the type of error using errno values. | ||
`error_count` tracks the number of errors that occurred and were | ||
suppressed to preserve the original error information, since the last | ||
notification. | ||
|
||
FID record | ||
---------- | ||
|
||
The FID record can be used to uniquely identify the inode that triggered | ||
the error through the combination of fsid and file handle. A file system | ||
specific application can use that information to attempt a recovery | ||
procedure. Errors that are not related to an inode are reported with an | ||
empty file handle of type FILEID_INVALID. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
================================== | ||
Register File Data Sampling (RFDS) | ||
================================== | ||
|
||
Register File Data Sampling (RFDS) is a microarchitectural vulnerability that | ||
only affects Intel Atom parts(also branded as E-cores). RFDS may allow | ||
a malicious actor to infer data values previously used in floating point | ||
registers, vector registers, or integer registers. RFDS does not provide the | ||
ability to choose which data is inferred. CVE-2023-28746 is assigned to RFDS. | ||
|
||
Affected Processors | ||
=================== | ||
Below is the list of affected Intel processors [#f1]_: | ||
|
||
=================== ============ | ||
Common name Family_Model | ||
=================== ============ | ||
ATOM_GOLDMONT 06_5CH | ||
ATOM_GOLDMONT_D 06_5FH | ||
ATOM_GOLDMONT_PLUS 06_7AH | ||
ATOM_TREMONT_D 06_86H | ||
ATOM_TREMONT 06_96H | ||
ALDERLAKE 06_97H | ||
ALDERLAKE_L 06_9AH | ||
ATOM_TREMONT_L 06_9CH | ||
RAPTORLAKE 06_B7H | ||
RAPTORLAKE_P 06_BAH | ||
ALDERLAKE_N 06_BEH | ||
RAPTORLAKE_S 06_BFH | ||
=================== ============ | ||
|
||
As an exception to this table, Intel Xeon E family parts ALDERLAKE(06_97H) and | ||
RAPTORLAKE(06_B7H) codenamed Catlow are not affected. They are reported as | ||
vulnerable in Linux because they share the same family/model with an affected | ||
part. Unlike their affected counterparts, they do not enumerate RFDS_CLEAR or | ||
CPUID.HYBRID. This information could be used to distinguish between the | ||
affected and unaffected parts, but it is deemed not worth adding complexity as | ||
the reporting is fixed automatically when these parts enumerate RFDS_NO. | ||
|
||
Mitigation | ||
========== | ||
Intel released a microcode update that enables software to clear sensitive | ||
information using the VERW instruction. Like MDS, RFDS deploys 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. | ||
|
||
Mitigation points | ||
----------------- | ||
VERW is executed by the kernel before returning to user space, and by KVM | ||
before VMentry. None of the affected cores support SMT, so VERW is not required | ||
at C-state transitions. | ||
|
||
New bits in IA32_ARCH_CAPABILITIES | ||
---------------------------------- | ||
Newer processors and microcode update on existing affected processors added new | ||
bits to IA32_ARCH_CAPABILITIES MSR. These bits can be used to enumerate | ||
vulnerability and mitigation capability: | ||
|
||
- Bit 27 - RFDS_NO - When set, processor is not affected by RFDS. | ||
- Bit 28 - RFDS_CLEAR - When set, processor is affected by RFDS, and has the | ||
microcode that clears the affected buffers on VERW execution. | ||
|
||
Mitigation control on the kernel command line | ||
--------------------------------------------- | ||
The kernel command line allows to control RFDS mitigation at boot time with the | ||
parameter "reg_file_data_sampling=". The valid arguments are: | ||
|
||
========== ================================================================= | ||
on If the CPU is vulnerable, enable mitigation; CPU buffer clearing | ||
on exit to userspace and before entering a VM. | ||
off Disables mitigation. | ||
========== ================================================================= | ||
|
||
Mitigation default is selected by CONFIG_MITIGATION_RFDS. | ||
|
||
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/reg_file_data_sampling | ||
|
||
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: No microcode' | ||
- The processor is vulnerable but microcode is not updated. | ||
* - 'Mitigation: Clear Register File' | ||
- The processor is vulnerable and the CPU buffer clearing mitigation is | ||
enabled. | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.