diff options
-rw-r--r-- | recipes-security/selinux/secilc/CVE-2021-36087.patch | 134 | ||||
-rw-r--r-- | recipes-security/selinux/secilc_3.0.bb | 2 |
2 files changed, 136 insertions, 0 deletions
diff --git a/recipes-security/selinux/secilc/CVE-2021-36087.patch b/recipes-security/selinux/secilc/CVE-2021-36087.patch new file mode 100644 index 0000000..ad7bf9b --- /dev/null +++ b/recipes-security/selinux/secilc/CVE-2021-36087.patch | |||
@@ -0,0 +1,134 @@ | |||
1 | From bad0a746e9f4cf260dedba5828d9645d50176aac Mon Sep 17 00:00:00 2001 | ||
2 | From: James Carter <jwcart2@gmail.com> | ||
3 | Date: Mon, 19 Apr 2021 09:06:15 -0400 | ||
4 | Subject: [PATCH] secilc/docs: Update the CIL documentation for various blocks | ||
5 | |||
6 | Update the documentation for macros, booleans, booleanifs, tunables, | ||
7 | tunableifs, blocks, blockabstracts, blockinherits, and optionals to | ||
8 | tell where these statements can be used and, for those that have | ||
9 | blocks, what statements are not allowed in them. | ||
10 | |||
11 | Signed-off-by: James Carter <jwcart2@gmail.com> | ||
12 | |||
13 | Upstream-Status: Backport | ||
14 | CVE: CVE-2021-36087 | ||
15 | Signed-off-by: Armin Kuster <akuster@mvista.com> | ||
16 | |||
17 | --- | ||
18 | docs/cil_call_macro_statements.md | 2 ++ | ||
19 | docs/cil_conditional_statements.md | 6 +++++ | ||
20 | docs/cil_container_statements.md | 28 +++++++++++++++-------- | ||
21 | 3 files changed, 26 insertions(+), 10 deletions(-) | ||
22 | |||
23 | Index: secilc-3.0/docs/cil_call_macro_statements.md | ||
24 | =================================================================== | ||
25 | --- secilc-3.0.orig/docs/cil_call_macro_statements.md | ||
26 | +++ secilc-3.0/docs/cil_call_macro_statements.md | ||
27 | @@ -54,6 +54,8 @@ Note that when resolving macros the call | ||
28 | |||
29 | - Items defined in the global namespace | ||
30 | |||
31 | +[`tunable`](cil_conditional_statements.md#tunable), [`in`](cil_container_statements.md#in), [`block`](cil_container_statements.md#block), [`blockinherit`](cil_container_statements.md#blockinherit), [`blockabstract`](cil_container_statements.md#blockabstract), and other [`macro`](cil_call_macro_statements.md#macro) statements are not allowed in [`macro`](cil_call_macro_statements.md#macro) blocks. | ||
32 | + | ||
33 | **Statement definition:** | ||
34 | |||
35 | (macro macro_id ([(param_type param_id) ...]) | ||
36 | Index: secilc-3.0/docs/cil_conditional_statements.md | ||
37 | =================================================================== | ||
38 | --- secilc-3.0.orig/docs/cil_conditional_statements.md | ||
39 | +++ secilc-3.0/docs/cil_conditional_statements.md | ||
40 | @@ -6,6 +6,8 @@ boolean | ||
41 | |||
42 | Declares a run time boolean as true or false in the current namespace. The [`booleanif`](cil_conditional_statements.md#booleanif) statement contains the CIL code that will be in the binary policy file. | ||
43 | |||
44 | +[`boolean`](cil_conditional_statements.md#boolean) are not allowed in [`booleanif`](cil_conditional_statements.md#booleanif) blocks. | ||
45 | + | ||
46 | **Statement definition:** | ||
47 | |||
48 | (boolean boolean_id true|false) | ||
49 | @@ -120,6 +122,8 @@ Tunables are similar to booleans, howeve | ||
50 | |||
51 | Note that tunables can be treated as booleans by the CIL compiler command line parameter `-P` or `--preserve-tunables` flags. | ||
52 | |||
53 | +Since [`tunableif`](cil_conditional_statements.md#tunableif) statements are resolved first, [`tunable`](cil_conditional_statements.md#tunable) statements are not allowed in [`in`](cil_container_statements.md#in), [`macro`](cil_call_macro_statements.md#macro), [`optional`](cil_container_statements.md#optional), and [`booleanif`](cil_conditional_statements.md#booleanif) blocks. To simplify processing, they are also not allowed in [`tunableif`](cil_conditional_statements.md#tunableif) blocks. | ||
54 | + | ||
55 | **Statement definition:** | ||
56 | |||
57 | (tunable tunable_id true|false) | ||
58 | @@ -156,6 +160,8 @@ tunableif | ||
59 | |||
60 | Compile time conditional statement that may or may not add CIL statements to be compiled. | ||
61 | |||
62 | +If tunables are being treated as booleans (by using the CIL compiler command line parameter `-P` or `--preserve-tunables` flag), then only the statements allowed in a [`booleanif`](cil_conditional_statements.md#booleanif) block are allowed in a [`tunableif`](cil_conditional_statements.md#tunableif) block. Otherwise, [`tunable`](cil_conditional_statements.md#tunable) statements are not allowed in a [`tunableif`](cil_conditional_statements.md#tunableif) block. | ||
63 | + | ||
64 | **Statement definition:** | ||
65 | |||
66 | (tunableif tunable_id | expr ...) | ||
67 | Index: secilc-3.0/docs/cil_container_statements.md | ||
68 | =================================================================== | ||
69 | --- secilc-3.0.orig/docs/cil_container_statements.md | ||
70 | +++ secilc-3.0/docs/cil_container_statements.md | ||
71 | @@ -4,7 +4,11 @@ Container Statements | ||
72 | block | ||
73 | ----- | ||
74 | |||
75 | -Start a new namespace where any CIL statement is valid. | ||
76 | +Start a new namespace. | ||
77 | + | ||
78 | +Not allowed in [`macro`](cil_call_macro_statements.md#macro) and [`optional`](cil_container_statements.md#optional) blocks. | ||
79 | + | ||
80 | +[`sensitivity`](cil_mls_labeling_statements.md#sensitivity) and [`category`](cil_mls_labeling_statements.md#category) statements are not allowed in [`block`](cil_container_statements.md#block) blocks. | ||
81 | |||
82 | **Statement definition:** | ||
83 | |||
84 | @@ -45,6 +49,8 @@ blockabstract | ||
85 | |||
86 | Declares the namespace as a 'template' and does not generate code until instantiated by another namespace that has a [`blockinherit`](cil_container_statements.md#blockinherit) statement. | ||
87 | |||
88 | +Not allowed in [`macro`](cil_call_macro_statements.md#macro) and [`optional`](cil_container_statements.md#optional) blocks. | ||
89 | + | ||
90 | **Statement definition:** | ||
91 | |||
92 | (block block_id | ||
93 | @@ -93,6 +99,8 @@ blockinherit | ||
94 | |||
95 | Used to add common policy rules to the current namespace via a template that has been defined with the [`blockabstract`](cil_container_statements.md#blockabstract) statement. All [`blockinherit`](cil_container_statements.md#blockinherit) statements are resolved first and then the contents of the block are copied. This is so that inherited blocks will not be inherited. For a concrete example, please see the examples section. | ||
96 | |||
97 | +Not allowed in [`macro`](cil_call_macro_statements.md#macro) blocks. | ||
98 | + | ||
99 | **Statement definition:** | ||
100 | |||
101 | (block block_id | ||
102 | @@ -191,15 +199,11 @@ This example contains a template `client | ||
103 | optional | ||
104 | -------- | ||
105 | |||
106 | -Declare an [`optional`](cil_container_statements.md#optional) namespace. All CIL statements in the optional block must be satisfied before instantiation in the binary policy. [`tunableif`](cil_conditional_statements.md#tunableif) and [`macro`](cil_call_macro_statements.md#macro) statements are not allowed in optional containers. The same restrictions apply to CIL policy statements within [`optional`](cil_container_statements.md#optional)'s that apply to kernel policy statements, i.e. only the policy statements shown in the following table are valid: | ||
107 | +Declare an [`optional`](cil_container_statements.md#optional) namespace. All CIL statements in the optional block must be satisfied before instantiation in the binary policy. | ||
108 | |||
109 | -| | | | | | ||
110 | -| ------------------- | -------------- | ------------------ | ------------------ | | ||
111 | -| [`allow`](cil_access_vector_rules.md#allow) | [`allowx`](cil_access_vector_rules.md#allowx) | [`auditallow`](cil_access_vector_rules.md#auditallow) | [`auditallowx`](cil_access_vector_rules.md#auditallowx) | | ||
112 | -| [`booleanif`](cil_conditional_statements.md#booleanif) | [`dontaudit`](cil_access_vector_rules.md#dontaudit) | [`dontauditx`](cil_access_vector_rules.md#dontauditx) | [`typepermissive`](cil_type_statements.md#typepermissive) | | ||
113 | -| [`rangetransition`](cil_mls_labeling_statements.md#rangetransition) | [`role`](cil_role_statements.md#role) | [`roleallow`](cil_role_statements.md#roleallow) | [`roleattribute`](cil_role_statements.md#roleattribute) | | ||
114 | -| [`roletransition`](cil_role_statements.md#roletransition) | [`type`](cil_type_statements.md#type) | [`typealias`](cil_type_statements.md#typealias) | [`typeattribute`](cil_type_statements.md#typeattribute) | | ||
115 | -| [`typechange`](cil_type_statements.md#typechange) | [`typemember`](cil_type_statements.md#typemember) | [`typetransition`](cil_type_statements.md#typetransition) | | | ||
116 | +Not allowed in [`booleanif`](cil_conditional_statements.md#booleanif) blocks. | ||
117 | + | ||
118 | +[`tunable`](cil_conditional_statements.md#tunable), [`in`](cil_container_statements.md#in), [`block`](cil_container_statements.md#block), [`blockabstract`](cil_container_statements.md#blockabstract), and [`macro`](cil_call_macro_statements.md#macro) statements are not allowed in [`optional`](cil_container_statements.md#optional) blocks. | ||
119 | |||
120 | **Statement definition:** | ||
121 | |||
122 | @@ -254,7 +258,11 @@ This example will instantiate the option | ||
123 | in | ||
124 | -- | ||
125 | |||
126 | -Allows the insertion of CIL statements into a named container ([`block`](cil_container_statements.md#block), [`optional`](cil_container_statements.md#optional) or [`macro`](cil_call_macro_statements.md#macro)). This statement is not allowed in [`booleanif`](cil_conditional_statements.md#booleanif) or [`tunableif`](cil_conditional_statements.md#tunableif) statements. | ||
127 | +Allows the insertion of CIL statements into a named container ([`block`](cil_container_statements.md#block), [`optional`](cil_container_statements.md#optional) or [`macro`](cil_call_macro_statements.md#macro)). | ||
128 | + | ||
129 | +Not allowed in [`macro`](cil_call_macro_statements.md#macro), [`booleanif`](cil_conditional_statements.md#booleanif), and other [`in`](cil_container_statements.md#in) blocks. | ||
130 | + | ||
131 | +[`tunable`](cil_conditional_statements.md#tunable) and [`in`](cil_container_statements.md#in) statements are not allowed in [`in`](cil_container_statements.md#in) blocks. | ||
132 | |||
133 | **Statement definition:** | ||
134 | |||
diff --git a/recipes-security/selinux/secilc_3.0.bb b/recipes-security/selinux/secilc_3.0.bb index 71b6cff..aa7d897 100644 --- a/recipes-security/selinux/secilc_3.0.bb +++ b/recipes-security/selinux/secilc_3.0.bb | |||
@@ -1,6 +1,8 @@ | |||
1 | require selinux_20191204.inc | 1 | require selinux_20191204.inc |
2 | require ${BPN}.inc | 2 | require ${BPN}.inc |
3 | 3 | ||
4 | SRC_URI += "file://CVE-2021-36087.patch" | ||
5 | |||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=c7e802b9a3b0c2c852669864c08b9138" | 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=c7e802b9a3b0c2c852669864c08b9138" |
5 | 7 | ||
6 | SRC_URI[md5sum] = "be7ec221b874053a843ef90e49daa5cf" | 8 | SRC_URI[md5sum] = "be7ec221b874053a843ef90e49daa5cf" |