Debian Codegraph @

upstream/debian-trixie/man2/PR_SET_MDWE.2const

raw
1 .\" Copyright 2023, Florent Revest <[email protected]>
2 .\" Copyright 2024, Alejandro Colomar <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH PR_SET_MDWE 2const 2024-06-01 "Linux man-pages 6.9.1"
7 .SH NAME
8 PR_SET_MDWE
9 \-
10 set the Memory-Deny-Write-Execute protection mask for the calling process
11 .SH LIBRARY
12 Standard C library
13 .RI ( libc ", " \-lc )
14 .SH SYNOPSIS
15 .nf
16 .BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */"
17 .B #include <sys/prctl.h>
18 .P
19 .BI "int prctl(PR_SET_MDWE, unsigned long " mask ", 0L, 0L, 0L);"
20 .fi
21 .SH DESCRIPTION
22 Set the calling process' Memory-Deny-Write-Execute protection mask.
23 Once protection bits are set,
24 they can not be changed.
25 .P
26 .I mask
27 must be a bit mask of:
28 .TP
29 .B PR_MDWE_REFUSE_EXEC_GAIN
30 New memory mapping protections can't be writable and executable.
31 Non-executable mappings can't become executable.
32 .TP
33 .B PR_MDWE_NO_INHERIT " (since Linux 6.6)"
34 .\" commit 2a87e5520554034e8c423479740f95bea4a086a0
35 Do not propagate MDWE protection to child processes on
36 .BR fork (2).
37 Setting this bit requires setting
38 .B PR_MDWE_REFUSE_EXEC_GAIN
39 too.
40 .SH RETURN VALUE
41 On success,
42 0 is returned.
43 On error, \-1 is returned, and
44 .I errno
45 is set to indicate the error.
46 .SH ERRORS
47 .TP
48 .B EINVAL
49 .I mask
50 is not a valid value.
51 .SH STANDARDS
52 Linux.
53 .SH HISTORY
54 Linux 6.3.
55 .\" commit b507808ebce23561d4ff8c2aa1fb949fe402bc61
56 .SH SEE ALSO
57 .BR prctl (2),
58 .BR PR_GET_MDWE (2const)