From: Christian Brauner <christian.brauner@ubuntu.com>
To: Sargun Dhillon <sargun@sargun.me>
Cc: linux-kernel@vger.kernel.org,
containers@lists.linux-foundation.org, linux-api@vger.kernel.org,
linux-fsdevel@vger.kernel.org, tycho@tycho.ws, jannh@google.com,
cyphar@cyphar.com, oleg@redhat.com, luto@amacapital.net,
viro@zeniv.linux.org.uk, gpascutto@mozilla.com,
ealvarez@mozilla.com, fweimer@redhat.com, jld@mozilla.com,
arnd@arndb.de
Subject: Re: [PATCH v8 2/3] pid: Introduce pidfd_getfd syscall
Date: Sun, 5 Jan 2020 14:30:07 +0100 [thread overview]
Message-ID: <20200105133005.ezt4y4d4oat55u6h@wittgenstein> (raw)
In-Reply-To: <20200103162928.5271-3-sargun@sargun.me>
On Fri, Jan 03, 2020 at 08:29:27AM -0800, Sargun Dhillon wrote:
> This syscall allows for the retrieval of file descriptors from other
> processes, based on their pidfd. This is possible using ptrace, and
> injection of parasitic code to inject code which leverages SCM_RIGHTS
> to move file descriptors between a tracee and a tracer. Unfortunately,
> ptrace comes with a high cost of requiring the process to be stopped,
> and breaks debuggers. This does not require stopping the process under
> manipulation.
>
> One reason to use this is to allow sandboxers to take actions on file
> descriptors on the behalf of another process. For example, this can be
> combined with seccomp-bpf's user notification to do on-demand fd
> extraction and take privileged actions. One such privileged action
> is binding a socket to a privileged port.
>
> This also adds the syscall to all architectures at the same time.
>
> /* prototype */
> /* flags is currently reserved and should be set to 0 */
> int sys_pidfd_getfd(int pidfd, int fd, unsigned int flags);
>
> /* testing */
> Ran self-test suite on x86_64
>
> Signed-off-by: Sargun Dhillon <sargun@sargun.me>
> Cc: Christian Brauner <christian.brauner@ubuntu.com>
The prefered way of adding a syscall is to keep the implementation
separate from the wiring up into the syscall tables. So please split the
patch into two:
- [2/4] pidfd_getfd() implementation
- [3/4] pidfd_getfd() wiring up
otherwise
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
next prev parent reply other threads:[~2020-01-05 13:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-03 16:29 [PATCH v8 0/3] Add pidfd_getfd syscall Sargun Dhillon
2020-01-03 16:29 ` [PATCH v8 1/3] vfs, fdtable: Add get_task_file helper Sargun Dhillon
2020-01-05 12:47 ` Christian Brauner
2020-01-03 16:29 ` [PATCH v8 2/3] pid: Introduce pidfd_getfd syscall Sargun Dhillon
2020-01-05 13:30 ` Christian Brauner [this message]
2020-01-17 23:06 ` Matthew Wilcox
2020-01-17 23:14 ` Aleksa Sarai
2020-01-03 16:29 ` [PATCH v8 3/3] test: Add test for pidfd getfd Sargun Dhillon
2020-01-05 14:20 ` Christian Brauner
2020-01-05 19:08 ` Sargun Dhillon
2020-01-06 17:19 ` Christian Brauner
2020-01-06 21:06 ` Sargun Dhillon
2020-01-07 8:55 ` Christian Brauner
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=20200105133005.ezt4y4d4oat55u6h@wittgenstein \
--to=christian.brauner@ubuntu.com \
--cc=arnd@arndb.de \
--cc=containers@lists.linux-foundation.org \
--cc=cyphar@cyphar.com \
--cc=ealvarez@mozilla.com \
--cc=fweimer@redhat.com \
--cc=gpascutto@mozilla.com \
--cc=jannh@google.com \
--cc=jld@mozilla.com \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=oleg@redhat.com \
--cc=sargun@sargun.me \
--cc=tycho@tycho.ws \
--cc=viro@zeniv.linux.org.uk \
/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).