From: Mark Brown <broonie@kernel.org>
To: Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Shuah Khan <shuah@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
Mark Brown <broonie@kernel.org>,
Bill Roberts <bill.roberts@foss.arm.com>
Subject: [PATCH 1/2] arm64: gcs: Return -EPERM not -EBUSY for prctl() locking failures
Date: Thu, 10 Sep 2026 20:00:40 +0100 [thread overview]
Message-ID: <20260910-arm64-gcs-lock-eperm-v1-1-d88e51855c9f@kernel.org> (raw)
In-Reply-To: <20260910-arm64-gcs-lock-eperm-v1-0-d88e51855c9f@kernel.org>
When we refuse to perform a GCS configuration change due to locking we
currently return -EBUSY which is an odd error code to return. While the
selftest does currently check for this it is unlikely that we have any
practical users relying on the behaviour at this point so let's change
to return the more descriptive -EPERM instead like other architectures.
Reported-by: Bill Roberts <bill.roberts@foss.arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
arch/arm64/include/asm/gcs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/gcs.h b/arch/arm64/include/asm/gcs.h
index 8fa0707069e8..bbc22e382cfe 100644
--- a/arch/arm64/include/asm/gcs.h
+++ b/arch/arm64/include/asm/gcs.h
@@ -76,7 +76,7 @@ static inline int gcs_check_locked(struct task_struct *task,
new_val &= task->thread.gcs_el0_locked;
if (cur_val != new_val)
- return -EBUSY;
+ return -EPERM;
return 0;
}
--
2.47.3
next prev parent reply other threads:[~2026-09-10 19:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 19:00 [PATCH 0/2] arm64: gcs: Return -EPERM when changes are prevented by locking Mark Brown
2026-09-10 19:00 ` Mark Brown [this message]
2026-09-10 19:00 ` [PATCH 2/2] kselftest/arm64: Check for -EPERM not -EBUSY in the locking test Mark Brown
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=20260910-arm64-gcs-lock-eperm-v1-1-d88e51855c9f@kernel.org \
--to=broonie@kernel.org \
--cc=bill.roberts@foss.arm.com \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=shuah@kernel.org \
--cc=will@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