]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arm64: uprobes: Add GCS support to uretprobes
authorJeremy Linton <jeremy.linton@arm.com>
Mon, 25 Aug 2025 03:34:19 +0000 (22:34 -0500)
committerWill Deacon <will@kernel.org>
Tue, 16 Sep 2025 20:34:06 +0000 (21:34 +0100)
commit4a601714bb24926507b2051c4a95f07e0e142004
tree4c1dcfe462001b59cdd81b8d5a21c894b174f68a
parentefb07ac534e24e22a7eb32815fb50f69931cdeae
arm64: uprobes: Add GCS support to uretprobes

Ret probes work by changing the value in the link register at
the probe location to return to the probe rather than the calling
routine. Thus the GCS needs to be updated with this address as well.

Since its possible to insert probes at locations where the
current value of the LR doesn't match the GCS state this needs
to be detected and handled in order to maintain the existing
no-fault behavior.

Co-developed-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
[will: Add '__force' to gcspr casts in arch_uretprobe_hijack_return_addr()]
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/probes/uprobes.c