diff options
author | David S. Miller <davem@davemloft.net> | 2019-08-06 21:44:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-06 21:44:57 -0400 |
commit | 13dfb3fa494361ea9a5950f27c9cd8b06d28c04f (patch) | |
tree | 1bf30874f57c6c6b21160a10282191fcd0868055 /Documentation/admin-guide | |
parent | 05bb520376af2c5146d3c44832c22ec3bb54d778 (diff) | |
parent | 33920f1ec5bf47c5c0a1d2113989bdd9dfb3fae9 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Just minor overlapping changes in the conflicts here.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/admin-guide')
-rw-r--r-- | Documentation/admin-guide/conf.py | 10 | ||||
-rw-r--r-- | Documentation/admin-guide/hw-vuln/spectre.rst | 88 | ||||
-rw-r--r-- | Documentation/admin-guide/kernel-parameters.txt | 10 | ||||
-rw-r--r-- | Documentation/admin-guide/mm/transhuge.rst | 2 |
4 files changed, 86 insertions, 24 deletions
diff --git a/Documentation/admin-guide/conf.py b/Documentation/admin-guide/conf.py deleted file mode 100644 index 86f738953799..000000000000 --- a/Documentation/admin-guide/conf.py +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | # -*- coding: utf-8; mode: python -*- | ||
2 | |||
3 | project = 'Linux Kernel User Documentation' | ||
4 | |||
5 | tags.add("subproject") | ||
6 | |||
7 | latex_documents = [ | ||
8 | ('index', 'linux-user.tex', 'Linux Kernel User Documentation', | ||
9 | 'The kernel development community', 'manual'), | ||
10 | ] | ||
diff --git a/Documentation/admin-guide/hw-vuln/spectre.rst b/Documentation/admin-guide/hw-vuln/spectre.rst index 25f3b2532198..e05e581af5cf 100644 --- a/Documentation/admin-guide/hw-vuln/spectre.rst +++ b/Documentation/admin-guide/hw-vuln/spectre.rst | |||
@@ -41,10 +41,11 @@ Related CVEs | |||
41 | 41 | ||
42 | The following CVE entries describe Spectre variants: | 42 | The following CVE entries describe Spectre variants: |
43 | 43 | ||
44 | ============= ======================= ================= | 44 | ============= ======================= ========================== |
45 | CVE-2017-5753 Bounds check bypass Spectre variant 1 | 45 | CVE-2017-5753 Bounds check bypass Spectre variant 1 |
46 | CVE-2017-5715 Branch target injection Spectre variant 2 | 46 | CVE-2017-5715 Branch target injection Spectre variant 2 |
47 | ============= ======================= ================= | 47 | CVE-2019-1125 Spectre v1 swapgs Spectre variant 1 (swapgs) |
48 | ============= ======================= ========================== | ||
48 | 49 | ||
49 | Problem | 50 | Problem |
50 | ------- | 51 | ------- |
@@ -78,6 +79,13 @@ There are some extensions of Spectre variant 1 attacks for reading data | |||
78 | over the network, see :ref:`[12] <spec_ref12>`. However such attacks | 79 | over the network, see :ref:`[12] <spec_ref12>`. However such attacks |
79 | are difficult, low bandwidth, fragile, and are considered low risk. | 80 | are difficult, low bandwidth, fragile, and are considered low risk. |
80 | 81 | ||
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 | |||
81 | Spectre variant 2 (Branch Target Injection) | 89 | Spectre variant 2 (Branch Target Injection) |
82 | ------------------------------------------- | 90 | ------------------------------------------- |
83 | 91 | ||
@@ -132,6 +140,9 @@ not cover all possible attack vectors. | |||
132 | 1. A user process attacking the kernel | 140 | 1. A user process attacking the kernel |
133 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 141 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
134 | 142 | ||
143 | Spectre variant 1 | ||
144 | ~~~~~~~~~~~~~~~~~ | ||
145 | |||
135 | The attacker passes a parameter to the kernel via a register or | 146 | The attacker passes a parameter to the kernel via a register or |
136 | via a known address in memory during a syscall. Such parameter may | 147 | via a known address in memory during a syscall. Such parameter may |
137 | be used later by the kernel as an index to an array or to derive | 148 | 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. | |||
144 | potentially be influenced for Spectre attacks, new "nospec" accessor | 155 | potentially be influenced for Spectre attacks, new "nospec" accessor |
145 | macros are used to prevent speculative loading of data. | 156 | macros are used to prevent speculative loading of data. |
146 | 157 | ||
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 | ||
148 | target buffer (BTB) before issuing syscall to launch an attack. | 192 | target buffer (BTB) before issuing syscall to launch an attack. |
149 | After entering the kernel, the kernel could use the poisoned branch | 193 | After entering the kernel, the kernel could use the poisoned branch |
150 | target buffer on indirect jump and jump to gadget code in speculative | 194 | 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: | |||
280 | 324 | ||
281 | The possible values in this file are: | 325 | The possible values in this file are: |
282 | 326 | ||
283 | ======================================= ================================= | 327 | .. list-table:: |
284 | 'Mitigation: __user pointer sanitation' Protection in kernel on a case by | 328 | |
285 | case base with explicit pointer | 329 | * - 'Not affected' |
286 | sanitation. | 330 | - The processor is not vulnerable. |
287 | ======================================= ================================= | 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. | ||
288 | 339 | ||
289 | However, the protections are put in place on a case by case basis, | 340 | However, the protections are put in place on a case by case basis, |
290 | and there is no guarantee that all possible attack vectors for Spectre | 341 | 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 | |||
366 | 1. Kernel mitigation | 417 | 1. Kernel mitigation |
367 | ^^^^^^^^^^^^^^^^^^^^ | 418 | ^^^^^^^^^^^^^^^^^^^^ |
368 | 419 | ||
420 | Spectre variant 1 | ||
421 | ~~~~~~~~~~~~~~~~~ | ||
422 | |||
369 | For the Spectre variant 1, vulnerable kernel code (as determined | 423 | For the Spectre variant 1, vulnerable kernel code (as determined |
370 | by code audit or scanning tools) is annotated on a case by case | 424 | by code audit or scanning tools) is annotated on a case by case |
371 | basis to use nospec accessor macros for bounds clipping :ref:`[2] | 425 | basis to use nospec accessor macros for bounds clipping :ref:`[2] |
372 | <spec_ref2>` to avoid any usable disclosure gadgets. However, it may | 426 | <spec_ref2>` to avoid any usable disclosure gadgets. However, it may |
373 | not cover all attack vectors for Spectre variant 1. | 427 | not cover all attack vectors for Spectre variant 1. |
374 | 428 | ||
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 | |||
375 | For Spectre variant 2 mitigation, the compiler turns indirect calls or | 441 | For Spectre variant 2 mitigation, the compiler turns indirect calls or |
376 | jumps in the kernel into equivalent return trampolines (retpolines) | 442 | jumps in the kernel into equivalent return trampolines (retpolines) |
377 | :ref:`[3] <spec_ref3>` :ref:`[9] <spec_ref9>` to go to the target | 443 | :ref:`[3] <spec_ref3>` :ref:`[9] <spec_ref9>` to go to the target |
@@ -473,6 +539,12 @@ Mitigation control on the kernel command line | |||
473 | Spectre variant 2 mitigation can be disabled or force enabled at the | 539 | Spectre variant 2 mitigation can be disabled or force enabled at the |
474 | kernel command line. | 540 | kernel command line. |
475 | 541 | ||
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 | |||
476 | nospectre_v2 | 548 | nospectre_v2 |
477 | 549 | ||
478 | [X86] Disable all mitigations for the Spectre variant 2 | 550 | [X86] Disable all mitigations for the Spectre variant 2 |
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 46b826fcb5ad..47d981a86e2f 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
@@ -2545,7 +2545,7 @@ | |||
2545 | mem_encrypt=on: Activate SME | 2545 | mem_encrypt=on: Activate SME |
2546 | mem_encrypt=off: Do not activate SME | 2546 | mem_encrypt=off: Do not activate SME |
2547 | 2547 | ||
2548 | Refer to Documentation/virtual/kvm/amd-memory-encryption.rst | 2548 | Refer to Documentation/virt/kvm/amd-memory-encryption.rst |
2549 | for details on when memory encryption can be activated. | 2549 | for details on when memory encryption can be activated. |
2550 | 2550 | ||
2551 | mem_sleep_default= [SUSPEND] Default system suspend mode: | 2551 | mem_sleep_default= [SUSPEND] Default system suspend mode: |
@@ -2604,7 +2604,7 @@ | |||
2604 | expose users to several CPU vulnerabilities. | 2604 | expose users to several CPU vulnerabilities. |
2605 | Equivalent to: nopti [X86,PPC] | 2605 | Equivalent to: nopti [X86,PPC] |
2606 | kpti=0 [ARM64] | 2606 | kpti=0 [ARM64] |
2607 | nospectre_v1 [PPC] | 2607 | nospectre_v1 [X86,PPC] |
2608 | nobp=0 [S390] | 2608 | nobp=0 [S390] |
2609 | nospectre_v2 [X86,PPC,S390,ARM64] | 2609 | nospectre_v2 [X86,PPC,S390,ARM64] |
2610 | spectre_v2_user=off [X86] | 2610 | spectre_v2_user=off [X86] |
@@ -2965,9 +2965,9 @@ | |||
2965 | nosmt=force: Force disable SMT, cannot be undone | 2965 | nosmt=force: Force disable SMT, cannot be undone |
2966 | via the sysfs control file. | 2966 | via the sysfs control file. |
2967 | 2967 | ||
2968 | nospectre_v1 [PPC] Disable mitigations for Spectre Variant 1 (bounds | 2968 | nospectre_v1 [X86,PPC] Disable mitigations for Spectre Variant 1 |
2969 | check bypass). With this option data leaks are possible | 2969 | (bounds check bypass). With this option data leaks are |
2970 | in the system. | 2970 | possible in the system. |
2971 | 2971 | ||
2972 | nospectre_v2 [X86,PPC_FSL_BOOK3E,ARM64] Disable all mitigations for | 2972 | nospectre_v2 [X86,PPC_FSL_BOOK3E,ARM64] Disable all mitigations for |
2973 | the Spectre variant 2 (indirect branch prediction) | 2973 | the Spectre variant 2 (indirect branch prediction) |
diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst index 7ab93a8404b9..bd5714547cee 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst | |||
@@ -53,7 +53,7 @@ disabled, there is ``khugepaged`` daemon that scans memory and | |||
53 | collapses sequences of basic pages into huge pages. | 53 | collapses sequences of basic pages into huge pages. |
54 | 54 | ||
55 | The THP behaviour is controlled via :ref:`sysfs <thp_sysfs>` | 55 | The THP behaviour is controlled via :ref:`sysfs <thp_sysfs>` |
56 | interface and using madivse(2) and prctl(2) system calls. | 56 | interface and using madvise(2) and prctl(2) system calls. |
57 | 57 | ||
58 | Transparent Hugepage Support maximizes the usefulness of free memory | 58 | Transparent Hugepage Support maximizes the usefulness of free memory |
59 | if compared to the reservation approach of hugetlbfs by allowing all | 59 | if compared to the reservation approach of hugetlbfs by allowing all |