aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-05-30 00:29:10 +0200
committerAlejandro Colomar <alx@kernel.org>2024-05-31 01:52:40 +0200
commit7c9a9da1b4fac101faf52efcbf00875bad2cbfe7 (patch)
tree9b4b9e092c41f81f74a00630d51b11aa79a0fce3
parent5feed69f3442e7821fd70f482f909abdbe474e94 (diff)
downloadman-pages-7c9a9da1b4fac101faf52efcbf00875bad2cbfe7.tar.gz
PR_SET_PTRACER.2const: Tweak after split
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man/man2const/PR_SET_PTRACER.2const50
1 files changed, 24 insertions, 26 deletions
diff --git a/man/man2const/PR_SET_PTRACER.2const b/man/man2const/PR_SET_PTRACER.2const
index 0ed7767e32..629372cc35 100644
--- a/man/man2const/PR_SET_PTRACER.2const
+++ b/man/man2const/PR_SET_PTRACER.2const
@@ -1,10 +1,9 @@
.\" Copyright 2013, Kees Cook <keescook@chromium.org>
.\" Copyright 2013, 2015, Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
.\"
.\" 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
@@ -17,41 +16,34 @@ Standard C library
.nf
.B #include <sys/prctl.h>
.P
-.BI "int prctl(int " op ", ...);"
+.BI "int prctl(PR_SET_PTRACER, long " pid ", 0L, 0L, 0L);"
.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,
+.IR /proc/\:sys/\:kernel/\:yama/\:ptrace_scope ).
+.P
+When a "ptracer process ID" is passed in
+.IR pid ,
the caller is declaring that the ptracer process can
.BR ptrace (2)
the calling process as if it were a direct process ancestor.
+.P
Each
.B PR_SET_PTRACER
operation replaces the previous "ptracer process ID".
+.P
Employing
.B PR_SET_PTRACER
with
-.I arg2
+.I pid
set to 0 clears the caller's "ptracer process ID".
If
-.I arg2
+.I pid
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).
+the ptrace restrictions introduced by Yama are
+effectively disabled for the calling process.
.SH RETURN VALUE
On success,
0 is returned.
@@ -61,16 +53,22 @@ is set to indicate the error.
.SH ERRORS
.TP
.B EINVAL
-.I op
-is
-.B PR_SET_PTRACER
-and
-.I arg2
+.I pid
is not 0,
.BR PR_SET_PTRACER_ANY ,
-or the PID of an existing process.
+nor the PID of an existing process.
.SH STANDARDS
Linux.
.SH HISTORY
+Linux 3.4.
+.\" commit 2d514487faf188938a4ee4fb3464eeecfbdcf8eb
+.\" commit bf06189e4d14641c0148bea16e9dd24943862215
.SH SEE ALSO
.BR prctl (2),
+.P
+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).