Thread (82 messages) flat view 82 messages, 12 authors, 2019-04-01

Re: [PATCH v2 0/5] pid: add pidfd_open()

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2019-03-31 14:52:49
Also in: lkml

On Sat, Mar 30, 2019 at 9:47 PM Jann Horn [off-list ref] wrote:
Sure, given a pidfd_clone() syscall, as long as the parent of the
process is giving you a pidfd for it and you don't have to deal with
grandchildren created by fork() calls outside your control, that
works.
Don't do pidfd_clone() and pidfd_wait().

Both of those existing system calls already get a "flags" argument.
Just make a WPIDFD (for waitid) and CLONE_PIDFD (for clone) bit, and
make the existing system calls just take/return a pidfd.

Side note: we could (should?) also make the default maxpid just be
larger. It needs to fit in an 'int', but MAXINT instead of 65535 would
likely alreadt make a lot of these attacks harder.

There was some really old legacy reason why we actually limited it to
65535 originally.  It was old and crufty even back when..

               Linus

              Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help