From: Mathias Krause <minipli@grsecurity.net>
To: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org
Cc: Rick Edgecombe <rick.p.edgecombe@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org,
Mathias Krause <minipli@grsecurity.net>
Subject: [PATCH] x86/shstk: Provide kernel command line knob to disable
Date: Thu, 2 Apr 2026 17:44:05 +0200 [thread overview]
Message-ID: <20260402154405.1090935-1-minipli@grsecurity.net> (raw)
Provide a kernel command line option 'shstk=off' to disable CET shadow
stacks, much like 'ibt=off' can be used to disable CET IBT.
With both set to off, it avoids setting CR4.CET on capable hardware to
allow debugging related issues during early boot.
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
---
arch/x86/kernel/shstk.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/x86/kernel/shstk.c b/arch/x86/kernel/shstk.c
index 978232b6d48d..68b46bf1540b 100644
--- a/arch/x86/kernel/shstk.c
+++ b/arch/x86/kernel/shstk.c
@@ -542,6 +542,15 @@ static int shstk_disable(void)
return 0;
}
+static int __init shstk_configure(char *str)
+{
+ if (!strcmp(str, "off"))
+ setup_clear_cpu_cap(X86_FEATURE_SHSTK);
+
+ return 1;
+}
+__setup("shstk=", shstk_configure);
+
SYSCALL_DEFINE3(map_shadow_stack, unsigned long, addr, unsigned long, size, unsigned int, flags)
{
bool set_tok = flags & SHADOW_STACK_SET_TOKEN;
--
2.47.3
next reply other threads:[~2026-04-02 15:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 15:44 Mathias Krause [this message]
2026-04-02 15:54 ` Peter Zijlstra
2026-04-02 15:59 ` Mathias Krause
2026-04-02 16:04 ` Peter Zijlstra
2026-04-02 16:53 ` Edgecombe, Rick P
2026-04-02 16:57 ` Dave Hansen
2026-04-02 17:38 ` Mathias Krause
2026-04-02 17:01 ` Mathias Krause
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=20260402154405.1090935-1-minipli@grsecurity.net \
--to=minipli@grsecurity.net \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rick.p.edgecombe@intel.com \
--cc=tglx@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®