Re: [PATCH 1/1] arm64: gcs: bind signal GCS restore to the live GCSPR_EL0

From: Catalin Marinas

Date: Tue Nov 24 2026 - 12:32:14 EST


On Mon, Nov 23, 2026 at 11:56:52PM +0800, 黄华成 wrote:
> Bind the restore to the live, kernel-visible GCSPR_EL0: for every
> legitimate restore at every nesting depth the innermost frame's gcspr
> equals the live GCSPR_EL0 (the handler's return pops its trampoline
> record before rt_sigreturn). Userspace cannot move the live GCSPR_EL0
> without executing GCS instructions, which are themselves checked.

(that's a pretty malformed patch, missing sign-off, lines not wrapped,
based on an older tree)

Changing GCSPR_EL0 via sigreturn is the intended ABI (see
preserve_gcs_context() and Documentation/arch/arm64/gcs.rst). Any valid
signal cap token is acceptable, including an outer context's token.

The patch would also break handlers that call rt_sigreturn directly,
user-space stack switching and checkpoint/restore.

In conclusion, NAK.

--
Catalin