[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200427170826.mdklazcrn4xaeafm@wittgenstein>
Date: Mon, 27 Apr 2020 19:08:26 +0200
From: Christian Brauner <christian.brauner@...ntu.com>
To: Hagen Paul Pfeifer <hagen@...u.net>
Cc: linux-kernel@...r.kernel.org, Florian Weimer <fweimer@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <christian@...uner.io>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, Arnd Bergmann <arnd@...db.de>,
Brian Gerst <brgerst@...il.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
David Howells <dhowells@...hat.com>,
Aleksa Sarai <cyphar@...har.com>,
Andy Lutomirski <luto@...nel.org>,
Oleg Nesterov <oleg@...hat.com>,
"Eric W . Biederman" <ebiederm@...ssion.com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Sargun Dhillon <sargun@...gun.me>, linux-api@...r.kernel.org,
linux-arch@...r.kernel.org
Subject: Re: [RFC v2] ptrace, pidfd: add pidfd_ptrace syscall
On Sun, Apr 26, 2020 at 06:34:30PM +0200, Hagen Paul Pfeifer wrote:
> Working on a safety-critical stress testing tool, using ptrace in an
> rather uncommon way (stop, peeking memory, ...) for a bunch of
> applications in an automated way I realized that once opened processes
> where restarted and PIDs recycled. Resulting in monitoring and
> manipulating the wrong processes.
>
> With the advent of pidfd we are now able to stick with one stable handle
> to identifying processes exactly. We now have the ability to get this
> race free. Sending signals now works like a charm, next step is to
> extend the functionality also for ptrace.
>
> API:
> long pidfd_ptrace(int pidfd, enum __ptrace_request request,
> void *addr, void *data, unsigned flags);
I'm in general not opposed to this if there's a clear need for this and
users that are interested. But I think if people really prefer having
this a new syscall then we should probably try to improve on the old
one. Things that come to mind right away without doing a deep review are
replacing the void *addr pointer with a dedicated struct ptract_args or
union ptrace_args and a size argument. If we're not doing something
like this or something more fundamental we can equally well either just
duplicate all enums in the old ptrace syscall and append a _PIDFD to it
where it makes sense.
Christian
Powered by blists - more mailing lists