hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/Documentation/userspace-api/spec_ctrl.rst
....@@ -28,18 +28,20 @@
2828 which is selected with arg2 of prctl(2). The return value uses bits 0-3 with
2929 the following meaning:
3030
31
-==== ===================== ===================================================
32
-Bit Define Description
33
-==== ===================== ===================================================
34
-0 PR_SPEC_PRCTL Mitigation can be controlled per task by
35
- PR_SET_SPECULATION_CTRL.
36
-1 PR_SPEC_ENABLE The speculation feature is enabled, mitigation is
37
- disabled.
38
-2 PR_SPEC_DISABLE The speculation feature is disabled, mitigation is
39
- enabled.
40
-3 PR_SPEC_FORCE_DISABLE Same as PR_SPEC_DISABLE, but cannot be undone. A
41
- subsequent prctl(..., PR_SPEC_ENABLE) will fail.
42
-==== ===================== ===================================================
31
+==== ====================== ==================================================
32
+Bit Define Description
33
+==== ====================== ==================================================
34
+0 PR_SPEC_PRCTL Mitigation can be controlled per task by
35
+ PR_SET_SPECULATION_CTRL.
36
+1 PR_SPEC_ENABLE The speculation feature is enabled, mitigation is
37
+ disabled.
38
+2 PR_SPEC_DISABLE The speculation feature is disabled, mitigation is
39
+ enabled.
40
+3 PR_SPEC_FORCE_DISABLE Same as PR_SPEC_DISABLE, but cannot be undone. A
41
+ subsequent prctl(..., PR_SPEC_ENABLE) will fail.
42
+4 PR_SPEC_DISABLE_NOEXEC Same as PR_SPEC_DISABLE, but the state will be
43
+ cleared on :manpage:`execve(2)`.
44
+==== ====================== ==================================================
4345
4446 If all bits are 0 the CPU is not affected by the speculation misfeature.
4547
....@@ -94,6 +96,7 @@
9496 * prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_ENABLE, 0, 0);
9597 * prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_DISABLE, 0, 0);
9698 * prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_FORCE_DISABLE, 0, 0);
99
+ * prctl(PR_SET_SPECULATION_CTRL, PR_SPEC_STORE_BYPASS, PR_SPEC_DISABLE_NOEXEC, 0, 0);
97100
98101 - PR_SPEC_INDIR_BRANCH: Indirect Branch Speculation in User Processes
99102 (Mitigate Spectre V2 style attacks against user processes)