Skip to content

Commit b63e906

Browse files
authored
Merge pull request to upgrade the HCL kernel to 6.12.36
kernel upgrade to 6.12.36
2 parents d1ad1ee + 6b578c0 commit b63e906

File tree

4,740 files changed

+77986
-39476
lines changed

Some content is hidden

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

4,740 files changed

+77986
-39476
lines changed

.clippy.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
check-private-items = true
4+
5+
disallowed-macros = [
6+
# The `clippy::dbg_macro` lint only works with `std::dbg!`, thus we simulate
7+
# it here, see: https://github.com/rust-lang/rust-clippy/issues/11303.
8+
{ path = "kernel::dbg", reason = "the `dbg!` macro is intended as a debugging tool", allow-invalid = true },
9+
]

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ modules.order
108108
# We don't want to ignore the following even if they are dot-files
109109
#
110110
!.clang-format
111+
!.clippy.toml
111112
!.cocciconfig
112113
!.editorconfig
113114
!.get_maintainer.ignore

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ Description: information about CPUs heterogeneity.
511511

512512
What: /sys/devices/system/cpu/vulnerabilities
513513
/sys/devices/system/cpu/vulnerabilities/gather_data_sampling
514+
/sys/devices/system/cpu/vulnerabilities/indirect_target_selection
514515
/sys/devices/system/cpu/vulnerabilities/itlb_multihit
515516
/sys/devices/system/cpu/vulnerabilities/l1tf
516517
/sys/devices/system/cpu/vulnerabilities/mds

Documentation/admin-guide/cgroup-v2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2954,7 +2954,7 @@ following two functions.
29542954
a queue (device) has been associated with the bio and
29552955
before submission.
29562956

2957-
wbc_account_cgroup_owner(@wbc, @page, @bytes)
2957+
wbc_account_cgroup_owner(@wbc, @folio, @bytes)
29582958
Should be called for each data segment being written out.
29592959
While this function doesn't care exactly when it's called
29602960
during the writeback session, it's the easiest and most

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ are configurable at compile, boot or run time.
2222
srso
2323
gather_data_sampling
2424
reg-file-data-sampling
25+
indirect-target-selection
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
Indirect Target Selection (ITS)
4+
===============================
5+
6+
ITS is a vulnerability in some Intel CPUs that support Enhanced IBRS and were
7+
released before Alder Lake. ITS may allow an attacker to control the prediction
8+
of indirect branches and RETs located in the lower half of a cacheline.
9+
10+
ITS is assigned CVE-2024-28956 with a CVSS score of 4.7 (Medium).
11+
12+
Scope of Impact
13+
---------------
14+
- **eIBRS Guest/Host Isolation**: Indirect branches in KVM/kernel may still be
15+
predicted with unintended target corresponding to a branch in the guest.
16+
17+
- **Intra-Mode BTI**: In-kernel training such as through cBPF or other native
18+
gadgets.
19+
20+
- **Indirect Branch Prediction Barrier (IBPB)**: After an IBPB, indirect
21+
branches may still be predicted with targets corresponding to direct branches
22+
executed prior to the IBPB. This is fixed by the IPU 2025.1 microcode, which
23+
should be available via distro updates. Alternatively microcode can be
24+
obtained from Intel's github repository [#f1]_.
25+
26+
Affected CPUs
27+
-------------
28+
Below is the list of ITS affected CPUs [#f2]_ [#f3]_:
29+
30+
======================== ============ ==================== ===============
31+
Common name Family_Model eIBRS Intra-mode BTI
32+
Guest/Host Isolation
33+
======================== ============ ==================== ===============
34+
SKYLAKE_X (step >= 6) 06_55H Affected Affected
35+
ICELAKE_X 06_6AH Not affected Affected
36+
ICELAKE_D 06_6CH Not affected Affected
37+
ICELAKE_L 06_7EH Not affected Affected
38+
TIGERLAKE_L 06_8CH Not affected Affected
39+
TIGERLAKE 06_8DH Not affected Affected
40+
KABYLAKE_L (step >= 12) 06_8EH Affected Affected
41+
KABYLAKE (step >= 13) 06_9EH Affected Affected
42+
COMETLAKE 06_A5H Affected Affected
43+
COMETLAKE_L 06_A6H Affected Affected
44+
ROCKETLAKE 06_A7H Not affected Affected
45+
======================== ============ ==================== ===============
46+
47+
- All affected CPUs enumerate Enhanced IBRS feature.
48+
- IBPB isolation is affected on all ITS affected CPUs, and need a microcode
49+
update for mitigation.
50+
- None of the affected CPUs enumerate BHI_CTRL which was introduced in Golden
51+
Cove (Alder Lake and Sapphire Rapids). This can help guests to determine the
52+
host's affected status.
53+
- Intel Atom CPUs are not affected by ITS.
54+
55+
Mitigation
56+
----------
57+
As only the indirect branches and RETs that have their last byte of instruction
58+
in the lower half of the cacheline are vulnerable to ITS, the basic idea behind
59+
the mitigation is to not allow indirect branches in the lower half.
60+
61+
This is achieved by relying on existing retpoline support in the kernel, and in
62+
compilers. ITS-vulnerable retpoline sites are runtime patched to point to newly
63+
added ITS-safe thunks. These safe thunks consists of indirect branch in the
64+
second half of the cacheline. Not all retpoline sites are patched to thunks, if
65+
a retpoline site is evaluated to be ITS-safe, it is replaced with an inline
66+
indirect branch.
67+
68+
Dynamic thunks
69+
~~~~~~~~~~~~~~
70+
From a dynamically allocated pool of safe-thunks, each vulnerable site is
71+
replaced with a new thunk, such that they get a unique address. This could
72+
improve the branch prediction accuracy. Also, it is a defense-in-depth measure
73+
against aliasing.
74+
75+
Note, for simplicity, indirect branches in eBPF programs are always replaced
76+
with a jump to a static thunk in __x86_indirect_its_thunk_array. If required,
77+
in future this can be changed to use dynamic thunks.
78+
79+
All vulnerable RETs are replaced with a static thunk, they do not use dynamic
80+
thunks. This is because RETs get their prediction from RSB mostly that does not
81+
depend on source address. RETs that underflow RSB may benefit from dynamic
82+
thunks. But, RETs significantly outnumber indirect branches, and any benefit
83+
from a unique source address could be outweighed by the increased icache
84+
footprint and iTLB pressure.
85+
86+
Retpoline
87+
~~~~~~~~~
88+
Retpoline sequence also mitigates ITS-unsafe indirect branches. For this
89+
reason, when retpoline is enabled, ITS mitigation only relocates the RETs to
90+
safe thunks. Unless user requested the RSB-stuffing mitigation.
91+
92+
RSB Stuffing
93+
~~~~~~~~~~~~
94+
RSB-stuffing via Call Depth Tracking is a mitigation for Retbleed RSB-underflow
95+
attacks. And it also mitigates RETs that are vulnerable to ITS.
96+
97+
Mitigation in guests
98+
^^^^^^^^^^^^^^^^^^^^
99+
All guests deploy ITS mitigation by default, irrespective of eIBRS enumeration
100+
and Family/Model of the guest. This is because eIBRS feature could be hidden
101+
from a guest. One exception to this is when a guest enumerates BHI_DIS_S, which
102+
indicates that the guest is running on an unaffected host.
103+
104+
To prevent guests from unnecessarily deploying the mitigation on unaffected
105+
platforms, Intel has defined ITS_NO bit(62) in MSR IA32_ARCH_CAPABILITIES. When
106+
a guest sees this bit set, it should not enumerate the ITS bug. Note, this bit
107+
is not set by any hardware, but is **intended for VMMs to synthesize** it for
108+
guests as per the host's affected status.
109+
110+
Mitigation options
111+
^^^^^^^^^^^^^^^^^^
112+
The ITS mitigation can be controlled using the "indirect_target_selection"
113+
kernel parameter. The available options are:
114+
115+
======== ===================================================================
116+
on (default) Deploy the "Aligned branch/return thunks" mitigation.
117+
If spectre_v2 mitigation enables retpoline, aligned-thunks are only
118+
deployed for the affected RET instructions. Retpoline mitigates
119+
indirect branches.
120+
121+
off Disable ITS mitigation.
122+
123+
vmexit Equivalent to "=on" if the CPU is affected by guest/host isolation
124+
part of ITS. Otherwise, mitigation is not deployed. This option is
125+
useful when host userspace is not in the threat model, and only
126+
attacks from guest to host are considered.
127+
128+
stuff Deploy RSB-fill mitigation when retpoline is also deployed.
129+
Otherwise, deploy the default mitigation. When retpoline mitigation
130+
is enabled, RSB-stuffing via Call-Depth-Tracking also mitigates
131+
ITS.
132+
133+
force Force the ITS bug and deploy the default mitigation.
134+
======== ===================================================================
135+
136+
Sysfs reporting
137+
---------------
138+
139+
The sysfs file showing ITS mitigation status is:
140+
141+
/sys/devices/system/cpu/vulnerabilities/indirect_target_selection
142+
143+
Note, microcode mitigation status is not reported in this file.
144+
145+
The possible values in this file are:
146+
147+
.. list-table::
148+
149+
* - Not affected
150+
- The processor is not vulnerable.
151+
* - Vulnerable
152+
- System is vulnerable and no mitigation has been applied.
153+
* - Vulnerable, KVM: Not affected
154+
- System is vulnerable to intra-mode BTI, but not affected by eIBRS
155+
guest/host isolation.
156+
* - Mitigation: Aligned branch/return thunks
157+
- The mitigation is enabled, affected indirect branches and RETs are
158+
relocated to safe thunks.
159+
* - Mitigation: Retpolines, Stuffing RSB
160+
- The mitigation is enabled using retpoline and RSB stuffing.
161+
162+
References
163+
----------
164+
.. [#f1] Microcode repository - https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files
165+
166+
.. [#f2] Affected Processors list - https://www.intel.com/content/www/us/en/developer/topic-technology/software-security-guidance/processors-affected-consolidated-product-cpu-model.html
167+
168+
.. [#f3] Affected Processors list (machine readable) - https://github.com/intel/Intel-affected-processor-list

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,6 +2153,23 @@
21532153
different crypto accelerators. This option can be used
21542154
to achieve best performance for particular HW.
21552155

2156+
indirect_target_selection= [X86,Intel] Mitigation control for Indirect
2157+
Target Selection(ITS) bug in Intel CPUs. Updated
2158+
microcode is also required for a fix in IBPB.
2159+
2160+
on: Enable mitigation (default).
2161+
off: Disable mitigation.
2162+
force: Force the ITS bug and deploy default
2163+
mitigation.
2164+
vmexit: Only deploy mitigation if CPU is affected by
2165+
guest/host isolation part of ITS.
2166+
stuff: Deploy RSB-fill mitigation when retpoline is
2167+
also deployed. Otherwise, deploy the default
2168+
mitigation.
2169+
2170+
For details see:
2171+
Documentation/admin-guide/hw-vuln/indirect-target-selection.rst
2172+
21562173
init= [KNL]
21572174
Format: <full_path>
21582175
Run specified binary instead of /sbin/init as init
@@ -3032,6 +3049,8 @@
30323049
* max_sec_lba48: Set or clear transfer size limit to
30333050
65535 sectors.
30343051

3052+
* external: Mark port as external (hotplug-capable).
3053+
30353054
* [no]lpm: Enable or disable link power management.
30363055

30373056
* [no]setxfer: Indicate if transfer speed mode setting
@@ -3512,6 +3531,7 @@
35123531
expose users to several CPU vulnerabilities.
35133532
Equivalent to: if nokaslr then kpti=0 [ARM64]
35143533
gather_data_sampling=off [X86]
3534+
indirect_target_selection=off [X86]
35153535
kvm.nx_huge_pages=off [X86]
35163536
l1tf=off [X86]
35173537
mds=off [X86]
@@ -6245,6 +6265,8 @@
62456265

62466266
Selecting 'on' will also enable the mitigation
62476267
against user space to user space task attacks.
6268+
Selecting specific mitigation does not force enable
6269+
user mitigations.
62486270

62496271
Selecting 'off' will disable both the kernel and
62506272
the user space protections.

Documentation/admin-guide/sysctl/kernel.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,17 @@ pid>/``).
212212
This value defaults to 0.
213213
214214

215+
core_sort_vma
216+
=============
217+
218+
The default coredump writes VMAs in address order. By setting
219+
``core_sort_vma`` to 1, VMAs will be written from smallest size
220+
to largest size. This is known to break at least elfutils, but
221+
can be handy when dealing with very large (and truncated)
222+
coredumps where the more useful debugging details are included
223+
in the smaller VMAs.
224+
225+
215226
core_uses_pid
216227
=============
217228

Documentation/arch/arm64/booting.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,12 @@ Before jumping into the kernel, the following conditions must be met:
285285

286286
- SCR_EL3.FGTEn (bit 27) must be initialised to 0b1.
287287

288+
For CPUs with the Fine Grained Traps 2 (FEAT_FGT2) extension present:
289+
290+
- If EL3 is present and the kernel is entered at EL2:
291+
292+
- SCR_EL3.FGTEn2 (bit 59) must be initialised to 0b1.
293+
288294
For CPUs with support for HCRX_EL2 (FEAT_HCX) present:
289295

290296
- If EL3 is present and the kernel is entered at EL2:
@@ -379,6 +385,22 @@ Before jumping into the kernel, the following conditions must be met:
379385

380386
- SMCR_EL2.EZT0 (bit 30) must be initialised to 0b1.
381387

388+
For CPUs with the Performance Monitors Extension (FEAT_PMUv3p9):
389+
390+
- If EL3 is present:
391+
392+
- MDCR_EL3.EnPM2 (bit 7) must be initialised to 0b1.
393+
394+
- If the kernel is entered at EL1 and EL2 is present:
395+
396+
- HDFGRTR2_EL2.nPMICNTR_EL0 (bit 2) must be initialised to 0b1.
397+
- HDFGRTR2_EL2.nPMICFILTR_EL0 (bit 3) must be initialised to 0b1.
398+
- HDFGRTR2_EL2.nPMUACR_EL1 (bit 4) must be initialised to 0b1.
399+
400+
- HDFGWTR2_EL2.nPMICNTR_EL0 (bit 2) must be initialised to 0b1.
401+
- HDFGWTR2_EL2.nPMICFILTR_EL0 (bit 3) must be initialised to 0b1.
402+
- HDFGWTR2_EL2.nPMUACR_EL1 (bit 4) must be initialised to 0b1.
403+
382404
For CPUs with Memory Copy and Memory Set instructions (FEAT_MOPS):
383405

384406
- If the kernel is entered at EL1 and EL2 is present:

0 commit comments

Comments
 (0)