From: "tip-bot2 for Brendan Jackman" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Brendan Jackman <jackmanb@google.com>,
"Borislav Petkov (AMD)" <bp@alien8.de>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/bugs] Documentation/x86: Fix PR_SET_SPECULATION_CTRL error codes
Date: Mon, 29 Dec 2025 15:31:59 -0000 [thread overview]
Message-ID: <176702231989.510.14589594757275090350.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20251111-b4-prctl-docs-2-v2-1-bc9d14ec9662@google.com>
The following commit has been merged into the x86/bugs branch of tip:
Commit-ID: 4992ed7813c54f0a676b7707d1f8f16552fdb240
Gitweb: https://git.kernel.org/tip/4992ed7813c54f0a676b7707d1f8f16552fdb240
Author: Brendan Jackman <jackmanb@google.com>
AuthorDate: Tue, 11 Nov 2025 17:41:08
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Mon, 29 Dec 2025 16:27:45 +01:00
Documentation/x86: Fix PR_SET_SPECULATION_CTRL error codes
If you force-disable mitigations on the kernel cmdline, for SPEC_STORE_BYPASS
this ends up with the prctl returning -ENXIO, but contrary to the current docs
for the other controls it returns -EPERM. Fix that.
Note that this return value should probably be considered a bug. But, making
the behaviour consistent with the current docs seems more likely to break
existing users than help anyone out in practice, so just "fix" it by
specifying it as correct.
Since this is getting more wordy and confusing, also be more explicit about
"control is not possible" be mentioning the boot configuration, to better
distinguish this case conceptually from the FORCE_DISABLE failure mode.
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20251111-b4-prctl-docs-2-v2-1-bc9d14ec9662@google.com
---
Documentation/userspace-api/spec_ctrl.rst | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/Documentation/userspace-api/spec_ctrl.rst b/Documentation/userspace-api/spec_ctrl.rst
index ca89151..61fe020 100644
--- a/Documentation/userspace-api/spec_ctrl.rst
+++ b/Documentation/userspace-api/spec_ctrl.rst
@@ -81,11 +81,15 @@ Value Meaning
ERANGE arg3 is incorrect, i.e. it's neither PR_SPEC_ENABLE nor
PR_SPEC_DISABLE nor PR_SPEC_FORCE_DISABLE.
-ENXIO Control of the selected speculation misfeature is not possible.
- See PR_GET_SPECULATION_CTRL.
+ENXIO For PR_SPEC_STORE_BYPASS: control of the selected speculation misfeature
+ is not possible via prctl, because of the system's boot configuration.
+
+EPERM Speculation was disabled with PR_SPEC_FORCE_DISABLE and caller tried to
+ enable it again.
+
+EPERM For PR_SPEC_L1D_FLUSH and PR_SPEC_INDIRECT_BRANCH: control of the
+ mitigation is not possible because of the system's boot configuration.
-EPERM Speculation was disabled with PR_SPEC_FORCE_DISABLE and caller
- tried to enable it again.
======= =================================================================
Speculation misfeature controls
prev parent reply other threads:[~2025-12-29 15:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 17:41 [PATCH v2] " Brendan Jackman
2025-12-29 15:31 ` tip-bot2 for Brendan Jackman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176702231989.510.14589594757275090350.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bp@alien8.de \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®