summaryrefslogtreecommitdiff
path: root/src/dev.cil
diff options
context:
space:
mode:
Diffstat (limited to 'src/dev.cil')
-rw-r--r--src/dev.cil51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/dev.cil b/src/dev.cil
new file mode 100644
index 0000000..a0283e8
--- /dev/null
+++ b/src/dev.cil
@@ -0,0 +1,51 @@
+;; SPDX-FileCopyrightText: © 2023 Dominick Grift <dominick.grift@defensec.nl>
+;; SPDX-License-Identifier: Unlicense
+
+(block dev
+
+ (macro type ((type ARG1))
+ (typeattributeset typeattr ARG1))
+
+ (typeattribute typeattr)
+
+ (blockinherit .file.all_macro_template_blk_files)
+ (blockinherit .file.all_macro_template_chr_files)
+
+ (call .obj.type (typeattr))
+
+ (call .devtmp.associate_fs (typeattr))
+
+ (block except
+
+ (macro type ((type ARG1))
+ (typeattributeset typeattr ARG1))
+
+ (blockinherit .file.all_macro_template_blk_files)
+ (blockinherit .file.all_macro_template_chr_files)
+
+ (typeattribute typeattr)
+
+ (typeattributeset typeattr (and dev.typeattr (not (exception.typeattr)))))
+
+ (block exception
+
+ (macro type ((type ARG1))
+ (typeattributeset typeattr ARG1))
+
+ (typeattribute typeattr)
+
+ (call dev.type (typeattr)))
+
+ (block unconfined
+
+ (macro type ((type ARG1))
+ (typeattributeset typeattr ARG1))
+
+ (typeattribute typeattr)
+
+ (allow typeattr dev.typeattr (blk_file (not (audit_access execmod map))))
+ (allow typeattr dev.typeattr (chr_file (not (audit_access execmod))))))
+
+(in unconfined
+
+ (call .dev.unconfined.type (typeattr)))