]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: ptrace: Add a comment describing our syscall entry/exit trap ABI
authorWill Deacon <will@kernel.org>
Thu, 2 Jul 2020 20:14:20 +0000 (21:14 +0100)
committerWill Deacon <will@kernel.org>
Thu, 16 Jul 2020 10:41:41 +0000 (11:41 +0100)
commit48d890f34ba72bed1c21d49d51f94c1300c7a9df
treeb09c8b3bd780a12ae98cf2568de00d7495da67ba
parente741a861ccf9b2be0113396eaa8638c216cdfa80
arm64: ptrace: Add a comment describing our syscall entry/exit trap ABI

Our tracehook logic for syscall entry/exit raises a SIGTRAP back to the
tracer following a ptrace request such as PTRACE_SYSCALL. As part of this
procedure, we clobber the reported value of one of the tracee's general
purpose registers (x7 for native tasks, r12 for compat) to indicate
whether the stop occurred on syscall entry or exit. This is a slightly
unfortunate ABI, as it prevents the tracer from accessing the real
register value and is at odds with other similar stops such as seccomp
traps.

Since we're stuck with this ABI, expand the comment in our tracehook
logic to acknowledge the issue and describe the behaviour in more detail.

Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Luis Machado <luis.machado@linaro.org>
Reported-by: Keno Fischer <keno@juliacomputing.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/ptrace.c