summaryrefslogtreecommitdiff
path: root/src/sys/procfile/kcoreprocfile.cil
blob: 199f710a48aebde2c0c9910907280f14c0586832 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
;; SPDX-FileCopyrightText: © 2024 Dominick Grift <dominick.grift@defensec.nl>
;; SPDX-License-Identifier: Unlicense

(block kcore

  (genfscon "proc" "/kcore" procfile_context)

  (blockinherit .procfile.template)

  (call .procfile.exception.type (procfile))

  (block read

    (macro type ((type ARG1))
	   (typeattributeset typeattr ARG1))

    (typeattribute not_typeattr)
    (typeattribute typeattr)

    (typeattributeset not_typeattr (not typeattr))

    (neverallow not_typeattr procfile (file (read))))

  (block readwrite

    (macro type ((type ARG1))
	   (typeattributeset typeattr ARG1))

    (typeattribute typeattr)

    (call read.type (typeattr))
    (call write.type (typeattr)))

  (block write

    (macro type ((type ARG1))
	   (typeattributeset typeattr ARG1))

    (typeattribute not_typeattr)
    (typeattribute typeattr)

    (typeattributeset not_typeattr (not typeattr))

    (neverallow not_typeattr procfile (file (append write)))))

(in procfile.unconfined

    (call .kcore.readwrite.type (typeattr)))