aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-05-30 00:23:18 +0200
committerAlejandro Colomar <alx@kernel.org>2024-05-31 01:52:40 +0200
commit5feed69f3442e7821fd70f482f909abdbe474e94 (patch)
treeb406845be942bc2127d4e9ee61f231871035878a
parentbeab967a21c6b282da42851dae1906cc216c80a8 (diff)
downloadman-pages-5feed69f3442e7821fd70f482f909abdbe474e94.tar.gz
prctl.2, PR_SET_PTRACER.2const: Split PR_SET_PTRACER from prctl(2)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man/man2/prctl.246
-rw-r--r--man/man2const/PR_SET_PTRACER.2const76
2 files changed, 78 insertions, 44 deletions
diff --git a/man/man2/prctl.2 b/man/man2/prctl.2
index f78541db92..ef2e896e51 100644
--- a/man/man2/prctl.2
+++ b/man/man2/prctl.2
@@ -22,8 +22,6 @@
.\" 2012-09-20 Kees Cook, update PR_SET_SECCOMP for mode 2
.\" 2012-10-25 Michael Kerrisk, Document PR_SET_TIMERSLACK and
.\" PR_GET_TIMERSLACK
-.\" 2013-01-10 Kees Cook, document PR_SET_PTRACER
-.\"
.\"
.TH prctl 2 (date) "Linux man-pages (unreleased)"
.SH NAME
@@ -117,39 +115,8 @@ The first argument can be:
.B PR_SET_PDEATHSIG
.TQ
.B PR_GET_PDEATHSIG
-.\" prctl PR_SET_PTRACER
-.TP
-.BR PR_SET_PTRACER " (since Linux 3.4)"
-.\" commit 2d514487faf188938a4ee4fb3464eeecfbdcf8eb
-.\" commit bf06189e4d14641c0148bea16e9dd24943862215
-This is meaningful only when the Yama LSM is enabled and in mode 1
-("restricted ptrace", visible via
-.IR /proc/sys/kernel/yama/ptrace_scope ).
-When a "ptracer process ID" is passed in \fIarg2\fP,
-the caller is declaring that the ptracer process can
-.BR ptrace (2)
-the calling process as if it were a direct process ancestor.
-Each
-.B PR_SET_PTRACER
-operation replaces the previous "ptracer process ID".
-Employing
+.TQ
.B PR_SET_PTRACER
-with
-.I arg2
-set to 0 clears the caller's "ptracer process ID".
-If
-.I arg2
-is
-.BR PR_SET_PTRACER_ANY ,
-the ptrace restrictions introduced by Yama are effectively disabled for the
-calling process.
-.IP
-For further information, see the kernel source file
-.I Documentation/admin\-guide/LSM/Yama.rst
-.\" commit 90bb766440f2147486a2acc3e793d7b8348b0c22
-(or
-.I Documentation/security/Yama.txt
-before Linux 4.13).
.\" prctl PR_SET_SECCOMP
.TP
.BR PR_SET_SECCOMP " (since Linux 2.6.23)"
@@ -1174,16 +1141,6 @@ and the kernel was not configured with
.B EINVAL
.I op
is
-.B PR_SET_PTRACER
-and
-.I arg2
-is not 0,
-.BR PR_SET_PTRACER_ANY ,
-or the PID of an existing process.
-.TP
-.B EINVAL
-.I op
-is
.B PR_SET_TIMING
and
.I arg2
@@ -1344,4 +1301,5 @@ glibc 2.0.6
.BR PR_PAC_RESET_KEYS (2const),
.BR PR_SET_PDEATHSIG (2const),
.BR PR_GET_PDEATHSIG (2const),
+.BR PR_SET_PTRACER (2const),
.BR core (5)
diff --git a/man/man2const/PR_SET_PTRACER.2const b/man/man2const/PR_SET_PTRACER.2const
new file mode 100644
index 0000000000..0ed7767e32
--- /dev/null
+++ b/man/man2const/PR_SET_PTRACER.2const
@@ -0,0 +1,76 @@
+.\" Copyright 2013, Kees Cook <keescook@chromium.org>
+.\" Copyright 2013, 2015, Michael Kerrisk <mtk.manpages@gmail.com>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.\" 2013-01-10 Kees Cook, document PR_SET_PTRACER
+.\"
+.TH PR_SET_PTRACER 2const (date) "Linux man-pages (unreleased)"
+.SH NAME
+PR_SET_PTRACER
+\-
+allow processes to ptrace(2) the calling process
+.SH LIBRARY
+Standard C library
+.RI ( libc ", " \-lc )
+.SH SYNOPSIS
+.nf
+.B #include <sys/prctl.h>
+.P
+.BI "int prctl(int " op ", ...);"
+.fi
+.SH DESCRIPTION
+.TP
+.BR PR_SET_PTRACER " (since Linux 3.4)"
+.\" commit 2d514487faf188938a4ee4fb3464eeecfbdcf8eb
+.\" commit bf06189e4d14641c0148bea16e9dd24943862215
+This is meaningful only when the Yama LSM is enabled and in mode 1
+("restricted ptrace", visible via
+.IR /proc/sys/kernel/yama/ptrace_scope ).
+When a "ptracer process ID" is passed in \fIarg2\fP,
+the caller is declaring that the ptracer process can
+.BR ptrace (2)
+the calling process as if it were a direct process ancestor.
+Each
+.B PR_SET_PTRACER
+operation replaces the previous "ptracer process ID".
+Employing
+.B PR_SET_PTRACER
+with
+.I arg2
+set to 0 clears the caller's "ptracer process ID".
+If
+.I arg2
+is
+.BR PR_SET_PTRACER_ANY ,
+the ptrace restrictions introduced by Yama are effectively disabled for the
+calling process.
+.IP
+For further information, see the kernel source file
+.I Documentation/admin\-guide/LSM/Yama.rst
+.\" commit 90bb766440f2147486a2acc3e793d7b8348b0c22
+(or
+.I Documentation/security/Yama.txt
+before Linux 4.13).
+.SH RETURN VALUE
+On success,
+0 is returned.
+On error, \-1 is returned, and
+.I errno
+is set to indicate the error.
+.SH ERRORS
+.TP
+.B EINVAL
+.I op
+is
+.B PR_SET_PTRACER
+and
+.I arg2
+is not 0,
+.BR PR_SET_PTRACER_ANY ,
+or the PID of an existing process.
+.SH STANDARDS
+Linux.
+.SH HISTORY
+.SH SEE ALSO
+.BR prctl (2),