android_kernel_xiaomi_sm7250/kernel
Christian Brauner 7624e199e8 BACKPORT: pidfd: add P_PIDFD to waitid()
This adds the P_PIDFD type to waitid().
One of the last remaining bits for the pidfd api is to make it possible
to wait on pidfds. With P_PIDFD added to waitid() the parts of userspace
that want to use the pidfd api to exclusively manage processes can do so
now.

One of the things this will unblock in the future is the ability to make
it possible to retrieve the exit status via waitid(P_PIDFD) for
non-parent processes if handed a _suitable_ pidfd that has this feature
set. This is similar to what you can do on FreeBSD with kqueue(). It
might even end up being possible to wait on a process as a non-parent if
an appropriate property is enabled on the pidfd.

With P_PIDFD no scoping of the process identified by the pidfd is
possible, i.e. it explicitly blocks things such as wait4(-1), wait4(0),
waitid(P_ALL), waitid(P_PGID) etc. It only allows for semantics
equivalent to wait4(pid), waitid(P_PID). Users that need scoping should
rely on pid-based wait*() syscalls for now.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: David Howells <dhowells@redhat.com>
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>
Link: https://lore.kernel.org/r/20190727222229.6516-2-christian@brauner.io
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Change-Id: I36487605a451cbaad74f2887b59d741f760aaba4
2022-11-12 11:23:08 +00:00
..
bpf This is the 4.19.262 stable release 2022-10-30 16:23:17 +01:00
cgroup FROMLIST: mm: multi-gen LRU: kill switch 2022-11-12 11:21:16 +00:00
configs
debug
dma Merge remote-tracking branch 'aosp/android-4.19-stable' into android12-base 2022-07-09 10:34:17 +05:30
events mm/mmap.c: use IS_ERR_VALUE to check return value of get_unmapped_area 2022-11-12 11:21:20 +00:00
gcov This is the 4.19.262 stable release 2022-10-30 16:23:17 +01:00
irq irq: silence 'irq no longer affine' messages 2022-11-12 11:19:54 +00:00
livepatch livepatch: fix race between fork and KLP transition 2022-10-26 13:19:23 +02:00
locking
power PM / sleep: Skip OOM killer toggles when kernel is compiled for Android 2022-11-12 11:21:40 +00:00
printk printk: silence healthd and batteryd logs 2022-11-12 11:19:57 +00:00
rcu rcu: fix a performance regression 2022-11-12 11:19:51 +00:00
sched BACKPORT: ia64/tlb: Eradicate tlb_migrate_finish() callback 2022-11-12 11:23:07 +00:00
time BACKPORT: timers: implement usleep_idle_range() 2022-11-12 11:22:50 +00:00
trace Merge branch 'android-4.19-stable' of https://github.com/aosp-mirror/kernel_common into skizo-x 2022-11-12 11:18:12 +00:00
.gitignore
acct.c
async.c
audit_fsnotify.c audit: fix potential double free on error path from fsnotify_add_inode_mark 2022-09-05 10:26:28 +02:00
audit_tree.c
audit_watch.c
audit.c
audit.h
auditfilter.c
auditsc.c
backtracetest.c
bounds.c FROMLIST: mm: multi-gen LRU: minimal implementation 2022-11-12 11:21:16 +00:00
capability.c
cfi.c
compat.c
configs.c
context_tracking.c
cpu_pm.c
cpu.c Merge branch 'android-4.19-stable' of https://github.com/aosp-mirror/kernel_common into skizo-x 2022-11-12 11:18:12 +00:00
crash_core.c
crash_dump.c
cred.c
delayacct.c
dma.c
exec_domain.c
exit.c BACKPORT: pidfd: add P_PIDFD to waitid() 2022-11-12 11:23:08 +00:00
extable.c
fail_function.c
fork.c BACKPORT: pidfd: add P_PIDFD to waitid() 2022-11-12 11:23:08 +00:00
freezer.c
futex.c
gen_kheaders.sh
groups.c
hung_task.c
iomem.c
irq_work.c
jump_label.c
kallsyms.c
kcmp.c
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
kcov.c
kexec_core.c
kexec_file.c kexec_file: drop weak attribute from arch_kexec_apply_relocations[_add] 2022-07-02 16:27:39 +02:00
kexec_internal.h
kexec.c
kheaders.c
kmod.c
kprobes.c kprobes: Prohibit probes in gate area 2022-09-15 12:17:05 +02:00
ksysfs.c
kthread.c
latencytop.c
Makefile kernel: Use the stock config for /proc/config.gz 2022-11-12 11:19:20 +00:00
memremap.c BACKPORT: mm: remove superfluous __ClearPageActive() 2022-11-12 11:21:13 +00:00
module_signing.c
module-internal.h
module.c
notifier.c
nsproxy.c
padata.c
panic.c
params.c
pid_namespace.c
pid.c UPSTREAM: kernel/pid.c: convert struct pid count to refcount_t 2022-11-12 11:23:07 +00:00
profile.c profiling: fix shift too large makes kernel panic 2022-08-25 11:15:20 +02:00
ptrace.c ptrace: Reimplement PTRACE_KILL by always sending SIGKILL 2022-06-14 16:59:14 +02:00
range.c
reboot.c
relay.c
resource.c
rseq.c
scs.c
seccomp.c
signal.c BACKPORT: pidfd: add P_PIDFD to waitid() 2022-11-12 11:23:08 +00:00
smp.c
smpboot.c
smpboot.h
softirq.c
stacktrace.c
stop_machine.c UPSTREAM: stop_machine: Fix stop_cpus_in_progress ordering 2022-11-12 11:20:54 +00:00
sys_ni.c This is the 4.19.257 stable release 2022-09-21 10:22:14 +02:00
sys.c
sysctl_binary.c
sysctl.c mm: compaction: allow using different proactiveness value depending on the screen state 2022-11-12 11:22:27 +00:00
task_work.c
taskstats.c
test_kprobes.c
torture.c
tracepoint.c
tsacct.c
ucount.c
uid16.c
uid16.h
umh.c
up.c
user_namespace.c
user-return-notifier.c
user.c
utsname_sysctl.c
utsname.c
watchdog_hld.c
watchdog.c Merge remote-tracking branch 'aosp/android-4.19-stable' into android12-base 2022-09-22 14:02:10 +05:30
workqueue_internal.h
workqueue.c Merge remote-tracking branch 'aosp/android-4.19-stable' into android12-base 2022-09-29 08:08:04 +05:30