diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-03-03 11:48:09 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-03-03 22:34:08 -0300 |
commit | df4b933e0e51e43bd27a495dc747db0851e6dd34 (patch) | |
tree | 0280db136a1f5faaf5c3fdb7e3f881c1f7dd040e /tools/include | |
parent | 31d2e6b5d44e436969c15e4613e6b16c4c032d4d (diff) |
tools headers UAPI: Sync linux/prctl.h with the kernel sources
To pick new prctl options introduced in:
b507808ebce23561 ("mm: implement memory-deny-write-execute as a prctl")
That results in:
$ diff -u tools/include/uapi/linux/prctl.h include/uapi/linux/prctl.h
--- tools/include/uapi/linux/prctl.h 2022-06-20 17:54:43.884515663 -0300
+++ include/uapi/linux/prctl.h 2023-03-03 11:18:51.090923569 -0300
@@ -281,6 +281,12 @@
# define PR_SME_VL_LEN_MASK 0xffff
# define PR_SME_VL_INHERIT (1 << 17) /* inherit across exec */
+/* Memory deny write / execute */
+#define PR_SET_MDWE 65
+# define PR_MDWE_REFUSE_EXEC_GAIN 1
+
+#define PR_GET_MDWE 66
+
#define PR_SET_VMA 0x53564d41
# define PR_SET_VMA_ANON_NAME 0
$ tools/perf/trace/beauty/prctl_option.sh > before
$ cp include/uapi/linux/prctl.h tools/include/uapi/linux/prctl.h
$ tools/perf/trace/beauty/prctl_option.sh > after
$ diff -u before after
--- before 2023-03-03 11:47:43.320013146 -0300
+++ after 2023-03-03 11:47:50.937216229 -0300
@@ -59,6 +59,8 @@
[62] = "SCHED_CORE",
[63] = "SME_SET_VL",
[64] = "SME_GET_VL",
+ [65] = "SET_MDWE",
+ [66] = "GET_MDWE",
};
static const char *prctl_set_mm_options[] = {
[1] = "START_CODE",
$
Now users can do:
# perf trace -e syscalls:sys_enter_prctl --filter "option==SET_MDWE||option==GET_MDWE"
^C#
# trace -v -e syscalls:sys_enter_prctl --filter "option==SET_MDWE||option==GET_MDWE"
New filter for syscalls:sys_enter_prctl: (option==65||option==66) && (common_pid != 5519 && common_pid != 3404)
^C#
And when these prctl options appears in a session, they will be
translated to the corresponding string.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Joey Gouly <joey.gouly@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/lkml/ZAI%2FAoPXb%2Fsxz1%2Fm@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/include')
-rw-r--r-- | tools/include/uapi/linux/prctl.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/include/uapi/linux/prctl.h b/tools/include/uapi/linux/prctl.h index a5e06dcbba13..1312a137f7fb 100644 --- a/tools/include/uapi/linux/prctl.h +++ b/tools/include/uapi/linux/prctl.h @@ -281,6 +281,12 @@ struct prctl_mm_map { # define PR_SME_VL_LEN_MASK 0xffff # define PR_SME_VL_INHERIT (1 << 17) /* inherit across exec */ +/* Memory deny write / execute */ +#define PR_SET_MDWE 65 +# define PR_MDWE_REFUSE_EXEC_GAIN 1 + +#define PR_GET_MDWE 66 + #define PR_SET_VMA 0x53564d41 # define PR_SET_VMA_ANON_NAME 0 |