Skip to contentSkip to conversation

proc.5: Fix an outdated note about map_files

PATCH In review Keno Fischer 2 participants 2 messages Apr 12, 2020 – Apr 13, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proc.5: Fix an outdated note about map_files

The restriction to CAP_SYS_ADMIN was removed from map_files in 2015 [1]. There was a fixme that indicted this might happen, but the main text was never updated when this commit landed. While we're at it, add a note about the ptrace access check that is still required.

[1] https://github.com/torvalds/linux/commit/bdb4d100afe9818aebd1d98ced575c5ef143456c

---
 man5/proc.5 | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
man5/proc.5 +10 -8
index 34cb957dd..0d6043c8f 100644
@@ -1090,16 +1090,18 @@ lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33
 .EE
 .in
 .IP
-This directory appears only if the
+Permission to access this file is governed by a ptrace access mode
+.B PTRACE_MODE_READ_FSCREDS
+check; see
+.BR ptrace (2).
+.IP
+.\" This permissions check got removed in kernel commit bdb4d100a
+Until kernel version 4.3, this directory appeared only if the
 .B CONFIG_CHECKPOINT_RESTORE
-kernel configuration option is enabled.
-Privilege
+kernel configuration option was enabled.
+Additionally, in those kernel versions, privilege
 .RB ( CAP_SYS_ADMIN )
-.\" FIXME
-.\" This may change. See the mail thread
-.\" "[RFC][PATCH v2] procfs: Always expose /proc/<pid>/map_files/ and make it readable"
-.\" from Jan 2015
-is required to view the contents of this directory.
+was required to view the contents of this directory.
 .TP
 .I /proc/[pid]/maps
 A file containing the currently mapped memory regions and their access
Signature · 1 line
2.25.1
#1 lore raw

Hello Keno,

Quoted 7 lines · Keno Fischer

The restriction to CAP_SYS_ADMIN was removed from map_files in 2015 [1]. There was a fixme that indicted this might happen, but the main text was never updated when this commit landed. While we're at it, add a note about the ptrace access check that is still required.>
[1] https://github.com/torvalds/linux/commit/bdb4d100afe9818aebd1d98ced575c5ef143456c

Thank you. Such a nicely written patch!

The FIXME was mine, bit obviously I lost the plot after I wrote it. Thanks for catching this.

Patch applied.

Cheers,

Michael

Quoted 36 lines
---
 man5/proc.5 | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
man5/proc.5 +10 -8
index 34cb957dd..0d6043c8f 100644
@@ -1090,16 +1090,18 @@ lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33
 .EE
 .in
 .IP
-This directory appears only if the
+Permission to access this file is governed by a ptrace access mode
+.B PTRACE_MODE_READ_FSCREDS
+check; see
+.BR ptrace (2).
+.IP
+.\" This permissions check got removed in kernel commit bdb4d100a
+Until kernel version 4.3, this directory appeared only if the
 .B CONFIG_CHECKPOINT_RESTORE
-kernel configuration option is enabled.
-Privilege
+kernel configuration option was enabled.
+Additionally, in those kernel versions, privilege
 .RB ( CAP_SYS_ADMIN )
-.\" FIXME
-.\" This may change. See the mail thread
-.\" "[RFC][PATCH v2] procfs: Always expose /proc/<pid>/map_files/ and make it readable"
-.\" from Jan 2015
-is required to view the contents of this directory.
+was required to view the contents of this directory.
 .TP
 .I /proc/[pid]/maps
 A file containing the currently mapped memory regions and their access
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/