mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [GIT PULL] core process updates for v5.4
@ 2019-09-04 13:34 Christian Brauner
  2019-09-10 16:00 ` [GIT PULL v1] " Christian Brauner
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Brauner @ 2019-09-04 13:34 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Hi Linus,

This pull request includes the current process group and pidfd extensions
for the waitid() syscall, an extension to select a specifc pid for
clone3(), and various tests.
All changes are centered around process management not just the pidfd api.
For this reason the tag name is core-process-v5.4. If you have objections
and would rather see this split in separate PRs, please tell me.
With LPC/KSummit coming up and some additional travel I want to get this
out early before I'll start to see the first signs of
conference-season-brain.

The following changes since commit 5f9e832c137075045d15cd6899ab0505cfb2ca4b:

  Linus 5.3-rc1 (2019-07-21 14:05:38 -0700)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux tags/core-process-v5.4

for you to fetch changes up to 590ef0128b4277eaa9cb74d7ba878d48b261950c:

  waitid: Add support for waiting for the current process group (2019-08-14 22:20:47 +0200)

/* Summary */
This tag contains three features and various tests.

First, it adds support for waiting on process through pidfds by adding the
P_PIDFD type to the waitid() syscall. This completes the basic
functionality of the pidfd api (cf. [1]).
In the meantime we also have a new adition to the userspace projects that
make use of the pidfd api. The qt project was nice enough to send a mail
pointing out that they have a pr up to switch to the pidfd api (cf. [2]).

Second, this tag contains an extension to the waitid() syscall to make it
possible to wait on the current process group in a race free manner (even
though the actual problem is very unlikely) by specifing 0 together with
the P_PGID type. This extension traces back to a discussion on the glibc
development mailing list.

Third, this tag extends the clone3() syscall to create a process with a
specific PID to eliminate a race the checkpoint/restore crowd has been
struggling with in userspace. In order to request a process with a specific
PID the caller needs to have CAP_SYS_ADMIN in the owning user namespace of
the target pid namespace the process is supposed to be created in. The
target pid namespace also needs to either already have an init process with
PID 1 or the first clone3() call requesting a specific PID needs to request
PID 1.

There are also a range of tests for the features above. Additionally, the
test-suite which detected the pidfd-polling race we fixed in [3] is
included in this tag.

/* Testing */
All patches are based on v5.3-rc1 and have been sitting in linux-next since
then or at least before v5.3-rc3. None of them have caused failures or
warnings and they are passing the tests accompanying them.

/* Conflicts */
At the time of creating this PR no merge conflicts were observed in
linux-next.

Please consider pulling these changes from the signed core-process-v5.4 tag.

Thanks!
Christian

/* References */
[1]: https://lwn.net/Articles/794707/
[2]: https://codereview.qt-project.org/c/qt/qtbase/+/108456
[3]: commit b191d6491be6 ("pidfd: fix a poll race when setting exit_state")

----------------------------------------------------------------
core-process-v5.4

----------------------------------------------------------------
Adrian Reber (2):
      fork: extend clone3() to support setting a PID
      selftests: add tests for clone3()

Christian Brauner (2):
      pidfd: add P_PIDFD to waitid()
      pidfd: add pidfd_wait tests

Eric W. Biederman (1):
      waitid: Add support for waiting for the current process group

Suren Baghdasaryan (2):
      tests: move common definitions and functions into pidfd.h
      tests: add pidfd poll tests

 include/linux/pid.h                             |   6 +-
 include/linux/sched/task.h                      |   1 +
 include/uapi/linux/sched.h                      |   1 +
 include/uapi/linux/wait.h                       |   1 +
 kernel/exit.c                                   |  38 +++-
 kernel/fork.c                                   |  22 +-
 kernel/pid.c                                    |  37 +++-
 kernel/signal.c                                 |   7 +-
 tools/testing/selftests/clone3/.gitignore       |   2 +
 tools/testing/selftests/clone3/Makefile         |  11 +
 tools/testing/selftests/clone3/clone3.c         | 231 ++++++++++++++++++++
 tools/testing/selftests/clone3/clone3_set_tid.c | 161 ++++++++++++++
 tools/testing/selftests/pidfd/.gitignore        |   2 +
 tools/testing/selftests/pidfd/Makefile          |   2 +-
 tools/testing/selftests/pidfd/pidfd.h           |  30 +++
 tools/testing/selftests/pidfd/pidfd_open_test.c |   5 -
 tools/testing/selftests/pidfd/pidfd_poll_test.c | 117 ++++++++++
 tools/testing/selftests/pidfd/pidfd_test.c      |  14 --
 tools/testing/selftests/pidfd/pidfd_wait.c      | 271 ++++++++++++++++++++++++
 19 files changed, 923 insertions(+), 36 deletions(-)
 create mode 100644 tools/testing/selftests/clone3/.gitignore
 create mode 100644 tools/testing/selftests/clone3/Makefile
 create mode 100644 tools/testing/selftests/clone3/clone3.c
 create mode 100644 tools/testing/selftests/clone3/clone3_set_tid.c
 create mode 100644 tools/testing/selftests/pidfd/pidfd_poll_test.c
 create mode 100644 tools/testing/selftests/pidfd/pidfd_wait.c

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [GIT PULL v1] core process updates for v5.4
  2019-09-04 13:34 [GIT PULL] core process updates for v5.4 Christian Brauner
@ 2019-09-10 16:00 ` Christian Brauner
  2019-09-16 21:35   ` pr-tracker-bot
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Brauner @ 2019-09-10 16:00 UTC (permalink / raw)
  To: linux-kernel, torvalds

Hi Linus,

This is a resend of the pull request for v5.4 with the clone3 extension for
choosing a specific pid at process creation time _dropped_: After an
in-person discussion between multiple parties at LPC/KSummit use-cases were
presented that require restoring nested pid namespaces. This means clone3
would need to create a process with specific pids in multiple pid
namespaces not just a single one. For this reason, it seems wise to delay
this feature one more cycle to get the semantics for this right. Sorry for
the churn! The rest is _unchanged_.

This pull request includes the current process group and pidfd extensions
for the waitid() syscall and various tests.
All changes are centered around process management not just the pidfd api.
For this reason the tag name is core-process-v5.4. If you have objections
and would rather see this split in separate PRs, please tell me.

The following changes since commit 5f9e832c137075045d15cd6899ab0505cfb2ca4b:

  Linus 5.3-rc1 (2019-07-21 14:05:38 -0700)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux tags/core-process-v5.4

for you to fetch changes up to 821cc7b0b205c0df64cce59aacc330af251fa8f7:

  waitid: Add support for waiting for the current process group (2019-09-10 17:05:46 +0200)

/* Summary */
This tag contains two features and various tests.

First, it adds support for waiting on process through pidfds by adding the
P_PIDFD type to the waitid() syscall. This completes the basic
functionality of the pidfd api (cf. [1]).
In the meantime we also have a new adition to the userspace projects that
make use of the pidfd api. The qt project was nice enough to send a mail
pointing out that they have a pr up to switch to the pidfd api (cf. [2]).

Second, this tag contains an extension to the waitid() syscall to make it
possible to wait on the current process group in a race free manner (even
though the actual problem is very unlikely) by specifing 0 together with
the P_PGID type. This extension traces back to a discussion on the glibc
development mailing list.

There are also a range of tests for the features above. Additionally, the
test-suite which detected the pidfd-polling race we fixed in [3] is
included in this tag.

/* Testing */
All patches are based on v5.3-rc1 and have been sitting in linux-next since
then or at least before v5.3-rc3. None of them have caused failures or
warnings and they are passing the tests accompanying them.

/* Conflicts */
At the time of creating this PR no merge conflicts were observed in
linux-next.

Please consider pulling these changes from the signed core-process-v5.4 tag.

Thanks!
Christian

/* References */
[1]: https://lwn.net/Articles/794707/
[2]: https://codereview.qt-project.org/c/qt/qtbase/+/108456
[3]: commit b191d6491be6 ("pidfd: fix a poll race when setting exit_state")

----------------------------------------------------------------
core-process-v5.4

----------------------------------------------------------------
Christian Brauner (2):
      pidfd: add P_PIDFD to waitid()
      pidfd: add pidfd_wait tests

Eric W. Biederman (1):
      waitid: Add support for waiting for the current process group

Suren Baghdasaryan (2):
      tests: move common definitions and functions into pidfd.h
      tests: add pidfd poll tests

 include/linux/pid.h                             |   4 +
 include/uapi/linux/wait.h                       |   1 +
 kernel/exit.c                                   |  38 +++-
 kernel/fork.c                                   |   8 +
 kernel/signal.c                                 |   7 +-
 tools/testing/selftests/pidfd/.gitignore        |   2 +
 tools/testing/selftests/pidfd/Makefile          |   2 +-
 tools/testing/selftests/pidfd/pidfd.h           |  30 +++
 tools/testing/selftests/pidfd/pidfd_open_test.c |   5 -
 tools/testing/selftests/pidfd/pidfd_poll_test.c | 117 ++++++++++
 tools/testing/selftests/pidfd/pidfd_test.c      |  14 --
 tools/testing/selftests/pidfd/pidfd_wait.c      | 271 ++++++++++++++++++++++++
 12 files changed, 473 insertions(+), 26 deletions(-)
 create mode 100644 tools/testing/selftests/pidfd/pidfd_poll_test.c
 create mode 100644 tools/testing/selftests/pidfd/pidfd_wait.c

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [GIT PULL v1] core process updates for v5.4
  2019-09-10 16:00 ` [GIT PULL v1] " Christian Brauner
@ 2019-09-16 21:35   ` pr-tracker-bot
  0 siblings, 0 replies; 3+ messages in thread
From: pr-tracker-bot @ 2019-09-16 21:35 UTC (permalink / raw)
  To: Christian Brauner; +Cc: linux-kernel, torvalds

The pull request you sent on Tue, 10 Sep 2019 18:00:51 +0200:

> git@gitolite.kernel.org:pub/scm/linux/kernel/git/brauner/linux tags/core-process-v5.4

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/c17112a5c413f20188da276c138484e7127cdc84

Thank you!

-- 
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-16 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 13:34 [GIT PULL] core process updates for v5.4 Christian Brauner
2019-09-10 16:00 ` [GIT PULL v1] " Christian Brauner
2019-09-16 21:35   ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®