Skip to contentSkip to conversation

man/man5/proc_pid_smaps{,_rollup}.5: Add proc_pid_smaps_rollup(5)

PATCH Superseded Max Chernoff 2 participants 12 messages Sep 12 – Sep 17 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 man/man5/proc_pid_smaps{,_rollup}.5: Add proc_pid_smaps_rollup(5)

Document /proc/pid/smaps_rollup, which is similar to /proc/pid/smaps, except it merges all mappings are merged into a single synthetic entry [1].

Also, add a better description to the NAME, following the discussion in [2].

Link [1]: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=493b0e9d945fa9dfe96be93ae41b4ca4b6fdb317>
Link [2]: <https://lore.kernel.org/lkml/[email protected]>

---
 man/man5/proc_pid_smaps.5        | 7 ++++++-
 man/man5/proc_pid_smaps_rollup.5 | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 man/man5/proc_pid_smaps_rollup.5
man/man5/proc_pid_smaps.5 +6 -1
index 9c433dbc1e60..51440cc13bf6 100644
@@ -7,7 +7,7 @@
 .\"
 .TH proc_pid_smaps 5 (date) "Linux man-pages (unreleased)"
 .SH NAME
-/proc/pid/smaps \- XXX: What does 's' in "smaps" stand for?
+/proc/pid/smaps, /proc/pid/smaps_rollup \- size of mapped memory regions
 .SH DESCRIPTION
 .TP
 .IR /proc/ pid /smaps " (since Linux 2.6.14)"
@@ -125,5 +125,10 @@
 file is present only if the
 .B CONFIG_PROC_PAGE_MONITOR
 kernel configuration option is enabled.
+.TP
+.IR /proc/ pid /smaps_rollup " (since Linux 4.14)"
+This file is similar to
+.IR /proc/ pid /smaps ,
+except all mappings are merged into a single synthetic entry.
 .SH SEE ALSO
 .BR proc (5)
man/man5/proc_pid_smaps_rollup.5 new file +1 -0
new file mode 100644
index 000000000000..4b5f9eba0484
@@ -0,0 +1 @@
+.so man5/proc_pid_smaps.5

base-commit: 59ba1c34fb6538206e96597739f053183d1e6428

Signature · 1 line
2.55.0
#1 lore raw

PATCH 2/3 man/man5/proc_pid_{smaps,smaps_rollup,maps}.5, man/man7/capabilities.7: CAP_PERFMON allows reading /proc/pid/{smaps,smaps_rollup,maps}

---
 man/man5/proc_pid_maps.5  |  5 ++++-
 man/man5/proc_pid_smaps.5 | 10 ++++++++++
 man/man7/capabilities.7   |  9 ++++++++-
 3 files changed, 22 insertions(+), 2 deletions(-)
man/man5/proc_pid_maps.5 +4 -1
index 8783dbb3a89d..dcd455ea840c 100644
@@ -16,7 +16,10 @@
 .BR mmap (2)
 for some further information about memory mappings.
 .IP
-Permission to access this file is governed by a ptrace access mode
+Permission to access this file is governed by
+.B CAP_PERFMON
+(since Linux 6.15)
+or a ptrace access mode
 .B PTRACE_MODE_READ_FSCREDS
 check;
 see
man/man5/proc_pid_smaps.5 +10 -0
index 51440cc13bf6..d83521409375 100644
@@ -16,6 +16,16 @@
 .BR pmap (1)
 command displays similar information,
 in a form that may be easier for parsing.)
+.IP
+Permission to access this file is governed by
+.B CAP_PERFMON
+(since Linux 6.15)
+or a ptrace access mode
+.B PTRACE_MODE_READ_FSCREDS
+check;
+see
+.BR ptrace (2).
+.IP
 For each mapping there is a series of lines such as the following:
 .IP
 .in +4n
man/man7/capabilities.7 +8 -1
index eef074979f1b..bb8f6d9db433 100644
@@ -283,7 +283,14 @@
 call
 .BR perf_event_open (2);
 .IP \[bu]
-employ various BPF operations that have performance implications.
+employ various BPF operations that have performance implications;
+.IP \[bu]
+read the contents of
+.IR /proc/ pid /maps,
+.IR /proc/ pid /smaps,
+and
+.IR /proc/ pid /smaps_rollup
+for all processes.
 .RE
 .PD
 .IP
Signature · 1 line
2.55.0
maintainer Reviewed-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] man/man5/proc_pid_{smaps,smaps_rollup,maps}.5, man/man7/capabilities.7: CAP_PERFMON allows reading /proc/pid/{smaps,smaps_rollup,maps}

Quoted 5 lines

Date: 2026-09-12 05:32:12-0600
From: Max Chernoff <[email protected]>

Cheers,
Alex

Quoted 66 lines
---
 man/man5/proc_pid_maps.5  |  5 ++++-
 man/man5/proc_pid_smaps.5 | 10 ++++++++++
 man/man7/capabilities.7   |  9 ++++++++-
 3 files changed, 22 insertions(+), 2 deletions(-)
man/man5/proc_pid_maps.5 +4 -1
index 8783dbb3a89d..dcd455ea840c 100644
@@ -16,7 +16,10 @@
 .BR mmap (2)
 for some further information about memory mappings.
 .IP
-Permission to access this file is governed by a ptrace access mode
+Permission to access this file is governed by
+.B CAP_PERFMON
+(since Linux 6.15)
+or a ptrace access mode
 .B PTRACE_MODE_READ_FSCREDS
 check;
 see
man/man5/proc_pid_smaps.5 +10 -0
index 51440cc13bf6..d83521409375 100644
@@ -16,6 +16,16 @@
 .BR pmap (1)
 command displays similar information,
 in a form that may be easier for parsing.)
+.IP
+Permission to access this file is governed by
+.B CAP_PERFMON
+(since Linux 6.15)
+or a ptrace access mode
+.B PTRACE_MODE_READ_FSCREDS
+check;
+see
+.BR ptrace (2).
+.IP
 For each mapping there is a series of lines such as the following:
 .IP
 .in +4n
man/man7/capabilities.7 +8 -1
index eef074979f1b..bb8f6d9db433 100644
@@ -283,7 +283,14 @@
 call
 .BR perf_event_open (2);
 .IP \[bu]
-employ various BPF operations that have performance implications.
+employ various BPF operations that have performance implications;
+.IP \[bu]
+read the contents of
+.IR /proc/ pid /maps,
+.IR /proc/ pid /smaps,
+and
+.IR /proc/ pid /smaps_rollup
+for all processes.
 .RE
 .PD
 .IP
Signature · 1 line
2.55.0
Signature · 1 line
<https://www.alejandro-colomar.es>
#3 lore raw

PATCH 3/3 man/man7/capabilities.7: CAP_MAC_ADMIN allows setting undefined SELinux contexts

In reply to Max Chernoff
---
 man/man7/capabilities.7 | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
man/man7/capabilities.7 +10 -2
index bb8f6d9db433..8813ff81f0ea 100644
@@ -210,8 +210,16 @@
 .BR FS_IOC_SETFLAGS (2const)).
 .TP
 .BR CAP_MAC_ADMIN " (since Linux 2.6.25)"
-Allow MAC configuration or state changes.
-Implemented for the Smack Linux Security Module (LSM).
+.RS
+.IP \[bu] 3
+.PD 0
+For the Smack Linux Security Module (LSM),
+allow MAC configuration or state changes;
+.IP \[bu]
+For the SELinux LSM,
+allow setting undefined security contexts on inodes (since Linux 2.6.27).
+.RE
+.PD
 .TP
 .BR CAP_MAC_OVERRIDE " (since Linux 2.6.25)"
 Override Mandatory Access Control (MAC).
Signature · 1 line
2.55.0
maintainer Reviewed-by on v1 3/3
#4 lore raw

Re: [PATCH 3/3] man/man7/capabilities.7: CAP_MAC_ADMIN allows setting undefined SELinux contexts

Quoted 6 lines

Date: 2026-09-12 05:32:13-0600
From: Max Chernoff <[email protected]>

---

Cheers,
Alex

Quoted 29 lines
 man/man7/capabilities.7 | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
man/man7/capabilities.7 +10 -2
index bb8f6d9db433..8813ff81f0ea 100644
@@ -210,8 +210,16 @@
 .BR FS_IOC_SETFLAGS (2const)).
 .TP
 .BR CAP_MAC_ADMIN " (since Linux 2.6.25)"
-Allow MAC configuration or state changes.
-Implemented for the Smack Linux Security Module (LSM).
+.RS
+.IP \[bu] 3
+.PD 0
+For the Smack Linux Security Module (LSM),
+allow MAC configuration or state changes;
+.IP \[bu]
+For the SELinux LSM,
+allow setting undefined security contexts on inodes (since Linux 2.6.27).
+.RE
+.PD
 .TP
 .BR CAP_MAC_OVERRIDE " (since Linux 2.6.25)"
 Override Mandatory Access Control (MAC).
Signature · 1 line
2.55.0
Signature · 1 line
<https://www.alejandro-colomar.es>
#5 lore raw
In reply to Max Chernoff

Hi Max,

Quoted 9 lines

Date: 2026-09-12 05:32:11-0600
From: Max Chernoff <[email protected]>

Document /proc/pid/smaps_rollup, which is similar to /proc/pid/smaps, except it merges all mappings are merged into a single synthetic entry [1].

Also, add a better description to the NAME, following the discussion in [2].

Thanks! Although I'd prefer the renaming to happen in a separate commit, please.

Quoted 2 lines

Link [1]: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=493b0e9d945fa9dfe96be93ae41b4ca4b6fdb317>
Link [2]: <https://lore.kernel.org/lkml/[email protected]>

Would you mind quoting the most relevant lines of it? It seems a long discussion.

Quoted 21 lines
---
 man/man5/proc_pid_smaps.5        | 7 ++++++-
 man/man5/proc_pid_smaps_rollup.5 | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 man/man5/proc_pid_smaps_rollup.5
man/man5/proc_pid_smaps.5 +1 -1
index 9c433dbc1e60..51440cc13bf6 100644
@@ -7,7 +7,7 @@
 .\"
 .TH proc_pid_smaps 5 (date) "Linux man-pages (unreleased)"
 .SH NAME
-/proc/pid/smaps \- XXX: What does 's' in "smaps" stand for?
+/proc/pid/smaps, /proc/pid/smaps_rollup \- size of mapped memory regions
 .SH DESCRIPTION
 .TP
 .IR /proc/ pid /smaps " (since Linux 2.6.14)"

man/man5/proc_pid_smaps.5 line 132

Quoted 8 lines
man/man5/proc_pid_smaps.5 +5 -0
@@ -125,5 +125,10 @@
 file is present only if the
 .B CONFIG_PROC_PAGE_MONITOR
 kernel configuration option is enabled.
+.TP
+.IR /proc/ pid /smaps_rollup " (since Linux 4.14)"
+This file is similar to
+.IR /proc/ pid /smaps ,
+except all mappings are merged into a single synthetic entry.

LGTM. Thanks!

Have a lovely day!
Alex

Quoted 14 lines
man/man5/proc_pid_smaps.5 +0 -0
 .SH SEE ALSO
 .BR proc (5)
man/man5/proc_pid_smaps_rollup.5 new file +1 -0
new file mode 100644
index 000000000000..4b5f9eba0484
@@ -0,0 +1 @@
+.so man5/proc_pid_smaps.5

base-commit: 59ba1c34fb6538206e96597739f053183d1e6428

Signature · 1 line
2.55.0
Signature · 1 line
<https://www.alejandro-colomar.es>
#6 lore raw

v2 cover /proc/pid/smaps_rollup + CAP_MAC_ADMIN

In reply to Max Chernoff

Thanks for the review; I've split the first commit into two, and quoted the relevant lines from the long thread. The last two commits are both unchanged, aside from being renumbered.

Max Chernoff (4):
man/man5/proc_pid_smaps.5: Add description man/man5/proc_pid_smaps{,_rollup}.5: Add proc_pid_smaps_rollup(5) man/man5/proc_pid_{smaps,smaps_rollup,maps}.5,
man/man7/capabilities.7: CAP_PERFMON allows reading /proc/pid/{smaps,smaps_rollup,maps}
man/man7/capabilities.7: CAP_MAC_ADMIN allows setting undefined
SELinux contexts

 man/man5/proc_pid_maps.5         |  5 ++++-
 man/man5/proc_pid_smaps.5        | 17 ++++++++++++++++-
 man/man5/proc_pid_smaps_rollup.5 |  1 +
 man/man7/capabilities.7          | 21 ++++++++++++++++++---
 4 files changed, 39 insertions(+), 5 deletions(-)
 create mode 100644 man/man5/proc_pid_smaps_rollup.5

base-commit: 59ba1c34fb6538206e96597739f053183d1e6428

Signature · 1 line
2.55.0
#7 lore raw

PATCH v2 1/4 man/man5/proc_pid_smaps.5: Add description

From the patch that first introduced the file:

Quoted 6 lines

Here is a new entry developed for /proc that prints for each process memory area (VMA) the size of rss.

[...]

+ smaps Extension of maps, presenting the rss size for each mapped file

---
 man/man5/proc_pid_smaps.5 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man/man5/proc_pid_smaps.5 +1 -1
index 9c433dbc1e60..963136109ad8 100644
@@ -7,7 +7,7 @@
 .\"
 .TH proc_pid_smaps 5 (date) "Linux man-pages (unreleased)"
 .SH NAME
-/proc/pid/smaps \- XXX: What does 's' in "smaps" stand for?
+/proc/pid/smaps \- size of mapped memory regions
 .SH DESCRIPTION
 .TP
 .IR /proc/ pid /smaps " (since Linux 2.6.14)"
Signature · 1 line
2.55.0
#8 lore raw

PATCH v2 2/4 man/man5/proc_pid_smaps{,_rollup}.5: Add proc_pid_smaps_rollup(5)

In reply to Max Chernoff
---
 man/man5/proc_pid_smaps.5        | 7 ++++++-
 man/man5/proc_pid_smaps_rollup.5 | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 man/man5/proc_pid_smaps_rollup.5
man/man5/proc_pid_smaps.5 +6 -1
index 963136109ad8..51440cc13bf6 100644
@@ -7,7 +7,7 @@
 .\"
 .TH proc_pid_smaps 5 (date) "Linux man-pages (unreleased)"
 .SH NAME
-/proc/pid/smaps \- size of mapped memory regions
+/proc/pid/smaps, /proc/pid/smaps_rollup \- size of mapped memory regions
 .SH DESCRIPTION
 .TP
 .IR /proc/ pid /smaps " (since Linux 2.6.14)"
@@ -125,5 +125,10 @@
 file is present only if the
 .B CONFIG_PROC_PAGE_MONITOR
 kernel configuration option is enabled.
+.TP
+.IR /proc/ pid /smaps_rollup " (since Linux 4.14)"
+This file is similar to
+.IR /proc/ pid /smaps ,
+except all mappings are merged into a single synthetic entry.
 .SH SEE ALSO
 .BR proc (5)
man/man5/proc_pid_smaps_rollup.5 new file +1 -0
new file mode 100644
index 000000000000..4b5f9eba0484
@@ -0,0 +1 @@
+.so man5/proc_pid_smaps.5
Signature · 1 line
2.55.0
#9 lore raw

PATCH v2 3/4 man/man5/proc_pid_{smaps,smaps_rollup,maps}.5, man/man7/capabilities.7: CAP_PERFMON allows reading /proc/pid/{smaps,smaps_rollup,maps}

In reply to Max Chernoff
---
 man/man5/proc_pid_maps.5  |  5 ++++-
 man/man5/proc_pid_smaps.5 | 10 ++++++++++
 man/man7/capabilities.7   |  9 ++++++++-
 3 files changed, 22 insertions(+), 2 deletions(-)
man/man5/proc_pid_maps.5 +4 -1
index 8783dbb3a89d..dcd455ea840c 100644
@@ -16,7 +16,10 @@
 .BR mmap (2)
 for some further information about memory mappings.
 .IP
-Permission to access this file is governed by a ptrace access mode
+Permission to access this file is governed by
+.B CAP_PERFMON
+(since Linux 6.15)
+or a ptrace access mode
 .B PTRACE_MODE_READ_FSCREDS
 check;
 see
man/man5/proc_pid_smaps.5 +10 -0
index 51440cc13bf6..d83521409375 100644
@@ -16,6 +16,16 @@
 .BR pmap (1)
 command displays similar information,
 in a form that may be easier for parsing.)
+.IP
+Permission to access this file is governed by
+.B CAP_PERFMON
+(since Linux 6.15)
+or a ptrace access mode
+.B PTRACE_MODE_READ_FSCREDS
+check;
+see
+.BR ptrace (2).
+.IP
 For each mapping there is a series of lines such as the following:
 .IP
 .in +4n
man/man7/capabilities.7 +8 -1
index eef074979f1b..bb8f6d9db433 100644
@@ -283,7 +283,14 @@
 call
 .BR perf_event_open (2);
 .IP \[bu]
-employ various BPF operations that have performance implications.
+employ various BPF operations that have performance implications;
+.IP \[bu]
+read the contents of
+.IR /proc/ pid /maps,
+.IR /proc/ pid /smaps,
+and
+.IR /proc/ pid /smaps_rollup
+for all processes.
 .RE
 .PD
 .IP
Signature · 1 line
2.55.0
#10 lore raw

PATCH v2 4/4 man/man7/capabilities.7: CAP_MAC_ADMIN allows setting undefined SELinux contexts

In reply to Max Chernoff
---
 man/man7/capabilities.7 | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
man/man7/capabilities.7 +10 -2
index bb8f6d9db433..8813ff81f0ea 100644
@@ -210,8 +210,16 @@
 .BR FS_IOC_SETFLAGS (2const)).
 .TP
 .BR CAP_MAC_ADMIN " (since Linux 2.6.25)"
-Allow MAC configuration or state changes.
-Implemented for the Smack Linux Security Module (LSM).
+.RS
+.IP \[bu] 3
+.PD 0
+For the Smack Linux Security Module (LSM),
+allow MAC configuration or state changes;
+.IP \[bu]
+For the SELinux LSM,
+allow setting undefined security contexts on inodes (since Linux 2.6.27).
+.RE
+.PD
 .TP
 .BR CAP_MAC_OVERRIDE " (since Linux 2.6.25)"
 Override Mandatory Access Control (MAC).
Signature · 1 line
2.55.0
#11 lore raw

Re: [PATCH v2 0/4] /proc/pid/smaps_rollup + CAP_MAC_ADMIN

In reply to Max Chernoff

Hi Max,

Quoted 7 lines

Date: 2026-09-14 05:51:44-0600
From: Max Chernoff <[email protected]>

Thanks for the review; I've split the first commit into two, and quoted the relevant lines from the long thread. The last two commits are both unchanged, aside from being renumbered.

Quoted 8 lines

Max Chernoff (4):
man/man5/proc_pid_smaps.5: Add description man/man5/proc_pid_smaps{,_rollup}.5: Add proc_pid_smaps_rollup(5) man/man5/proc_pid_{smaps,smaps_rollup,maps}.5,
man/man7/capabilities.7: CAP_PERFMON allows reading /proc/pid/{smaps,smaps_rollup,maps}
man/man7/capabilities.7: CAP_MAC_ADMIN allows setting undefined
SELinux contexts

Thanks! I've applied the entire patch set.

Have a lovely day!
Alex

Quoted 14 lines
 man/man5/proc_pid_maps.5         |  5 ++++-
 man/man5/proc_pid_smaps.5        | 17 ++++++++++++++++-
 man/man5/proc_pid_smaps_rollup.5 |  1 +
 man/man7/capabilities.7          | 21 ++++++++++++++++++---
 4 files changed, 39 insertions(+), 5 deletions(-)
 create mode 100644 man/man5/proc_pid_smaps_rollup.5

base-commit: 59ba1c34fb6538206e96597739f053183d1e6428

Signature · 1 line
2.55.0
Signature · 1 line
<https://www.alejandro-colomar.es>