| 1 |
.\" Copyright 2012, Kees Cook <[email protected]> |
| 2 |
.\" Copyright 2012, 2013, 2015, Michael Kerrisk <[email protected]> |
| 3 |
.\" Copyright 2024, Alejandro Colomar <[email protected]> |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH PR_GET_NO_NEW_PRIVS 2const 2024-06-01 "Linux man-pages 6.9.1" |
| 8 |
.SH NAME |
| 9 |
PR_GET_NO_NEW_PRIVS |
| 10 |
\- |
| 11 |
get the calling thread's no_new_privs attribute |
| 12 |
.SH LIBRARY |
| 13 |
Standard C library |
| 14 |
.RI ( libc ", " \-lc ) |
| 15 |
.SH SYNOPSIS |
| 16 |
.nf |
| 17 |
.BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */" |
| 18 |
.B #include <sys/prctl.h> |
| 19 |
.P |
| 20 |
.B int prctl(PR_GET_NO_NEW_PRIVS, 0L, 0L, 0L, 0L); |
| 21 |
.fi |
| 22 |
.SH DESCRIPTION |
| 23 |
Return the value of the |
| 24 |
.I no_new_privs |
| 25 |
attribute for the calling thread. |
| 26 |
A value of 0 indicates the regular |
| 27 |
.BR execve (2) |
| 28 |
behavior. |
| 29 |
A value of 1 indicates |
| 30 |
.BR execve (2) |
| 31 |
will operate in the privilege-restricting mode described in |
| 32 |
.BR PR_SET_NO_NEW_PRIVS (2const). |
| 33 |
.SH RETURN VALUE |
| 34 |
On success, |
| 35 |
.B PR_GET_NO_NEW_PRIVS |
| 36 |
returns the boolean value described above. |
| 37 |
On error, \-1 is returned, and |
| 38 |
.I errno |
| 39 |
is set to indicate the error. |
| 40 |
.SH FILES |
| 41 |
.TP |
| 42 |
.IR /proc/ pid /status |
| 43 |
Since Linux 4.10, |
| 44 |
the value of a thread's |
| 45 |
.I no_new_privs |
| 46 |
attribute can be viewed via the |
| 47 |
.I NoNewPrivs |
| 48 |
field in this file. |
| 49 |
.SH STANDARDS |
| 50 |
Linux. |
| 51 |
.SH HISTORY |
| 52 |
Linux 3.5. |
| 53 |
.SH SEE ALSO |
| 54 |
.BR prctl (2), |
| 55 |
.BR PR_SET_NO_NEW_PRIVS (2const) |