]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: uaccess: Add additional userspace GCS accessors
authorJeremy Linton <jeremy.linton@arm.com>
Mon, 25 Aug 2025 03:34:17 +0000 (22:34 -0500)
committerWill Deacon <will@kernel.org>
Tue, 16 Sep 2025 20:32:53 +0000 (21:32 +0100)
commit9cd2a7f1180f9b6fe5214abc90eaf5c053f545ee
tree963badd9885ba1046161eecb869009d6e2ad0b7f
parentea920b50ac9ff13ef0282428bd80395ea134a26c
arm64: uaccess: Add additional userspace GCS accessors

Uprobes need more advanced read, push, and pop userspace GCS
functionality. Implement those features using the existing gcsstr()
and copy_from_user().

Its important to note that GCS pages can be read by normal
instructions, but the hardware validates that pages used by GCS
specific operations, have a GCS privilege set. We aren't validating this
in load_user_gcs because it requires stabilizing the VMA over the read
which may fault.

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
[will: Add '__force' to gcspr cast in pop_user_gcs()]
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/gcs.h