aboutsummaryrefslogtreecommitdiffstats
path: root/man/man5/proc_pid.5
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-04-26 15:06:49 +0200
committerAlejandro Colomar <alx@kernel.org>2024-05-02 01:24:19 +0200
commitdcde2f70372b49ec43efc5db864c9ff585d0a2dd (patch)
tree78b9b7425130e4a5858e4c01a524d802423879ed /man/man5/proc_pid.5
parent12aca537ce78a41bbcdaf485209691e10f8002d7 (diff)
downloadman-pages-dcde2f70372b49ec43efc5db864c9ff585d0a2dd.tar.gz
man/, share/mk/: Move man*/ to man/
This is a scripted change: $ mkdir man/; $ mv man* man/; $ ln -st . man/man*; $ find share/mk/ -type f \ | xargs grep -l '^MANDIR *:=' \ | xargs sed -i '/^MANDIR *:=/s,$,/man,'; $ find share/mk/dist/ -type f \ | xargs grep -l man \ | xargs sed -i 's,man%,man/%,g'; Link: <https://lore.kernel.org/linux-man/YxcV4h+Xn7cd6+q2@pevik/T/> Cc: Petr Vorel <pvorel@suse.cz> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man/man5/proc_pid.5')
-rw-r--r--man/man5/proc_pid.573
1 files changed, 73 insertions, 0 deletions
diff --git a/man/man5/proc_pid.5 b/man/man5/proc_pid.5
new file mode 100644
index 0000000000..16c1a3c158
--- /dev/null
+++ b/man/man5/proc_pid.5
@@ -0,0 +1,73 @@
+.\" Copyright (C) 1994, 1995, Daniel Quinlan <quinlan@yggdrasil.com>
+.\" Copyright (C) 2002-2008, 2017, Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Copyright (C) 2023, Alejandro Colomar <alx@kernel.org>
+.\"
+.\" SPDX-License-Identifier: GPL-3.0-or-later
+.\"
+.TH proc_pid 5 (date) "Linux man-pages (unreleased)"
+.SH NAME
+/proc/pid/, /proc/self/ \- process information
+.SH DESCRIPTION
+.TP
+.IR /proc/ pid /
+There is a numerical subdirectory for each running process; the
+subdirectory is named by the process ID.
+Each
+.IR /proc/ pid
+subdirectory contains the pseudo-files and directories described below.
+.IP
+The files inside each
+.IR /proc/ pid
+directory are normally owned by the effective user and
+effective group ID of the process.
+However, as a security measure, the ownership is made
+.I root:root
+if the process's "dumpable" attribute is set to a value other than 1.
+.IP
+Before Linux 4.11,
+.\" commit 68eb94f16227336a5773b83ecfa8290f1d6b78ce
+.I root:root
+meant the "global" root user ID and group ID
+(i.e., UID 0 and GID 0 in the initial user namespace).
+Since Linux 4.11,
+if the process is in a noninitial user namespace that has a
+valid mapping for user (group) ID 0 inside the namespace, then
+the user (group) ownership of the files under
+.IR /proc/ pid
+is instead made the same as the root user (group) ID of the namespace.
+This means that inside a container,
+things work as expected for the container "root" user.
+.IP
+The process's "dumpable" attribute may change for the following reasons:
+.RS
+.IP \[bu] 3
+The attribute was explicitly set via the
+.BR prctl (2)
+.B PR_SET_DUMPABLE
+operation.
+.IP \[bu]
+The attribute was reset to the value in the file
+.I /proc/sys/fs/suid_dumpable
+(described below), for the reasons described in
+.BR prctl (2).
+.RE
+.IP
+Resetting the "dumpable" attribute to 1 reverts the ownership of the
+.IR /proc/ pid /*
+files to the process's effective UID and GID.
+Note, however, that if the effective UID or GID is subsequently modified,
+then the "dumpable" attribute may be reset, as described in
+.BR prctl (2).
+Therefore, it may be desirable to reset the "dumpable" attribute
+.I after
+making any desired changes to the process's effective UID or GID.
+.TP
+.I /proc/self/
+This directory refers to the process accessing the
+.I /proc
+filesystem,
+and is identical to the
+.I /proc
+directory named by the process ID of the same process.
+.SH SEE ALSO
+.BR proc (5)