From: Bill Roberts <bill.roberts@arm.com>
To: Dave Hansen <dave.hansen@intel.com>,
"H. Peter Anvin" <hpa@zytor.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
rick.p.edgecombe@intel.com, Shuah Khan <shuah@kernel.org>,
Thomas Gleixner <tglx@kernel.org>,
x86@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH RESEND v2 1/2] arch/x86: handle ARCH_SHSTK_ENABLE explicitly
Date: Tue, 1 Dec 2026 08:49:12 -0600 [thread overview]
Message-ID: <5cf9c223-772c-425c-b7dc-aec581856740@arm.com> (raw)
In-Reply-To: <1c79db97-6951-4ba0-b76b-2d232a735f6c@intel.com>
On 11/30/26 5:09 PM, Dave Hansen wrote:
> While I applaud the restraint in just having an LLM write the changelog,
> I had a really hard time reading this. How does this (LLM-assisted)
> version look? It feels more readable to me.
>
> --
>
> x86/shstk: Don't treat ARCH_SHSTK_UNLOCK as ARCH_SHSTK_ENABLE
>
> On x86, normal arch_prctl() syscalls and ptrace() callers share
> shstk_prctl() to control user shadow stack. It identifies ptrace()
> callers by 'task != current'.
>
> ARCH_SHSTK_UNLOCK is only meant for ptrace() callers. Normal syscall
> callers should never use it. If they do, they accidentally get
> ARCH_SHSTK_ENABLE behavior.
>
> This happens because ARCH_SHSTK_UNLOCK is handled only in the ptrace
> case. In the 'task == current' case, shstk_prctl() handles the other
> options and assumes that any remaining one is ARCH_SHSTK_ENABLE, so
> ARCH_SHSTK_UNLOCK falls through to the enable path.
>
> This is surprising behavior, but does not give userspace any control
> that it doesn't already have.
>
> Check for ARCH_SHSTK_ENABLE explicitly and return -EINVAL for any
> unhandled option.
LGTM. Is there any other feedback to address and do we want to handle
this as a new patch or just amend the commit log when it's applied?
I am good with either.
next prev parent reply other threads:[~2026-12-01 14:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 18:17 Bill Roberts
2026-11-02 18:17 ` [PATCH RESEND v2 2/2] selftest/x86: test ARCH_SHSTK_UNLOCK Bill Roberts
2026-11-09 18:34 ` Bill Roberts
2026-12-01 23:41 ` [tip: x86/mm] selftest/x86: Test ARCH_SHSTK_UNLOCK tip-bot2 for Bill Roberts
2026-11-30 23:09 ` [PATCH RESEND v2 1/2] arch/x86: handle ARCH_SHSTK_ENABLE explicitly Dave Hansen
2026-12-01 14:49 ` Bill Roberts [this message]
2026-12-01 23:41 ` [tip: x86/mm] x86/shstk: Avoid accidentally treating ARCH_SHSTK_UNLOCK as ARCH_SHSTK_ENABLE tip-bot2 for Bill Roberts
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=5cf9c223-772c-425c-b7dc-aec581856740@arm.com \
--to=bill.roberts@arm.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rick.p.edgecombe@intel.com \
--cc=shuah@kernel.org \
--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®