]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
prctl.2, PR_SET_MDWE.2const: Split PR_SET_MDWE from prctl(2)
authorAlejandro Colomar <alx@kernel.org>
Fri, 31 May 2024 15:27:04 +0000 (17:27 +0200)
committerAlejandro Colomar <alx@kernel.org>
Fri, 31 May 2024 15:32:08 +0000 (17:32 +0200)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man2/prctl.2
man/man2const/PR_SET_MDWE.2const [new file with mode: 0644]

index 9f362f064e3f2a13a8686b043a322aebb91b53f6..5976938b0f9f162672ddbff340f7ec572e06c4af 100644 (file)
@@ -157,28 +157,8 @@ The first argument can be:
 .B PR_GET_UNALIGN
 .TQ
 .B PR_GET_AUXV
-.TP
-.BR PR_SET_MDWE " (since Linux 6.3)"
-.\" commit b507808ebce23561d4ff8c2aa1fb949fe402bc61
-Set the calling process' Memory-Deny-Write-Execute protection mask.
-Once protection bits are set,
-they can not be changed.
-.I arg2
-must be a bit mask of:
-.RS
-.TP
-.B PR_MDWE_REFUSE_EXEC_GAIN
-New memory mapping protections can't be writable and executable.
-Non-executable mappings can't become executable.
-.TP
-.B PR_MDWE_NO_INHERIT " (since Linux 6.6)"
-.\" commit 2a87e5520554034e8c423479740f95bea4a086a0
-Do not propagate MDWE protection to child processes on
-.BR fork (2).
-Setting this bit requires setting
-.B PR_MDWE_REFUSE_EXEC_GAIN
-too.
-.RE
+.TQ
+.B PR_SET_MDWE
 .TP
 .BR PR_GET_MDWE " (since Linux 6.3)"
 .\" commit b507808ebce23561d4ff8c2aa1fb949fe402bc61
@@ -189,8 +169,7 @@ of the calling process.
 for information on the protection mask bits.)
 .SH RETURN VALUE
 On success,
-a nonnegative value or
-0 is returned.
+a nonnegative value is returned.
 On error, \-1 is returned, and
 .I errno
 is set to indicate the error.
@@ -204,11 +183,6 @@ or not supported on this system.
 .TP
 .B EINVAL
 An unused argument is nonzero.
-.TP
-.B EINVAL
-.I arg2
-is not a valid value for this
-.IR op .
 .SH VERSIONS
 IRIX has a
 .BR prctl ()
@@ -291,4 +265,5 @@ glibc 2.0.6
 .BR PR_SET_UNALIGN (2const),
 .BR PR_GET_UNALIGN (2const),
 .BR PR_GET_AUXV (2const),
+.BR PR_SET_MDWE (2const),
 .BR core (5)
diff --git a/man/man2const/PR_SET_MDWE.2const b/man/man2const/PR_SET_MDWE.2const
new file mode 100644 (file)
index 0000000..60d7514
--- /dev/null
@@ -0,0 +1,59 @@
+.\" Copyright 2023, Florent Revest <revest@chromium.org>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH PR_SET_MDWE 2const (date) "Linux man-pages (unreleased)"
+.SH NAME
+PR_SET_MDWE
+\-
+set the Memory-Deny-Write-Execute protection mask for 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_MDWE " (since Linux 6.3)"
+.\" commit b507808ebce23561d4ff8c2aa1fb949fe402bc61
+Set the calling process' Memory-Deny-Write-Execute protection mask.
+Once protection bits are set,
+they can not be changed.
+.I arg2
+must be a bit mask of:
+.RS
+.TP
+.B PR_MDWE_REFUSE_EXEC_GAIN
+New memory mapping protections can't be writable and executable.
+Non-executable mappings can't become executable.
+.TP
+.B PR_MDWE_NO_INHERIT " (since Linux 6.6)"
+.\" commit 2a87e5520554034e8c423479740f95bea4a086a0
+Do not propagate MDWE protection to child processes on
+.BR fork (2).
+Setting this bit requires setting
+.B PR_MDWE_REFUSE_EXEC_GAIN
+too.
+.RE
+.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 arg2
+is not a valid value for this
+.IR op .
+.SH STANDARDS
+Linux.
+.SH HISTORY
+.SH SEE ALSO
+.BR prctl (2),
+.BR PR_GET_MDWE (2const)