All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/shstk: Provide kernel command line knob to disable
@ 2026-04-02 15:44 Mathias Krause
  2026-04-02 15:54 ` Peter Zijlstra
  0 siblings, 1 reply; 8+ messages in thread
From: Mathias Krause @ 2026-04-02 15:44 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: Rick Edgecombe, Peter Zijlstra, linux-kernel, Mathias Krause

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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-04-02 17:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02 15:44 [PATCH] x86/shstk: Provide kernel command line knob to disable Mathias Krause
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.