summaryrefslogtreecommitdiff
path: root/src/misc/av/memprotectav.cil
blob: a845c391e0935460c2726617cb173ef8845f4224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
;; SPDX-FileCopyrightText: © 2024 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)))