linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florent Revest <revest@chromium.org>
To: alx@kernel.org
Cc: linux-man@vger.kernel.org, joey.gouly@arm.com,
	akpm@linux-foundation.org, keescook@chromium.org,
	catalin.marinas@arm.com, Florent Revest <revest@chromium.org>
Subject: [PATCH] prctl.2: Document PR_SET_MDWE and PR_GET_MDWE
Date: Tue,  3 Oct 2023 17:50:10 +0200	[thread overview]
Message-ID: <20231003155010.3651349-1-revest@chromium.org> (raw)

Memory-Deny-Write-Execute is a W^X process control originally introduced
by Joey Gouly. I'm the author of the PR_MDWE_NO_INHERIT flag.

Signed-off-by: Florent Revest <revest@chromium.org>
---
 man2/prctl.2 | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/man2/prctl.2 b/man2/prctl.2
index d845b0905..67e6e2ff0 100644
--- a/man2/prctl.2
+++ b/man2/prctl.2
@@ -2041,6 +2041,33 @@ the copy will be truncated.
 Return (as the function result)
 the full length of the auxiliary vector.
 \fIarg4\fP and \fIarg5\fP must be 0.
+.TP
+.BR PR_SET_MDWE " (since Linux 6.3)"
+.\" commit b507808ebce23561d4ff8c2aa1fb949fe402bc61
+Set the process' Memory-Deny-Write-Execute protection mask.
+.IR arg2
+must be a bitmask 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).
+.TP
+Once protection bits are set, they can not be changed.
+.RE
+.TP
+.BR PR_GET_MDWE " (since Linux 6.3)"
+.\" commit b507808ebce23561d4ff8c2aa1fb949fe402bc61
+Return (as the function result) the Memory-Deny-Write-Execute protection mask.
+(See
+.B PR_SET_MDWE
+for information on the protection mask bits.)
 .SH RETURN VALUE
 On success,
 .BR PR_CAP_AMBIENT + PR_CAP_AMBIENT_IS_SET ,
-- 
2.42.0.582.g8ccd20d70d-goog


             reply	other threads:[~2023-10-03 15:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03 15:50 Florent Revest [this message]
2023-10-08 21:39 ` [PATCH] prctl.2: Document PR_SET_MDWE and PR_GET_MDWE Alejandro Colomar
2023-10-11 11:15   ` Florent Revest
2023-10-09 16:34 ` Catalin Marinas
2023-10-11 11:12   ` Florent Revest

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231003155010.3651349-1-revest@chromium.org \
    --to=revest@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=alx@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=keescook@chromium.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).