No description
Find a file
Christian Brauner abd43bb345 UPSTREAM: pid: add pidfd_open()
This adds the pidfd_open() syscall. It allows a caller to retrieve pollable
pidfds for a process which did not get created via CLONE_PIDFD, i.e. for a
process that is created via traditional fork()/clone() calls that is only
referenced by a PID:

int pidfd = pidfd_open(1234, 0);
ret = pidfd_send_signal(pidfd, SIGSTOP, NULL, 0);

With the introduction of pidfds through CLONE_PIDFD it is possible to
created pidfds at process creation time.
However, a lot of processes get created with traditional PID-based calls
such as fork() or clone() (without CLONE_PIDFD). For these processes a
caller can currently not create a pollable pidfd. This is a problem for
Android's low memory killer (LMK) and service managers such as systemd.
Both are examples of tools that want to make use of pidfds to get reliable
notification of process exit for non-parents (pidfd polling) and race-free
signal sending (pidfd_send_signal()). They intend to switch to this API for
process supervision/management as soon as possible. Having no way to get
pollable pidfds from PID-only processes is one of the biggest blockers for
them in adopting this api. With pidfd_open() making it possible to retrieve
pidfds for PID-based processes we enable them to adopt this api.

In line with Arnd's recent changes to consolidate syscall numbers across
architectures, I have added the pidfd_open() syscall to all architectures
at the same time.

Signed-off-by: Christian Brauner <christian@brauner.io>
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jann Horn <jannh@google.com>
Cc: Andy Lutomirsky <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Aleksa Sarai <cyphar@cyphar.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-api@vger.kernel.org

(cherry picked from commit 32fcb426ec001cb6d5a4a195091a8486ea77e2df)

Bug: 135608568
Test: test program using syscall(__NR_sys_pidfd_open,..) and poll()
Change-Id: I97583cfa441a08585cbedf9a44f982c0d0ee5583
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-08-12 13:36:37 -04:00
arch UPSTREAM: Make anon_inodes unconditional 2019-08-12 13:36:37 -04:00
block This is the 4.19.64 stable release 2019-08-04 09:37:11 +02:00
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() 2018-08-22 23:21:44 +09:00
crypto This is the 4.19.61 stable release 2019-07-26 10:31:53 +02:00
Documentation This is the 4.19.65 stable release 2019-08-06 20:08:18 +02:00
drivers UPSTREAM: Make anon_inodes unconditional 2019-08-12 13:36:37 -04:00
firmware kbuild: remove all dummy assignments to obj- 2017-11-18 11:46:06 +09:00
fs UPSTREAM: Make anon_inodes unconditional 2019-08-12 13:36:37 -04:00
include UPSTREAM: pid: add pidfd_open() 2019-08-12 13:36:37 -04:00
init UPSTREAM: Make anon_inodes unconditional 2019-08-12 13:36:37 -04:00
ipc This is the 4.19.65 stable release 2019-08-06 20:08:18 +02:00
kernel UPSTREAM: pid: add pidfd_open() 2019-08-12 13:36:37 -04:00
lib This is the 4.19.65 stable release 2019-08-06 20:08:18 +02:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
mm This is the 4.19.65 stable release 2019-08-06 20:08:18 +02:00
net This is the 4.19.66 stable release 2019-08-11 15:21:36 +02:00
samples samples, bpf: suppress compiler warning 2019-07-14 08:11:04 +02:00
scripts This is the 4.19.65 stable release 2019-08-06 20:08:18 +02:00
security This is the 4.19.65 stable release 2019-08-06 20:08:18 +02:00
sound ALSA: hda: Fix 1-minute detection delay when i915 module is not available 2019-08-06 19:06:54 +02:00
tools This is the 4.19.65 stable release 2019-08-06 20:08:18 +02:00
usr initramfs: move gen_initramfs_list.sh from scripts/ to usr/ 2018-08-22 23:21:44 +09:00
virt KVM: arm/arm64: vgic: Fix kvm_device leak in vgic_its_destroy 2019-07-14 08:11:10 +02:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig
.get_maintainer.ignore
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
.mailmap libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
abi_gki_aarch64.xml ANDROID: update ABI dump 2019-08-09 14:34:19 -07:00
build.config.cuttlefish.aarch64 ANDROID: Enable LTO and CFI 2019-05-22 17:25:23 +00:00
build.config.cuttlefish.x86_64 ANDROID: Enable LTO and CFI 2019-05-22 17:25:23 +00:00
build.config.gki.aarch64 ANDROID: add GKI artifacts 2019-07-31 10:57:50 -07:00
build.config.gki.x86_64 ANDROID: add GKI artifacts 2019-07-31 10:57:50 -07:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS 9p: remove Ron Minnich from MAINTAINERS 2018-08-17 16:20:26 -07:00
Kbuild Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
MAINTAINERS platform/x86: Add Intel AtomISP2 dummy / power-management driver 2019-04-20 09:16:02 +02:00
Makefile This is the 4.19.66 stable release 2019-08-11 15:21:36 +02:00
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.