Skip to content

Commit c01f512

Browse files
committed
Merge branch 'fixes-merge-window-pt2' into fixes
2 parents a4c8723 + f1f028f commit c01f512

File tree

2,008 files changed

+20693
-14202
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,008 files changed

+20693
-14202
lines changed

.clang-format

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,13 @@ ForEachMacros:
107107
- 'css_for_each_descendant_post'
108108
- 'css_for_each_descendant_pre'
109109
- 'device_for_each_child_node'
110+
- 'dma_fence_chain_for_each'
110111
- 'drm_atomic_crtc_for_each_plane'
111112
- 'drm_atomic_crtc_state_for_each_plane'
112113
- 'drm_atomic_crtc_state_for_each_plane_state'
113114
- 'drm_atomic_for_each_plane_damage'
115+
- 'drm_client_for_each_connector_iter'
116+
- 'drm_client_for_each_modeset'
114117
- 'drm_connector_for_each_possible_encoder'
115118
- 'drm_for_each_connector_iter'
116119
- 'drm_for_each_crtc'
@@ -126,6 +129,7 @@ ForEachMacros:
126129
- 'drm_mm_for_each_node_in_range'
127130
- 'drm_mm_for_each_node_safe'
128131
- 'flow_action_for_each'
132+
- 'for_each_active_dev_scope'
129133
- 'for_each_active_drhd_unit'
130134
- 'for_each_active_iommu'
131135
- 'for_each_available_child_of_node'
@@ -153,6 +157,8 @@ ForEachMacros:
153157
- 'for_each_cpu_not'
154158
- 'for_each_cpu_wrap'
155159
- 'for_each_dev_addr'
160+
- 'for_each_dev_scope'
161+
- 'for_each_displayid_db'
156162
- 'for_each_dma_cap_mask'
157163
- 'for_each_dpcm_be'
158164
- 'for_each_dpcm_be_rollback'
@@ -169,6 +175,8 @@ ForEachMacros:
169175
- 'for_each_evictable_lru'
170176
- 'for_each_fib6_node_rt_rcu'
171177
- 'for_each_fib6_walker_rt'
178+
- 'for_each_free_mem_pfn_range_in_zone'
179+
- 'for_each_free_mem_pfn_range_in_zone_from'
172180
- 'for_each_free_mem_range'
173181
- 'for_each_free_mem_range_reverse'
174182
- 'for_each_func_rsrc'
@@ -178,6 +186,7 @@ ForEachMacros:
178186
- 'for_each_ip_tunnel_rcu'
179187
- 'for_each_irq_nr'
180188
- 'for_each_link_codecs'
189+
- 'for_each_link_platforms'
181190
- 'for_each_lru'
182191
- 'for_each_matching_node'
183192
- 'for_each_matching_node_and_match'
@@ -302,7 +311,10 @@ ForEachMacros:
302311
- 'ide_port_for_each_present_dev'
303312
- 'idr_for_each_entry'
304313
- 'idr_for_each_entry_continue'
314+
- 'idr_for_each_entry_continue_ul'
305315
- 'idr_for_each_entry_ul'
316+
- 'in_dev_for_each_ifa_rcu'
317+
- 'in_dev_for_each_ifa_rtnl'
306318
- 'inet_bind_bucket_for_each'
307319
- 'inet_lhash2_for_each_icsk_rcu'
308320
- 'key_for_each'
@@ -343,8 +355,6 @@ ForEachMacros:
343355
- 'media_device_for_each_intf'
344356
- 'media_device_for_each_link'
345357
- 'media_device_for_each_pad'
346-
- 'mp_bvec_for_each_page'
347-
- 'mp_bvec_for_each_segment'
348358
- 'nanddev_io_for_each_page'
349359
- 'netdev_for_each_lower_dev'
350360
- 'netdev_for_each_lower_private'
@@ -381,18 +391,19 @@ ForEachMacros:
381391
- 'radix_tree_for_each_slot'
382392
- 'radix_tree_for_each_tagged'
383393
- 'rbtree_postorder_for_each_entry_safe'
394+
- 'rdma_for_each_block'
384395
- 'rdma_for_each_port'
385396
- 'resource_list_for_each_entry'
386397
- 'resource_list_for_each_entry_safe'
387398
- 'rhl_for_each_entry_rcu'
388399
- 'rhl_for_each_rcu'
389400
- 'rht_for_each'
390-
- 'rht_for_each_from'
391401
- 'rht_for_each_entry'
392402
- 'rht_for_each_entry_from'
393403
- 'rht_for_each_entry_rcu'
394404
- 'rht_for_each_entry_rcu_from'
395405
- 'rht_for_each_entry_safe'
406+
- 'rht_for_each_from'
396407
- 'rht_for_each_rcu'
397408
- 'rht_for_each_rcu_from'
398409
- '__rq_for_each_bio'

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,6 @@ x509.genkey
142142

143143
# Kdevelop4
144144
*.kdev4
145+
146+
# Clang's compilation database file
147+
/compile_commands.json

.mailmap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ Dengcheng Zhu <[email protected]> <[email protected]>
6464
6565
6666
Dmitry Eremin-Solenikov <[email protected]>
67+
68+
69+
6770
Domen Puncer <[email protected]>
6871
Douglas Gilbert <[email protected]>
6972
Ed L. Cashin <[email protected]>
@@ -98,6 +101,7 @@ Jason Gunthorpe <[email protected]> <[email protected]>
98101
99102
100103
Jean Tourrilhes <[email protected]>
104+
101105
Jeff Garzik <[email protected]>
102106
103107
@@ -116,6 +120,7 @@ John Stultz <[email protected]>
116120
Juha Yrjola <at solidboot.com>
117121
Juha Yrjola <[email protected]>
118122
Juha Yrjola <[email protected]>
123+
119124
Kay Sievers <[email protected]>
120125
Kenneth W Chen <[email protected]>
121126
Konstantin Khlebnikov <[email protected]> <[email protected]>
@@ -132,6 +137,7 @@ Linus Lüssing <[email protected]> <[email protected]>
132137
133138
134139
140+
135141
136142
Mark Brown <[email protected]>
137143
@@ -157,6 +163,8 @@ Matt Ranostay <[email protected]> Matthew Ranostay <[email protected]
157163
158164
159165
166+
167+
160168
Mayuresh Janorkar <[email protected]>
161169
Michael Buesch <[email protected]>
162170
Michel Dänzer <[email protected]>

Documentation/PCI/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Linux PCI Bus Subsystem
99
:numbered:
1010

1111
pci
12-
picebus-howto
12+
pciebus-howto
1313
pci-iov-howto
1414
msi-howto
1515
acpi-info

Documentation/PCI/pci-error-recovery.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ That is, the recovery API only requires that:
403403
.. note::
404404

405405
Implementation details for the powerpc platform are discussed in
406-
the file Documentation/powerpc/eeh-pci-error-recovery.txt
406+
the file Documentation/powerpc/eeh-pci-error-recovery.rst
407407

408408
As of this writing, there is a growing list of device drivers with
409409
patches implementing error recovery. Not all of these patches are in
@@ -422,3 +422,6 @@ That is, the recovery API only requires that:
422422
- drivers/net/cxgb3
423423
- drivers/net/s2io.c
424424
- drivers/net/qlge
425+
426+
The End
427+
-------
File renamed without changes.

Documentation/RCU/rculist_nulls.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Using hlist_nulls to protect read-mostly linked lists and
22
objects using SLAB_TYPESAFE_BY_RCU allocations.
33

4-
Please read the basics in Documentation/RCU/listRCU.txt
4+
Please read the basics in Documentation/RCU/listRCU.rst
55

66
Using special makers (called 'nulls') is a convenient way
77
to solve following problem :

Documentation/admin-guide/conf.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

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

Lines changed: 80 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ Related CVEs
4141

4242
The following CVE entries describe Spectre variants:
4343

44-
============= ======================= =================
44+
============= ======================= ==========================
4545
CVE-2017-5753 Bounds check bypass Spectre variant 1
4646
CVE-2017-5715 Branch target injection Spectre variant 2
47-
============= ======================= =================
47+
CVE-2019-1125 Spectre v1 swapgs Spectre variant 1 (swapgs)
48+
============= ======================= ==========================
4849

4950
Problem
5051
-------
@@ -78,6 +79,13 @@ There are some extensions of Spectre variant 1 attacks for reading data
7879
over the network, see :ref:`[12] <spec_ref12>`. However such attacks
7980
are difficult, low bandwidth, fragile, and are considered low risk.
8081

82+
Note that, despite "Bounds Check Bypass" name, Spectre variant 1 is not
83+
only about user-controlled array bounds checks. It can affect any
84+
conditional checks. The kernel entry code interrupt, exception, and NMI
85+
handlers all have conditional swapgs checks. Those may be problematic
86+
in the context of Spectre v1, as kernel code can speculatively run with
87+
a user GS.
88+
8189
Spectre variant 2 (Branch Target Injection)
8290
-------------------------------------------
8391

@@ -132,6 +140,9 @@ not cover all possible attack vectors.
132140
1. A user process attacking the kernel
133141
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134142

143+
Spectre variant 1
144+
~~~~~~~~~~~~~~~~~
145+
135146
The attacker passes a parameter to the kernel via a register or
136147
via a known address in memory during a syscall. Such parameter may
137148
be used later by the kernel as an index to an array or to derive
@@ -144,7 +155,40 @@ not cover all possible attack vectors.
144155
potentially be influenced for Spectre attacks, new "nospec" accessor
145156
macros are used to prevent speculative loading of data.
146157

147-
Spectre variant 2 attacker can :ref:`poison <poison_btb>` the branch
158+
Spectre variant 1 (swapgs)
159+
~~~~~~~~~~~~~~~~~~~~~~~~~~
160+
161+
An attacker can train the branch predictor to speculatively skip the
162+
swapgs path for an interrupt or exception. If they initialize
163+
the GS register to a user-space value, if the swapgs is speculatively
164+
skipped, subsequent GS-related percpu accesses in the speculation
165+
window will be done with the attacker-controlled GS value. This
166+
could cause privileged memory to be accessed and leaked.
167+
168+
For example:
169+
170+
::
171+
172+
if (coming from user space)
173+
swapgs
174+
mov %gs:<percpu_offset>, %reg
175+
mov (%reg), %reg1
176+
177+
When coming from user space, the CPU can speculatively skip the
178+
swapgs, and then do a speculative percpu load using the user GS
179+
value. So the user can speculatively force a read of any kernel
180+
value. If a gadget exists which uses the percpu value as an address
181+
in another load/store, then the contents of the kernel value may
182+
become visible via an L1 side channel attack.
183+
184+
A similar attack exists when coming from kernel space. The CPU can
185+
speculatively do the swapgs, causing the user GS to get used for the
186+
rest of the speculative window.
187+
188+
Spectre variant 2
189+
~~~~~~~~~~~~~~~~~
190+
191+
A spectre variant 2 attacker can :ref:`poison <poison_btb>` the branch
148192
target buffer (BTB) before issuing syscall to launch an attack.
149193
After entering the kernel, the kernel could use the poisoned branch
150194
target buffer on indirect jump and jump to gadget code in speculative
@@ -280,11 +324,18 @@ The sysfs file showing Spectre variant 1 mitigation status is:
280324

281325
The possible values in this file are:
282326

283-
======================================= =================================
284-
'Mitigation: __user pointer sanitation' Protection in kernel on a case by
285-
case base with explicit pointer
286-
sanitation.
287-
======================================= =================================
327+
.. list-table::
328+
329+
* - 'Not affected'
330+
- The processor is not vulnerable.
331+
* - 'Vulnerable: __user pointer sanitization and usercopy barriers only; no swapgs barriers'
332+
- The swapgs protections are disabled; otherwise it has
333+
protection in the kernel on a case by case base with explicit
334+
pointer sanitation and usercopy LFENCE barriers.
335+
* - 'Mitigation: usercopy/swapgs barriers and __user pointer sanitization'
336+
- Protection in the kernel on a case by case base with explicit
337+
pointer sanitation, usercopy LFENCE barriers, and swapgs LFENCE
338+
barriers.
288339

289340
However, the protections are put in place on a case by case basis,
290341
and there is no guarantee that all possible attack vectors for Spectre
@@ -366,12 +417,27 @@ Turning on mitigation for Spectre variant 1 and Spectre variant 2
366417
1. Kernel mitigation
367418
^^^^^^^^^^^^^^^^^^^^
368419

420+
Spectre variant 1
421+
~~~~~~~~~~~~~~~~~
422+
369423
For the Spectre variant 1, vulnerable kernel code (as determined
370424
by code audit or scanning tools) is annotated on a case by case
371425
basis to use nospec accessor macros for bounds clipping :ref:`[2]
372426
<spec_ref2>` to avoid any usable disclosure gadgets. However, it may
373427
not cover all attack vectors for Spectre variant 1.
374428

429+
Copy-from-user code has an LFENCE barrier to prevent the access_ok()
430+
check from being mis-speculated. The barrier is done by the
431+
barrier_nospec() macro.
432+
433+
For the swapgs variant of Spectre variant 1, LFENCE barriers are
434+
added to interrupt, exception and NMI entry where needed. These
435+
barriers are done by the FENCE_SWAPGS_KERNEL_ENTRY and
436+
FENCE_SWAPGS_USER_ENTRY macros.
437+
438+
Spectre variant 2
439+
~~~~~~~~~~~~~~~~~
440+
375441
For Spectre variant 2 mitigation, the compiler turns indirect calls or
376442
jumps in the kernel into equivalent return trampolines (retpolines)
377443
:ref:`[3] <spec_ref3>` :ref:`[9] <spec_ref9>` to go to the target
@@ -473,6 +539,12 @@ Mitigation control on the kernel command line
473539
Spectre variant 2 mitigation can be disabled or force enabled at the
474540
kernel command line.
475541

542+
nospectre_v1
543+
544+
[X86,PPC] Disable mitigations for Spectre Variant 1
545+
(bounds check bypass). With this option data leaks are
546+
possible in the system.
547+
476548
nospectre_v2
477549

478550
[X86] Disable all mitigations for the Spectre variant 2

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2545,7 +2545,7 @@
25452545
mem_encrypt=on: Activate SME
25462546
mem_encrypt=off: Do not activate SME
25472547

2548-
Refer to Documentation/virtual/kvm/amd-memory-encryption.rst
2548+
Refer to Documentation/virt/kvm/amd-memory-encryption.rst
25492549
for details on when memory encryption can be activated.
25502550

25512551
mem_sleep_default= [SUSPEND] Default system suspend mode:
@@ -2604,7 +2604,7 @@
26042604
expose users to several CPU vulnerabilities.
26052605
Equivalent to: nopti [X86,PPC]
26062606
kpti=0 [ARM64]
2607-
nospectre_v1 [PPC]
2607+
nospectre_v1 [X86,PPC]
26082608
nobp=0 [S390]
26092609
nospectre_v2 [X86,PPC,S390,ARM64]
26102610
spectre_v2_user=off [X86]
@@ -2965,9 +2965,9 @@
29652965
nosmt=force: Force disable SMT, cannot be undone
29662966
via the sysfs control file.
29672967

2968-
nospectre_v1 [PPC] Disable mitigations for Spectre Variant 1 (bounds
2969-
check bypass). With this option data leaks are possible
2970-
in the system.
2968+
nospectre_v1 [X86,PPC] Disable mitigations for Spectre Variant 1
2969+
(bounds check bypass). With this option data leaks are
2970+
possible in the system.
29712971

29722972
nospectre_v2 [X86,PPC_FSL_BOOK3E,ARM64] Disable all mitigations for
29732973
the Spectre variant 2 (indirect branch prediction)
@@ -4090,6 +4090,13 @@
40904090
Run specified binary instead of /init from the ramdisk,
40914091
used for early userspace startup. See initrd.
40924092

4093+
rdrand= [X86]
4094+
force - Override the decision by the kernel to hide the
4095+
advertisement of RDRAND support (this affects
4096+
certain AMD processors because of buggy BIOS
4097+
support, specifically around the suspend/resume
4098+
path).
4099+
40934100
rdt= [HW,X86,RDT]
40944101
Turn on/off individual RDT features. List is:
40954102
cmt, mbmtotal, mbmlocal, l3cat, l3cdp, l2cat, l2cdp,

0 commit comments

Comments
 (0)