]> granicus.if.org Git - musl/commitdiff
add speculation control prctls from linux v4.17
authorSzabolcs Nagy <nsz@port70.net>
Sat, 9 Jun 2018 21:23:54 +0000 (21:23 +0000)
committerRich Felker <dalias@aerifal.cx>
Tue, 19 Jun 2018 17:27:08 +0000 (13:27 -0400)
PR_{SET,GET}_SPECULATION_CTRL controls speculation related vulnerability
mitigations, new in commits
b617cfc858161140d69cc0b5cc211996b557a1c7
356e4bfff2c5489e016fdb925adbf12a1e3950ee

include/sys/prctl.h

index aa0c7a88c64df078497a1ec81a317c8daca24144..af76408cccbd96d34a7eec3166fdf60f510d0126 100644 (file)
@@ -136,6 +136,15 @@ struct prctl_mm_map {
 #define PR_SVE_VL_LEN_MASK 0xffff
 #define PR_SVE_VL_INHERIT (1 << 17)
 
+#define PR_GET_SPECULATION_CTRL 52
+#define PR_SET_SPECULATION_CTRL 53
+#define PR_SPEC_STORE_BYPASS 0
+#define PR_SPEC_NOT_AFFECTED 0
+#define PR_SPEC_PRCTL (1UL << 0)
+#define PR_SPEC_ENABLE (1UL << 1)
+#define PR_SPEC_DISABLE (1UL << 2)
+#define PR_SPEC_FORCE_DISABLE (1UL << 3)
+
 int prctl (int, ...);
 
 #ifdef __cplusplus