Thread (9 messages) 9 messages, 2 authors, 2021-03-27

Re: [PATCH 1/4] arm64: expose orig_x0 in the user_pt_regs structure

From: Andrei Vagin <hidden>
Date: 2021-03-27 00:40:39
Also in: lkml

On Fri, Mar 26, 2021 at 11:28 AM Catalin Marinas
[off-list ref] wrote:
On Mon, Mar 22, 2021 at 03:50:50PM -0700, Andrei Vagin wrote:
quoted
diff --git a/arch/arm64/include/uapi/asm/ptrace.h b/arch/arm64/include/uapi/asm/ptrace.h
index 758ae984ff97..3c118c5b0893 100644
--- a/arch/arm64/include/uapi/asm/ptrace.h
+++ b/arch/arm64/include/uapi/asm/ptrace.h
@@ -90,6 +90,7 @@ struct user_pt_regs {
      __u64           sp;
      __u64           pc;
      __u64           pstate;
+     __u64           orig_x0;
 };
That's a UAPI change, likely to go wrong. For example, a
ptrace(PTRACE_GETREGSET, pid, REGSET_GPR, data) would write past the end
of an old struct user_pt_regs in the debugger.
ptrace(PTRACE_GETREGSET, ...) receives iovec:
ptrace(PTRACE_GETREGSET, pid, NT_PRSTATUS, &iov)

iov contains a pointer to a buffer and its size and the kernel fills
only the part that fits the buffer.
I think this interface was invented to allow extending structures
without breaking backward compatibility.
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help