From 988be99717aeac02bda38ee8a484f6a3211a04a0 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Thu, 10 Sep 2026 20:00:40 +0100 Subject: [PATCH] arm64: gcs: Return -EPERM not -EBUSY for prctl() locking failures 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 x86. Reported-by: Bill Roberts Link: https://lore.kernel.org/r/a1946d93-370e-4ca9-85d6-60b4a20ffd47@arm.com/ Signed-off-by: Mark Brown Signed-off-by: Catalin Marinas --- 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; } -- knotmirror 0.0.1