Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 9c899fd

Browse files
committed
Merge tag 'v6.7.10' into 6.7
Linux 6.7.10
2 parents 285156a + 9865e75 commit 9c899fd

67 files changed

Lines changed: 644 additions & 243 deletions

Some content is hidden

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ What: /sys/devices/system/cpu/vulnerabilities
516516
/sys/devices/system/cpu/vulnerabilities/mds
517517
/sys/devices/system/cpu/vulnerabilities/meltdown
518518
/sys/devices/system/cpu/vulnerabilities/mmio_stale_data
519+
/sys/devices/system/cpu/vulnerabilities/reg_file_data_sampling
519520
/sys/devices/system/cpu/vulnerabilities/retbleed
520521
/sys/devices/system/cpu/vulnerabilities/spec_store_bypass
521522
/sys/devices/system/cpu/vulnerabilities/spectre_v1

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ are configurable at compile, boot or run time.
2121
cross-thread-rsb
2222
srso
2323
gather_data_sampling
24+
reg-file-data-sampling
Lines changed: 104 additions & 0 deletions
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+
ATOM_GRACEMONT 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/kernel-parameters.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,26 @@
11411141
The filter can be disabled or changed to another
11421142
driver later using sysfs.
11431143

1144+
reg_file_data_sampling=
1145+
[X86] Controls mitigation for Register File Data
1146+
Sampling (RFDS) vulnerability. RFDS is a CPU
1147+
vulnerability which may allow userspace to infer
1148+
kernel data values previously stored in floating point
1149+
registers, vector registers, or integer registers.
1150+
RFDS only affects Intel Atom processors.
1151+
1152+
on: Turns ON the mitigation.
1153+
off: Turns OFF the mitigation.
1154+
1155+
This parameter overrides the compile time default set
1156+
by CONFIG_MITIGATION_RFDS. Mitigation cannot be
1157+
disabled when other VERW based mitigations (like MDS)
1158+
are enabled. In order to disable RFDS mitigation all
1159+
VERW based mitigations need to be disabled.
1160+
1161+
For details see:
1162+
Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst
1163+
11441164
driver_async_probe= [KNL]
11451165
List of driver names to be probed asynchronously. *
11461166
matches with all driver names. If * is specified, the
@@ -3389,6 +3409,7 @@
33893409
nospectre_bhb [ARM64]
33903410
nospectre_v1 [X86,PPC]
33913411
nospectre_v2 [X86,PPC,S390,ARM64]
3412+
reg_file_data_sampling=off [X86]
33923413
retbleed=off [X86]
33933414
spec_store_bypass_disable=off [X86,PPC]
33943415
spectre_v2_user=off [X86]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 7
4-
SUBLEVEL = 9
4+
SUBLEVEL = 10
55
EXTRAVERSION =
66
NAME = Hurr durr I'ma ninja sloth
77

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ config ARM
3535
select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7
3636
select ARCH_SUPPORTS_ATOMIC_RMW
3737
select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE
38+
select ARCH_SUPPORTS_PER_VMA_LOCK
3839
select ARCH_USE_BUILTIN_BSWAP
3940
select ARCH_USE_CMPXCHG_LOCKREF
4041
select ARCH_USE_MEMTEST

arch/arm/mm/fault.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,37 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
278278

279279
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, addr);
280280

281+
if (!(flags & FAULT_FLAG_USER))
282+
goto lock_mmap;
283+
284+
vma = lock_vma_under_rcu(mm, addr);
285+
if (!vma)
286+
goto lock_mmap;
287+
288+
if (!(vma->vm_flags & vm_flags)) {
289+
vma_end_read(vma);
290+
goto lock_mmap;
291+
}
292+
fault = handle_mm_fault(vma, addr, flags | FAULT_FLAG_VMA_LOCK, regs);
293+
if (!(fault & (VM_FAULT_RETRY | VM_FAULT_COMPLETED)))
294+
vma_end_read(vma);
295+
296+
if (!(fault & VM_FAULT_RETRY)) {
297+
count_vm_vma_lock_event(VMA_LOCK_SUCCESS);
298+
goto done;
299+
}
300+
count_vm_vma_lock_event(VMA_LOCK_RETRY);
301+
if (fault & VM_FAULT_MAJOR)
302+
flags |= FAULT_FLAG_TRIED;
303+
304+
/* Quick path to respond to signals */
305+
if (fault_signal_pending(fault, regs)) {
306+
if (!user_mode(regs))
307+
goto no_context;
308+
return 0;
309+
}
310+
lock_mmap:
311+
281312
retry:
282313
vma = lock_mm_and_find_vma(mm, addr, regs);
283314
if (unlikely(!vma)) {
@@ -316,6 +347,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
316347
}
317348

318349
mmap_read_unlock(mm);
350+
done:
319351

320352
/*
321353
* Handle the "normal" case first - VM_FAULT_MAJOR

arch/x86/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,6 +2609,17 @@ config GDS_FORCE_MITIGATION
26092609

26102610
If in doubt, say N.
26112611

2612+
config MITIGATION_RFDS
2613+
bool "RFDS Mitigation"
2614+
depends on CPU_SUP_INTEL
2615+
default y
2616+
help
2617+
Enable mitigation for Register File Data Sampling (RFDS) by default.
2618+
RFDS is a hardware vulnerability which affects Intel Atom CPUs. It
2619+
allows unprivileged speculative access to stale data previously
2620+
stored in floating point, vector and integer registers.
2621+
See also <file:Documentation/admin-guide/hw-vuln/reg-file-data-sampling.rst>
2622+
26122623
endif
26132624

26142625
config ARCH_HAS_ADD_PAGES

arch/x86/include/asm/cpufeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,4 +499,5 @@
499499
/* BUG word 2 */
500500
#define X86_BUG_SRSO X86_BUG(1*32 + 0) /* AMD SRSO bug */
501501
#define X86_BUG_DIV0 X86_BUG(1*32 + 1) /* AMD DIV0 speculation bug */
502+
#define X86_BUG_RFDS X86_BUG(1*32 + 2) /* CPU is vulnerable to Register File Data Sampling */
502503
#endif /* _ASM_X86_CPUFEATURES_H */

arch/x86/include/asm/msr-index.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@
165165
* CPU is not vulnerable to Gather
166166
* Data Sampling (GDS).
167167
*/
168+
#define ARCH_CAP_RFDS_NO BIT(27) /*
169+
* Not susceptible to Register
170+
* File Data Sampling.
171+
*/
172+
#define ARCH_CAP_RFDS_CLEAR BIT(28) /*
173+
* VERW clears CPU Register
174+
* File.
175+
*/
168176

169177
#define ARCH_CAP_XAPIC_DISABLE BIT(21) /*
170178
* IA32_XAPIC_DISABLE_STATUS MSR

0 commit comments

Comments
 (0)