summaryrefslogtreecommitdiff
path: root/src/misc/av/memprotectav.cil
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/av/memprotectav.cil')
-rw-r--r--src/misc/av/memprotectav.cil25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/misc/av/memprotectav.cil b/src/misc/av/memprotectav.cil
new file mode 100644
index 0000000..a0ab2b8
--- /dev/null
+++ b/src/misc/av/memprotectav.cil
@@ -0,0 +1,25 @@
+;; SPDX-FileCopyrightText: © 2023 Dominick Grift <dominick.grift@defensec.nl>
+;; SPDX-License-Identifier: Unlicense
+
+(class memprotect (mmap_zero))
+(classorder (unordered memprotect))
+
+(in subj
+
+ (block mmapzero
+
+ (macro type ((type ARG1))
+ (typeattributeset typeattr ARG1))
+
+ (typeattribute not_typeattr)
+ (typeattribute typeattr)
+
+ (typeattributeset not_typeattr (not typeattr))
+
+ (neverallow not_typeattr self (memprotect (mmap_zero)))))
+
+(in subj.unconfined
+
+ (allow typeattr self (memprotect (all)))
+
+ (call mmapzero.type (typeattr)))