summaryrefslogtreecommitdiff
path: root/src/net/ibnet/pkeyibnet.cil
blob: 83cbde31da8cd9eef666fd267a030b0a55b9b8b3 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
;; SPDX-FileCopyrightText: © 2024 Dominick Grift <dominick.grift@defensec.nl>
;; SPDX-License-Identifier: Unlicense

(class infiniband_pkey (access))
(classorder (unordered infiniband_pkey))

(macro access_invalid_pkeys ((type ARG1))
       (allow ARG1 invalid (infiniband_pkey (access))))

(in invalid.unconfined

    (allow typeattr .invalid (infiniband_pkey (all))))

(in mcs

    (mlsconstrain (infiniband_pkey (access))
		  (or (dom h1 h2)
		      (neq t1 constrained.typeattr))))

(in net.ib

    (blockinherit pkey.template)

    (block pkey

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

      (typeattribute typeattr)

      (blockinherit all_macro_template)

      (call .obj.type (typeattr))

      (block all_macro_template

	(blockabstract all_macro_template)

	(macro access_all_pkeys ((type ARG1))
	       (allow ARG1 typeattr (infiniband_pkey (access)))))

      (block base_template

	(blockabstract base_template)

	(context pkey_context (.sys.id .sys.role pkey lowlevelrange))

	(type pkey)
	(call .net.ib.pkey.type (pkey)))

      (block macro_template

	(blockabstract macro_template)

	(macro access_pkeys ((type ARG1))
	       (allow ARG1 pkey (infiniband_pkey (access)))))

      (block template

	(blockabstract template)

	(blockinherit .net.ib.pkey.base_template)
	(blockinherit .net.ib.pkey.macro_template))

      (block unconfined

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

	(typeattribute typeattr)

	(allow typeattr pkey.typeattr (infiniband_pkey (all))))))

(in net.ib.unconfined

    (call .net.ib.pkey.unconfined.type (typeattr)))