@@ -51,6 +51,8 @@ fixes/update part 1.1 Stefani Seibold <
[email protected] > June 9 2009
51
51
4 Configuring procfs
52
52
4.1 Mount options
53
53
54
+ 5 Filesystem behavior
55
+
54
56
Preface
55
57
=======
56
58
@@ -2142,6 +2144,7 @@ The following mount options are supported:
2142
2144
========= ========================================================
2143
2145
hidepid= Set /proc/<pid>/ access mode.
2144
2146
gid= Set the group authorized to learn processes information.
2147
+ subset= Show only the specified subset of procfs.
2145
2148
========= ========================================================
2146
2149
2147
2150
hidepid=0 means classic mode - everybody may access all /proc/<pid>/ directories
@@ -2164,6 +2167,57 @@ information about running processes, whether some daemon runs with elevated
2164
2167
privileges, whether other user runs some sensitive program, whether other users
2165
2168
run any program at all, etc.
2166
2169
2170
+ hidepid=4 means that procfs should only contain /proc/<pid>/ directories
2171
+ that the caller can ptrace.
2172
+
2167
2173
gid= defines a group authorized to learn processes information otherwise
2168
2174
prohibited by hidepid=. If you use some daemon like identd which needs to learn
2169
2175
information about processes information, just add identd to this group.
2176
+
2177
+ subset=pid hides all top level files and directories in the procfs that
2178
+ are not related to tasks.
2179
+
2180
+ 5 Filesystem behavior
2181
+ ----------------------------
2182
+
2183
+ Originally, before the advent of pid namepsace, procfs was a global file
2184
+ system. It means that there was only one procfs instance in the system.
2185
+
2186
+ When pid namespace was added, a separate procfs instance was mounted in
2187
+ each pid namespace. So, procfs mount options are global among all
2188
+ mountpoints within the same namespace.
2189
+
2190
+ ::
2191
+
2192
+ # grep ^proc /proc/mounts
2193
+ proc /proc proc rw,relatime,hidepid=2 0 0
2194
+
2195
+ # strace -e mount mount -o hidepid=1 -t proc proc /tmp/proc
2196
+ mount("proc", "/tmp/proc", "proc", 0, "hidepid=1") = 0
2197
+ +++ exited with 0 +++
2198
+
2199
+ # grep ^proc /proc/mounts
2200
+ proc /proc proc rw,relatime,hidepid=2 0 0
2201
+ proc /tmp/proc proc rw,relatime,hidepid=2 0 0
2202
+
2203
+ and only after remounting procfs mount options will change at all
2204
+ mountpoints.
2205
+
2206
+ # mount -o remount,hidepid=1 -t proc proc /tmp/proc
2207
+
2208
+ # grep ^proc /proc/mounts
2209
+ proc /proc proc rw,relatime,hidepid=1 0 0
2210
+ proc /tmp/proc proc rw,relatime,hidepid=1 0 0
2211
+
2212
+ This behavior is different from the behavior of other filesystems.
2213
+
2214
+ The new procfs behavior is more like other filesystems. Each procfs mount
2215
+ creates a new procfs instance. Mount options affect own procfs instance.
2216
+ It means that it became possible to have several procfs instances
2217
+ displaying tasks with different filtering options in one pid namespace.
2218
+
2219
+ # mount -o hidepid=2 -t proc proc /proc
2220
+ # mount -o hidepid=1 -t proc proc /tmp/proc
2221
+ # grep ^proc /proc/mounts
2222
+ proc /proc proc rw,relatime,hidepid=2 0 0
2223
+ proc /tmp/proc proc rw,relatime,hidepid=1 0 0
0 commit comments