Commit 4c74c7d
committed
IMA: Read required policy from file
Previously snipped of required policy was as a string or regexp.
Loading required policy from file allows to move code to ima_setup.sh.
This is a preparation for loading IMA policy from file.
Check can be done on one or both:
1) IMA builtin policy (based on /proc/cmdline)
2) IMA policy content (actual content of /sys/kernel/security/ima/policy)
When missing CONFIG_IMA_READ_POLICY=y on required policy convert: test,
but convert TFAIL => TCONF.
Link: https://lore.kernel.org/ltp/20250114112915.610297-6-pvorel@suse.cz/
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>1 parent 3089191 commit 4c74c7d
File tree
6 files changed
+92
-80
lines changed- testcases/kernel/security/integrity/ima/tests
6 files changed
+92
-80
lines changedLines changed: 5 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 49 | | |
55 | 50 | | |
56 | 51 | | |
| |||
79 | 74 | | |
80 | 75 | | |
81 | 76 | | |
82 | | - | |
83 | 77 | | |
84 | 78 | | |
85 | 79 | | |
| |||
97 | 91 | | |
98 | 92 | | |
99 | 93 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
105 | 97 | | |
106 | | - | |
107 | 98 | | |
108 | 99 | | |
109 | 100 | | |
| |||
Lines changed: 14 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
23 | 20 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 21 | + | |
28 | 22 | | |
29 | | - | |
30 | | - | |
31 | 23 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
36 | 28 | | |
37 | 29 | | |
38 | | - | |
| 30 | + | |
39 | 31 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 32 | + | |
47 | 33 | | |
48 | 34 | | |
49 | 35 | | |
50 | 36 | | |
51 | 37 | | |
52 | 38 | | |
53 | 39 | | |
54 | | - | |
55 | 40 | | |
56 | 41 | | |
57 | 42 | | |
58 | 43 | | |
59 | | - | |
60 | 44 | | |
61 | 45 | | |
62 | 46 | | |
| |||
87 | 71 | | |
88 | 72 | | |
89 | 73 | | |
90 | | - | |
| 74 | + | |
91 | 75 | | |
92 | 76 | | |
93 | 77 | | |
| |||
105 | 89 | | |
106 | 90 | | |
107 | 91 | | |
108 | | - | |
109 | 92 | | |
110 | 93 | | |
111 | 94 | | |
112 | 95 | | |
113 | | - | |
114 | | - | |
115 | 96 | | |
116 | 97 | | |
117 | 98 | | |
| |||
126 | 107 | | |
127 | 108 | | |
128 | 109 | | |
129 | | - | |
| 110 | + | |
130 | 111 | | |
131 | 112 | | |
132 | 113 | | |
133 | 114 | | |
134 | | - | |
| 115 | + | |
135 | 116 | | |
136 | 117 | | |
137 | 118 | | |
138 | 119 | | |
139 | 120 | | |
140 | 121 | | |
141 | | - | |
| 122 | + | |
142 | 123 | | |
143 | 124 | | |
144 | 125 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
90 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
| |||
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
| |||
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
48 | | - | |
| 46 | + | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
78 | | - | |
| 76 | + | |
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
| |||
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
89 | | - | |
| 87 | + | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
| |||
116 | 114 | | |
117 | 115 | | |
118 | 116 | | |
119 | | - | |
| 117 | + | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
| |||
129 | 127 | | |
130 | 128 | | |
131 | 129 | | |
132 | | - | |
| 130 | + | |
133 | 131 | | |
134 | 132 | | |
135 | 133 | | |
| |||
146 | 144 | | |
147 | 145 | | |
148 | 146 | | |
149 | | - | |
| 147 | + | |
150 | 148 | | |
151 | 149 | | |
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
155 | 153 | | |
156 | | - | |
| 154 | + | |
157 | 155 | | |
158 | 156 | | |
159 | 157 | | |
160 | 158 | | |
161 | 159 | | |
162 | | - | |
| 160 | + | |
163 | 161 | | |
164 | 162 | | |
165 | 163 | | |
| |||
Lines changed: 51 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
89 | | - | |
90 | 92 | | |
91 | 93 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 94 | + | |
104 | 95 | | |
105 | 96 | | |
106 | 97 | | |
| |||
159 | 150 | | |
160 | 151 | | |
161 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
162 | 198 | | |
163 | 199 | | |
164 | 200 | | |
| |||
181 | 217 | | |
182 | 218 | | |
183 | 219 | | |
184 | | - | |
185 | | - | |
186 | | - | |
| 220 | + | |
187 | 221 | | |
188 | 222 | | |
189 | 223 | | |
| |||
291 | 325 | | |
292 | 326 | | |
293 | 327 | | |
294 | | - | |
| 328 | + | |
295 | 329 | | |
296 | 330 | | |
297 | 331 | | |
| |||
0 commit comments