| 1 |
.\" Copyright 1994-1995, Daniel Quinlan <[email protected]> |
| 2 |
.\" Copyright 2002-2017, Michael Kerrisk <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: GPL-3.0-or-later |
| 6 |
.\" |
| 7 |
.TH proc_pid 5 2026-03-18 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
/proc/pid/, /proc/self/ \- process information |
| 10 |
.SH DESCRIPTION |
| 11 |
.TP |
| 12 |
.IR /proc/ pid / |
| 13 |
There is a numerical subdirectory for each running process; |
| 14 |
the subdirectory is named by the process ID. |
| 15 |
Each |
| 16 |
.IR /proc/ pid |
| 17 |
subdirectory contains the pseudo-files and directories described below. |
| 18 |
.IP |
| 19 |
The files inside each |
| 20 |
.IR /proc/ pid |
| 21 |
directory are normally owned by the effective user and |
| 22 |
effective group ID of the process. |
| 23 |
However, as a security measure, the ownership is made |
| 24 |
.I root:root |
| 25 |
if the process's "dumpable" attribute is set to a value other than 1. |
| 26 |
.IP |
| 27 |
Before Linux 4.11, |
| 28 |
.\" commit 68eb94f16227336a5773b83ecfa8290f1d6b78ce |
| 29 |
.I root:root |
| 30 |
meant the "global" root user ID and group ID |
| 31 |
(i.e., UID 0 and GID 0 in the initial user namespace). |
| 32 |
Since Linux 4.11, |
| 33 |
if when the last time the process called |
| 34 |
.BR execve (2), |
| 35 |
it was in a noninitial user namespace that has a |
| 36 |
valid mapping for user (group) ID 0 inside the namespace, then |
| 37 |
the user (group) ownership of the files under |
| 38 |
.IR /proc/ pid |
| 39 |
is instead made the same as the root user (group) ID of the namespace. |
| 40 |
This means that inside a container, |
| 41 |
things work as expected for the container "root" user. |
| 42 |
.IP |
| 43 |
The process's "dumpable" attribute may change for the following reasons: |
| 44 |
.RS |
| 45 |
.IP \[bu] 3 |
| 46 |
The attribute was explicitly set via the |
| 47 |
.BR prctl (2) |
| 48 |
.B PR_SET_DUMPABLE |
| 49 |
operation. |
| 50 |
.IP \[bu] |
| 51 |
The attribute was reset to the value in the file |
| 52 |
.I /proc/sys/fs/suid_dumpable |
| 53 |
(described below), for the reasons described in |
| 54 |
.BR prctl (2). |
| 55 |
.RE |
| 56 |
.IP |
| 57 |
Resetting the "dumpable" attribute to 1 reverts the ownership of the |
| 58 |
.IR /proc/ pid /* |
| 59 |
files to the process's effective UID and GID. |
| 60 |
Note, however, that if the effective UID or GID is subsequently modified, |
| 61 |
then the "dumpable" attribute may be reset, as described in |
| 62 |
.BR prctl (2). |
| 63 |
Therefore, it may be desirable to reset the "dumpable" attribute |
| 64 |
.I after |
| 65 |
making any desired changes to the process's effective UID or GID. |
| 66 |
.IP |
| 67 |
See also: |
| 68 |
.RS |
| 69 |
.TP |
| 70 |
.BR proc_pid_attr (5) |
| 71 |
.TQ |
| 72 |
.BR proc_pid_autogroup (5) |
| 73 |
.TQ |
| 74 |
.BR proc_pid_auxv (5) |
| 75 |
.TQ |
| 76 |
.BR proc_pid_cgroup (5) |
| 77 |
.TQ |
| 78 |
.BR proc_pid_clear_refs (5) |
| 79 |
.TQ |
| 80 |
.BR proc_pid_cmdline (5) |
| 81 |
.TQ |
| 82 |
.BR proc_pid_comm (5) |
| 83 |
.TQ |
| 84 |
.BR proc_pid_coredump_filter (5) |
| 85 |
.TQ |
| 86 |
.BR proc_pid_cpuset (5) |
| 87 |
.TQ |
| 88 |
.BR proc_pid_cwd (5) |
| 89 |
.TQ |
| 90 |
.BR proc_pid_environ (5) |
| 91 |
.TQ |
| 92 |
.BR proc_pid_exe (5) |
| 93 |
.TQ |
| 94 |
.BR proc_pid_fd (5) |
| 95 |
.TQ |
| 96 |
.BR proc_pid_fdinfo (5) |
| 97 |
.TQ |
| 98 |
.BR proc_pid_gid_map (5) |
| 99 |
.TQ |
| 100 |
.BR proc_pid_io (5) |
| 101 |
.TQ |
| 102 |
.BR proc_pid_limits (5) |
| 103 |
.TQ |
| 104 |
.BR proc_pid_map_files (5) |
| 105 |
.TQ |
| 106 |
.BR proc_pid_maps (5) |
| 107 |
.TQ |
| 108 |
.BR proc_pid_mem (5) |
| 109 |
.TQ |
| 110 |
.BR proc_pid_mountinfo (5) |
| 111 |
.TQ |
| 112 |
.BR proc_pid_mounts (5) |
| 113 |
.TQ |
| 114 |
.BR proc_pid_mountstats (5) |
| 115 |
.TQ |
| 116 |
.BR proc_pid_net (5) |
| 117 |
.TQ |
| 118 |
.BR proc_pid_ns (5) |
| 119 |
.TQ |
| 120 |
.BR proc_pid_numa_maps (5) |
| 121 |
.TQ |
| 122 |
.BR proc_pid_oom_adj (5) |
| 123 |
.TQ |
| 124 |
.BR proc_pid_oom_score (5) |
| 125 |
.TQ |
| 126 |
.BR proc_pid_oom_score_adj (5) |
| 127 |
.TQ |
| 128 |
.BR proc_pid_pagemap (5) |
| 129 |
.TQ |
| 130 |
.BR proc_pid_personality (5) |
| 131 |
.TQ |
| 132 |
.BR proc_pid_projid_map (5) |
| 133 |
.TQ |
| 134 |
.BR proc_pid_root (5) |
| 135 |
.TQ |
| 136 |
.BR proc_pid_seccomp (5) |
| 137 |
.TQ |
| 138 |
.BR proc_pid_setgroups (5) |
| 139 |
.TQ |
| 140 |
.BR proc_pid_smaps (5) |
| 141 |
.TQ |
| 142 |
.BR proc_pid_stack (5) |
| 143 |
.TQ |
| 144 |
.BR proc_pid_stat (5) |
| 145 |
.TQ |
| 146 |
.BR proc_pid_statm (5) |
| 147 |
.TQ |
| 148 |
.BR proc_pid_status (5) |
| 149 |
.TQ |
| 150 |
.BR proc_pid_syscall (5) |
| 151 |
.TQ |
| 152 |
.BR proc_pid_task (5) |
| 153 |
.TQ |
| 154 |
.BR proc_pid_timers (5) |
| 155 |
.TQ |
| 156 |
.BR proc_pid_timerslack_ns (5) |
| 157 |
.TQ |
| 158 |
.BR proc_pid_uid_map (5) |
| 159 |
.TQ |
| 160 |
.BR proc_pid_wchan (5) |
| 161 |
.RE |
| 162 |
.TP |
| 163 |
.I /proc/self/ |
| 164 |
This directory refers to the process accessing the |
| 165 |
.I /proc |
| 166 |
filesystem, |
| 167 |
and is identical to the |
| 168 |
.I /proc |
| 169 |
directory named by the process ID of the same process. |
| 170 |
.SH SEE ALSO |
| 171 |
.BR proc (5) |