mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Bill Roberts <bill.roberts@arm.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: Mon, 30 Nov 2026 15:09:57 -0800	[thread overview]
Message-ID: <1c79db97-6951-4ba0-b76b-2d232a735f6c@intel.com> (raw)
In-Reply-To: <20261102181708.29178-1-bill.roberts@arm.com>

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.

      parent reply	other threads:[~2026-11-30 23:10 UTC|newest]

Thread overview: 4+ 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-11-30 23:09 ` Dave Hansen [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=1c79db97-6951-4ba0-b76b-2d232a735f6c@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bill.roberts@arm.com \
    --cc=bp@alien8.de \
    --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®