From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "x86@kernel.org" <x86@kernel.org>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"shuah@kernel.org" <shuah@kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"bp@alien8.de" <bp@alien8.de>,
"tglx@kernel.org" <tglx@kernel.org>,
"bill.roberts@arm.com" <bill.roberts@arm.com>,
"hpa@zytor.com" <hpa@zytor.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH 2/2] selftest/x86: test ARCH_SHSTK_UNLOCK
Date: Mon, 29 Jun 2026 21:46:03 +0000 [thread overview]
Message-ID: <67e700c8bed2e082efaf68de33ee2c46d16033f3.camel@intel.com> (raw)
In-Reply-To: <20260615195156.257950-2-bill.roberts@arm.com>
On Mon, 2026-06-15 at 14:51 -0500, Bill Roberts wrote:
> One should not be able to use ARCH_SHSTK_UNLOCK via arch_prctl to twiddle
> feature bits, test that this is the case.
>
> Signed-off-by: Bill Roberts <bill.roberts@arm.com>
> ---
> tools/testing/selftests/x86/test_shadow_stack.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/tools/testing/selftests/x86/test_shadow_stack.c b/tools/testing/selftests/x86/test_shadow_stack.c
> index 21af54d5f4ea..82a5fefa9df5 100644
> --- a/tools/testing/selftests/x86/test_shadow_stack.c
> +++ b/tools/testing/selftests/x86/test_shadow_stack.c
> @@ -979,6 +979,14 @@ int main(int argc, char *argv[])
> {
> int ret = 0;
>
> + /* test that we can't use unlock to set shadow stack */
> + if (!ARCH_PRCTL(ARCH_SHSTK_UNLOCK, ARCH_SHSTK_SHSTK)) {
> + printf("[SKIP]\tCould enable Shadow stack via UNLOCK\n");
> + return 1;
> + }
More generally, we should not be able to use ARCH_SHSTK_UNLOCK here. Can we make
the comment generic and not checking for a specific bug? Because it does more
than that.
> +
> + printf("[OK]\tCouldn't enable Shadow stack via UNLOCK\n");
> +
> if (ARCH_PRCTL(ARCH_SHSTK_ENABLE, ARCH_SHSTK_SHSTK)) {
> printf("[SKIP]\tCould not enable Shadow stack\n");
> return 1;
next prev parent reply other threads:[~2026-06-29 21:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260615195156.257950-1-bill.roberts@arm.com>
2026-06-15 19:51 ` [PATCH 2/2] selftest/x86: test ARCH_SHSTK_UNLOCK Bill Roberts
2026-06-29 21:46 ` Edgecombe, Rick P [this message]
2026-06-29 17:09 ` Bill Roberts
2026-06-30 17:02 ` Edgecombe, Rick P
2026-06-29 21:57 ` Edgecombe, Rick P
2026-06-29 17:13 ` 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=67e700c8bed2e082efaf68de33ee2c46d16033f3.camel@intel.com \
--to=rick.p.edgecombe@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=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