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, Rick Edgecombe <rick.p.edgecombe@intel.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/shstk: Provide kernel command line knob to disable
Date: Mon, 4 May 2026 14:09:13 +0200 [thread overview]
Message-ID: <3d7c8d26-558d-40ef-9ad9-3a5100eed9e5@grsecurity.net> (raw)
In-Reply-To: <20260402173606.1096172-1-minipli@grsecurity.net>
On 02.04.26 19:36, Mathias Krause wrote:
> 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 which I happened to
> have done way too many times in the recent past.
>
> Document it along with its sibling option 'ibt' in kernel-parameters.txt
> to allow others to find it more easily.
>
> Signed-off-by: Mathias Krause <minipli@grsecurity.net>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Acked-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
> ---
> v2:
> - pick up Ack's
> - document the new option as well as ibt=
> - tweak changelog accordingly
>
Ping!
Anything still to fix with this or is it ready to get merged?
Thanks,
Mathias
> Documentation/admin-guide/kernel-parameters.txt | 14 ++++++++++++++
> arch/x86/kernel/shstk.c | 9 +++++++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 03a550630644..43bdf72f6495 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -2248,6 +2248,16 @@ Kernel parameters
> syscalls, essentially overriding IA32_EMULATION_DEFAULT_DISABLED at
> boot time. When false, unconditionally disables IA32 emulation.
>
> + ibt= [X86-64]
> + Format: ibt=warn, ibt=off
> + Changes the handling of CET IBT violations in the kernel.
> +
> + The 'warn' setting makes CET IBT violations emit a
> + warning only instead of being fatal while the 'off'
> + setting completely disables CET IBT for the kernel.
> +
> + To fully disable CET, use 'ibt=off shstk=off'.
> +
> icn= [HW,ISDN]
> Format: <io>[,<membase>[,<icn_id>[,<icn_id2>]]]
>
> @@ -6924,6 +6934,10 @@ Kernel parameters
> Specify the MCLK divider for Intel SoundWire buses in
> case the BIOS does not provide the clock rate properly.
>
> + shstk=off [X86-64] Disable CET userspace shadow stack support.
> +
> + To fully disable CET, use 'ibt=off shstk=off'.
> +
> skew_tick= [KNL,EARLY] Offset the periodic timer tick per cpu to mitigate
> xtime_lock contention on larger systems, and/or RCU lock
> contention on all systems with CONFIG_MAXSMP set.
> 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;
next prev parent reply other threads:[~2026-05-04 12:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 17:36 [PATCH v2] x86/shstk: Provide kernel command line knob to disable Mathias Krause
2026-05-04 12:09 ` Mathias Krause [this message]
2026-05-06 19:03 ` Dave Hansen
2026-05-06 22:45 ` Edgecombe, Rick P
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=3d7c8d26-558d-40ef-9ad9-3a5100eed9e5@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