From: Will Deacon <will@kernel.org>
To: Andrei Vagin <avagin@gmail.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
Oleg Nesterov <oleg@redhat.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-api@vger.kernel.org,
Anthony Steinhauser <asteinhauser@google.com>,
Dave Martin <Dave.Martin@arm.com>,
Keno Fischer <keno@juliacomputing.com>
Subject: Re: [PATCH 0/3 v2] arm64/ptrace: allow to get all registers on syscall traps
Date: Thu, 4 Feb 2021 14:53:46 +0000 [thread overview]
Message-ID: <20210204145345.GC20815@willie-the-truck> (raw)
In-Reply-To: <20210201194012.524831-1-avagin@gmail.com>
Hi Andrei,
On Mon, Feb 01, 2021 at 11:40:09AM -0800, Andrei Vagin wrote:
> Right now, ip/r12 for AArch32 and x7 for AArch64 is used to indicate
> whether or not the stop has been signalled from syscall entry or syscall
> exit. This means that:
>
> - Any writes by the tracer to this register during the stop are
> ignored/discarded.
>
> - The actual value of the register is not available during the stop,
> so the tracer cannot save it and restore it later.
>
> For applications like the user-mode Linux or gVisor, it is critical to
> have access to the full set of registers in any moment. For example,
> they need to change values of all registers to emulate rt_sigreturn or
> execve and they need to have the full set of registers to build a signal
> frame.
>
> This series introduces the PTRACE_O_ARM64_RAW_REGS option. If it is set,
> PTRACE_GETREGSET returns values of all registers, and PTRACE_SETREGSET
> allows to change any of them.
I haven't had a chance to go through this properly yet, but I spotted a
couple of things worth mentioning off the bat:
- Please drop all of the compat changes here. The compat layer is intended
to be compatible with arch/arm/, so if you want to introduce new ptrace
behaviours for 32-bit applications, you need to make the changes there
and then update our compat layer accordingly.
- When Keno mentioned this before [1,2], he also talked about making
orig_x0 available. Since extending the ABI is a giant pain, I think
this should be seriously considered.
[1] https://lore.kernel.org/r/CABV8kRzkLiVuqxT3+8c1o8m_OuROtXgfowQcrMVnrxu=CiGB=w@mail.gmail.com
[2] https://lore.kernel.org/r/CABV8kRzg1BaKdAhqXU3hONhfPAHj6Nbw0wLBC1Lo7PN1UA0CoA@mail.gmail.com
Will
prev parent reply other threads:[~2021-02-04 14:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 19:40 [PATCH 0/3 v2] arm64/ptrace: allow to get all registers on syscall traps Andrei Vagin
2021-02-01 19:40 ` [PATCH 1/3] arm64/ptrace: don't clobber task registers on syscall entry/exit traps Andrei Vagin
2021-02-04 15:23 ` Will Deacon
2021-02-04 16:41 ` Dave Martin
2021-02-25 16:00 ` Andrei Vagin
2021-02-01 19:40 ` [PATCH 2/3] arm64/ptrace: introduce PTRACE_O_ARM64_RAW_REGS Andrei Vagin
2021-02-04 15:36 ` Will Deacon
2021-02-08 18:31 ` Andrei Vagin
2021-02-01 19:40 ` [PATCH 3/3] selftest/arm64/ptrace: add tests for PTRACE_O_ARM64_RAW_REGS Andrei Vagin
2021-02-04 15:40 ` Will Deacon
2021-02-10 20:54 ` Kees Cook
2021-02-02 0:11 ` [PATCH 0/3 v2] arm64/ptrace: allow to get all registers on syscall traps Keno Fischer
2021-02-08 18:37 ` Andrei Vagin
2021-02-08 19:18 ` Keno Fischer
2021-02-04 14:53 ` Will Deacon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210204145345.GC20815@willie-the-truck \
--to=will@kernel.org \
--cc=Dave.Martin@arm.com \
--cc=asteinhauser@google.com \
--cc=avagin@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=keno@juliacomputing.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).