Skip to contentSkip to conversation

prctl: document PR_SET_NO_NEW_PRIVS, PR_GET_NO_NEW_PRIVS

PATCH In review Kees Cook 2 participants 2 messages Sep 20, 2012 – Oct 22, 2012 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 prctl: document PR_SET_NO_NEW_PRIVS, PR_GET_NO_NEW_PRIVS

This adds a short description of the no_new_privs bit, as described in Documentation/prctl/no_new_privs.txt.

---
 man2/prctl.2 |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
man2/prctl.2 +15 -0
index a44aa32..220c031 100644
@@ -42,6 +42,7 @@
 .\" 2012-04-25 Michael Kerrisk, Document PR_TASK_PERF_EVENTS_DISABLE and
 .\"				PR_TASK_PERF_EVENTS_ENABLE
 .\" 2012-09-20 Kees Cook, update PR_SET_SECCOMP for mode 2
+.\" 2012-09-20 Kees Cook, document PR_SET_NO_NEW_PRIVS, PR_GET_NO_NEW_PRIVS
 .\"
 .\" FIXME: Document PR_SET_TIMERSLACK and PR_GET_TIMERSLACK (new in 2.6.28)
 .\"		commit 6976675d94042fbd446231d1bd8b7de71a980ada
@@ -216,6 +217,19 @@ in the buffer pointed to by
 The buffer should allow space for up to 16 bytes;
 the returned string will be null-terminated if it is shorter than that.
 .TP
+.BR PR_SET_NO_NEW_PRIVS " (since Linux 3.5)"
+Set the current process's \fIno_new_privs\fP bit to the value in
+\fIarg2\fP.  With \fIno_new_privs\fP set to 1, execve promises not
+to grant the privilege to do anything that could not have been done
+without the execve call (for example, rendering setuid, setgid, and file
+capabilities non-functional).  When enabled, this value is inherited
+across fork, clone, and execve and cannot be unset.
+.TP
+.BR PR_GET_NO_NEW_PRIVS " (since Linux 3.5)"
+Return the value of the \fIno_new_privs\fP bit for the current process. A
+value of 0 indicates the regular execve behavior. A value of 1 indicates
+execve will operate in the privilege restricting mode described above.
+.TP
 .BR PR_SET_PDEATHSIG " (since Linux 2.1.57)"
 Set the parent process death signal
 of the calling process to \fIarg2\fP (either a signal value
@@ -567,6 +581,7 @@ option.
 On success,
 .BR PR_GET_DUMPABLE ,
 .BR PR_GET_KEEPCAPS ,
+.BR PR_GET_NO_NEW_PRIVS ,
 .BR PR_CAPBSET_READ ,
 .BR PR_GET_TIMING ,
 .BR PR_GET_SECUREBITS ,
Signature · 6 lines
1.7.0.4


-- 
Kees Cook
Chrome OS Security
#1 lore raw
Quoted 2 lines · Kees Cook

This adds a short description of the no_new_privs bit, as described in Documentation/prctl/no_new_privs.txt.

Thanks Kees. Applied.

Cheers,

Michael

Quoted 52 lines
---
 man2/prctl.2 |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
man2/prctl.2 +15 -1
index a44aa32..220c031 100644
@@ -42,6 +42,7 @@
 .\" 2012-04-25 Michael Kerrisk, Document PR_TASK_PERF_EVENTS_DISABLE and
 .\"                            PR_TASK_PERF_EVENTS_ENABLE
 .\" 2012-09-20 Kees Cook, update PR_SET_SECCOMP for mode 2
+.\" 2012-09-20 Kees Cook, document PR_SET_NO_NEW_PRIVS, PR_GET_NO_NEW_PRIVS
 .\"
 .\" FIXME: Document PR_SET_TIMERSLACK and PR_GET_TIMERSLACK (new in 2.6.28)
 .\"            commit 6976675d94042fbd446231d1bd8b7de71a980ada
@@ -216,6 +217,19 @@ in the buffer pointed to by
 The buffer should allow space for up to 16 bytes;
 the returned string will be null-terminated if it is shorter than that.
 .TP
+.BR PR_SET_NO_NEW_PRIVS " (since Linux 3.5)"
+Set the current process's \fIno_new_privs\fP bit to the value in
+\fIarg2\fP.  With \fIno_new_privs\fP set to 1, execve promises not
+to grant the privilege to do anything that could not have been done
+without the execve call (for example, rendering setuid, setgid, and file
+capabilities non-functional).  When enabled, this value is inherited
+across fork, clone, and execve and cannot be unset.
+.TP
+.BR PR_GET_NO_NEW_PRIVS " (since Linux 3.5)"
+Return the value of the \fIno_new_privs\fP bit for the current process. A
+value of 0 indicates the regular execve behavior. A value of 1 indicates
+execve will operate in the privilege restricting mode described above.
+.TP
 .BR PR_SET_PDEATHSIG " (since Linux 2.1.57)"
 Set the parent process death signal
 of the calling process to \fIarg2\fP (either a signal value
@@ -567,6 +581,7 @@ option.
 On success,
 .BR PR_GET_DUMPABLE ,
 .BR PR_GET_KEEPCAPS ,
+.BR PR_GET_NO_NEW_PRIVS ,
 .BR PR_CAPBSET_READ ,
 .BR PR_GET_TIMING ,
 .BR PR_GET_SECUREBITS ,
--

1.7.0.4

--
Kees Cook
Chrome OS Security

Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html