All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Kowalski <bl0pbl33p@gmail.com>
To: Jann Horn <jannh@google.com>
Cc: Daniel Colascione <dancol@google.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Christian Brauner <christian@brauner.io>,
	Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
	Andy Lutomirski <luto@kernel.org>,
	David Howells <dhowells@redhat.com>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Linux API <linux-api@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, Kees Cook <keescook@chromium.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Michael Kerrisk-manpages <mtk.manpages@gmail.com>,
	"Dmitry V. Levin" <ldv@altlinux.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Nagarathnam Muthusamy <nagarathnam.muthusamy@oracle.com>,
	Aleksa Sarai <cyphar@cyphar.com>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 0/4] pid: add pidctl()
Date: Mon, 25 Mar 2019 21:14:54 +0000	[thread overview]
Message-ID: <CAGLj2rGMHfNkRKmb1+BFTuJb+wpXg09so-52Hsb0tMiQ0beMfA@mail.gmail.com> (raw)
In-Reply-To: <CAGLj2rE7k-p=ZniyV6bDm-VbhAdzSSwxYcVV=X_Rsky5nixGvw@mail.gmail.com>

Also,  extending this further, instead of new ioctl flags over to
translate a tidfd one might introduce later for thread targetted
signals (which would still be a pidfd in the struct pid terms, but
with a bit set in its reference to target the selected TID in
particular), you could resolve this neatly to the proc entry of the
task itself, which would be subject to restrictions similar to a
regular open call, minus all the races involved.

This also means you can get rid of having to support the /proc/<PID>
dir fd in pidfd_send_signal, because there is no incentive to, any
longer. The kernel now has just one pidfd object, well scoped in its
purpose, and this "feature" is tied to procfs itself, disabling which
takes away the feature as well.

Otherwise, the ioctl will be conditionally available and/or work only
when procfs is present, and you'd tie procfs to pidfds eternally as
ABI.

WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Kowalski <bl0pbl33p@gmail.com>
To: Jann Horn <jannh@google.com>
Cc: Daniel Colascione <dancol@google.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Christian Brauner <christian@brauner.io>,
	Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
	Andy Lutomirski <luto@kernel.org>,
	David Howells <dhowells@redhat.com>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Linux API <linux-api@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, Kees Cook <keescook@chromium.org>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Michael Kerrisk-manpages <mtk.manpages@gmail.com>,
	"Dmitry V. Levin" <ldv@altlinux.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Nagarathnam Muthusamy <nagarathn>
Subject: Re: [PATCH 0/4] pid: add pidctl()
Date: Mon, 25 Mar 2019 21:14:54 +0000	[thread overview]
Message-ID: <CAGLj2rGMHfNkRKmb1+BFTuJb+wpXg09so-52Hsb0tMiQ0beMfA@mail.gmail.com> (raw)
In-Reply-To: <CAGLj2rE7k-p=ZniyV6bDm-VbhAdzSSwxYcVV=X_Rsky5nixGvw@mail.gmail.com>

Also,  extending this further, instead of new ioctl flags over to
translate a tidfd one might introduce later for thread targetted
signals (which would still be a pidfd in the struct pid terms, but
with a bit set in its reference to target the selected TID in
particular), you could resolve this neatly to the proc entry of the
task itself, which would be subject to restrictions similar to a
regular open call, minus all the races involved.

This also means you can get rid of having to support the /proc/<PID>
dir fd in pidfd_send_signal, because there is no incentive to, any
longer. The kernel now has just one pidfd object, well scoped in its
purpose, and this "feature" is tied to procfs itself, disabling which
takes away the feature as well.

Otherwise, the ioctl will be conditionally available and/or work only
when procfs is present, and you'd tie procfs to pidfds eternally as
ABI.

  reply	other threads:[~2019-03-25 21:15 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 16:20 [PATCH 0/4] pid: add pidctl() Christian Brauner
2019-03-25 16:20 ` [PATCH 1/4] Make anon_inodes unconditional Christian Brauner
2019-03-25 16:20 ` [PATCH 2/4] pid: add pidctl() Christian Brauner
2019-03-25 17:20   ` Mika Penttilä
2019-03-25 19:59     ` Christian Brauner
2019-03-25 19:59       ` Christian Brauner
2019-03-25 18:18   ` Jann Horn
2019-03-25 18:18     ` Jann Horn
2019-03-25 19:58     ` Christian Brauner
2019-03-25 19:58       ` Christian Brauner
2019-03-26 16:07     ` Joel Fernandes
2019-03-26 16:07       ` Joel Fernandes
2019-03-26 16:15       ` Christian Brauner
2019-03-26 16:15         ` Christian Brauner
2019-03-25 16:20 ` [PATCH 3/4] signal: support pidctl() with pidfd_send_signal() Christian Brauner
2019-03-25 18:28   ` Jonathan Kowalski
2019-03-25 18:28     ` Jonathan Kowalski
2019-03-25 20:05     ` Christian Brauner
2019-03-25 20:05       ` Christian Brauner
2019-03-25 18:39   ` Jann Horn
2019-03-25 18:39     ` Jann Horn
2019-03-25 19:41     ` Christian Brauner
2019-03-25 19:41       ` Christian Brauner
2019-03-25 16:20 ` [PATCH 4/4] tests: add pidctl() tests Christian Brauner
2019-03-25 16:48 ` [PATCH 0/4] pid: add pidctl() Daniel Colascione
2019-03-25 16:48   ` Daniel Colascione
2019-03-25 17:05   ` Konstantin Khlebnikov
2019-03-25 17:07     ` Daniel Colascione
2019-03-25 17:07       ` Daniel Colascione
2019-03-25 17:36   ` Joel Fernandes
2019-03-25 17:36     ` Joel Fernandes
2019-03-25 17:53     ` Daniel Colascione
2019-03-25 17:53       ` Daniel Colascione
2019-03-25 18:19       ` Jonathan Kowalski
2019-03-25 18:19         ` Jonathan Kowalski
2019-03-25 18:57         ` Daniel Colascione
2019-03-25 18:57           ` Daniel Colascione
2019-03-25 19:42           ` Jonathan Kowalski
2019-03-25 19:42             ` Jonathan Kowalski
2019-03-25 20:14             ` Daniel Colascione
2019-03-25 20:14               ` Daniel Colascione
2019-03-25 20:34               ` Jann Horn
2019-03-25 20:34                 ` Jann Horn
2019-03-25 20:40                 ` Jonathan Kowalski
2019-03-25 20:40                   ` Jonathan Kowalski
2019-03-25 21:14                   ` Jonathan Kowalski [this message]
2019-03-25 21:14                     ` Jonathan Kowalski
2019-03-25 21:15                   ` Jann Horn
2019-03-25 21:15                     ` Jann Horn
2019-03-25 20:40                 ` Christian Brauner
2019-03-25 20:40                   ` Christian Brauner
2019-03-25 20:15     ` Christian Brauner
2019-03-25 20:15       ` Christian Brauner
2019-03-25 21:11       ` Joel Fernandes
2019-03-25 21:11         ` Joel Fernandes
2019-03-25 21:17         ` Daniel Colascione
2019-03-25 21:17           ` Daniel Colascione
2019-03-25 21:19         ` Jann Horn
2019-03-25 21:19           ` Jann Horn
2019-03-25 21:43           ` Joel Fernandes
2019-03-25 21:43             ` Joel Fernandes
2019-03-25 21:54             ` Jonathan Kowalski
2019-03-25 21:54               ` Jonathan Kowalski
2019-03-25 22:07               ` Daniel Colascione
2019-03-25 22:07                 ` Daniel Colascione
2019-03-25 22:37                 ` Jonathan Kowalski
2019-03-25 22:37                   ` Jonathan Kowalski
2019-03-25 23:14                   ` Daniel Colascione
2019-03-25 23:14                     ` Daniel Colascione
2019-03-26  3:03               ` Joel Fernandes
2019-03-26  3:03                 ` Joel Fernandes
2019-03-25 16:56 ` David Howells
2019-03-25 16:56   ` David Howells
2019-03-25 16:58   ` Daniel Colascione
2019-03-25 16:58     ` Daniel Colascione
2019-03-25 23:39   ` Andy Lutomirski
2019-03-25 23:39     ` Andy Lutomirski

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=CAGLj2rGMHfNkRKmb1+BFTuJb+wpXg09so-52Hsb0tMiQ0beMfA@mail.gmail.com \
    --to=bl0pbl33p@gmail.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=christian@brauner.io \
    --cc=cyphar@cyphar.com \
    --cc=dancol@google.com \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=jannh@google.com \
    --cc=joel@joelfernandes.org \
    --cc=keescook@chromium.org \
    --cc=khlebnikov@yandex-team.ru \
    --cc=ldv@altlinux.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=nagarathnam.muthusamy@oracle.com \
    --cc=oleg@redhat.com \
    --cc=serge@hallyn.com \
    --cc=tglx@linutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.