mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Bill Roberts" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Bill Roberts <bill.roberts@arm.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/mm] selftest/x86: Test ARCH_SHSTK_UNLOCK
Date: Tue, 01 Dec 2026 23:41:01 -0000	[thread overview]
Message-ID: <179616846100.1190409.6305092538807515696.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20261102181708.29178-2-bill.roberts@arm.com>

The following commit has been merged into the x86/mm branch of tip:

Commit-ID:     76b8d9c0594c138fb9b10887a50b1834efa974f0
Gitweb:        https://git.kernel.org/tip/76b8d9c0594c138fb9b10887a50b1834efa974f0
Author:        Bill Roberts <bill.roberts@arm.com>
AuthorDate:    Mon, 02 Nov 2026 12:17:08 -06:00
Committer:     Dave Hansen <dave.hansen@linux.intel.com>
CommitterDate: Tue, 01 Dec 2026 15:33:26 -08:00

selftest/x86: Test ARCH_SHSTK_UNLOCK

Test that ARCH_SHSTK_UNLOCK can't be called from normal (non-ptrace)
context.

Signed-off-by: Bill Roberts <bill.roberts@arm.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
Link: https://patch.msgid.link/20261102181708.29178-2-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 3d6ca33..cbe7ca4 100644
--- a/tools/testing/selftests/x86/test_shadow_stack.c
+++ b/tools/testing/selftests/x86/test_shadow_stack.c
@@ -1059,6 +1059,14 @@ int main(int argc, char *argv[])
 {
 	int ret = 0;
 
+	/* Test that ARCH_SHSTK_UNLOCK can't be called from normal (non-ptrace) context. */
+	if (!ARCH_PRCTL(ARCH_SHSTK_UNLOCK, ARCH_SHSTK_SHSTK)) {
+		printf("[FAIL]\tARCH_SHSTK_UNLOCK should fail in a non-ptrace context\n");
+		goto out;
+	}
+
+	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;

  parent reply	other threads:[~2026-12-01 23:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 18:17 [PATCH RESEND v2 1/2] arch/x86: handle ARCH_SHSTK_ENABLE explicitly 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-bot2 for Bill Roberts [this message]
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
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=179616846100.1190409.6305092538807515696.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=bill.roberts@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=rick.p.edgecombe@intel.com \
    --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®