blob: d22010cf8ab28304d277f15fe4e842ebf6d6f34b [file] [log] [blame]
Tri Voa5cfd3e2018-03-22 11:35:02 -07001// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Bob Badour601ebb42021-02-03 23:07:40 -080015package {
16 default_applicable_licenses: ["system_sepolicy_license"],
17}
18
19// Added automatically by a large-scale-change that took the approach of
20// 'apply every license found to every target'. While this makes sure we respect
21// every license restriction, it may not be entirely correct.
22//
23// e.g. GPL in an MIT project might only apply to the contrib/ directory.
24//
25// Please consider splitting the single license below into multiple licenses,
26// taking care not to lose any license_kind information, and overriding the
27// default license using the 'licenses: [...]' property on targets as needed.
28//
29// For unused files, consider creating a 'filegroup' with "//visibility:private"
30// to attach the license to, and including a comment whether the files may be
31// used in the current project.
32// http://go/android-license-faq
33license {
34 name: "system_sepolicy_license",
35 visibility: [":__subpackages__"],
36 license_kinds: [
37 "SPDX-license-identifier-Apache-2.0",
38 "legacy_unencumbered",
39 ],
40 license_text: [
41 "NOTICE",
42 ],
43}
44
Jeff Vander Stoepecd288f2019-02-15 12:18:15 -080045cc_defaults { name: "selinux_policy_version", cflags: ["-DSEPOLICY_VERSION=30"], }
46
Tri Vo84e247a2018-03-25 20:03:58 -070047se_filegroup {
Jae Shin1fa96342018-07-11 18:30:44 +090048 name: "28.0.board.compat.map",
49 srcs: [
50 "compat/28.0/28.0.cil",
51 ],
52}
53
Jinguang Donge0125692019-03-05 17:20:54 +080054se_filegroup {
Tri Vo50aa0292019-06-01 17:04:13 -070055 name: "29.0.board.compat.map",
56 srcs: [
57 "compat/29.0/29.0.cil",
58 ],
59}
60
61se_filegroup {
Inseob Kimace36ab2020-05-07 20:19:05 +090062 name: "30.0.board.compat.map",
63 srcs: [
64 "compat/30.0/30.0.cil",
65 ],
66}
67
68se_filegroup {
Inseob Kim4f20ff72021-06-15 21:05:39 +090069 name: "31.0.board.compat.map",
70 srcs: [
71 "compat/31.0/31.0.cil",
72 ],
73}
74
75se_filegroup {
Inseob Kimbee558e2021-11-30 14:58:10 +090076 name: "32.0.board.compat.map",
77 srcs: [
78 "compat/32.0/32.0.cil",
79 ],
80}
81
82se_filegroup {
Yi-Yo Chiang8be93c02021-04-13 02:49:29 +080083 name: "28.0.board.compat.cil",
84 srcs: [
85 "compat/28.0/28.0.compat.cil",
86 ],
87}
88
89se_filegroup {
90 name: "29.0.board.compat.cil",
91 srcs: [
92 "compat/29.0/29.0.compat.cil",
93 ],
94}
95
96se_filegroup {
97 name: "30.0.board.compat.cil",
98 srcs: [
99 "compat/30.0/30.0.compat.cil",
100 ],
101}
102
103se_filegroup {
Inseob Kim4f20ff72021-06-15 21:05:39 +0900104 name: "31.0.board.compat.cil",
105 srcs: [
106 "compat/31.0/31.0.compat.cil",
107 ],
108}
109
110se_filegroup {
Inseob Kimbee558e2021-11-30 14:58:10 +0900111 name: "32.0.board.compat.cil",
112 srcs: [
113 "compat/32.0/32.0.compat.cil",
114 ],
115}
116
117se_filegroup {
Jinguang Donge0125692019-03-05 17:20:54 +0800118 name: "28.0.board.ignore.map",
119 srcs: [
120 "compat/28.0/28.0.ignore.cil",
121 ],
122}
123
Tri Vo50aa0292019-06-01 17:04:13 -0700124se_filegroup {
125 name: "29.0.board.ignore.map",
126 srcs: [
127 "compat/29.0/29.0.ignore.cil",
128 ],
129}
130
Inseob Kimace36ab2020-05-07 20:19:05 +0900131se_filegroup {
132 name: "30.0.board.ignore.map",
133 srcs: [
134 "compat/30.0/30.0.ignore.cil",
135 ],
136}
137
Inseob Kim4f20ff72021-06-15 21:05:39 +0900138se_filegroup {
139 name: "31.0.board.ignore.map",
140 srcs: [
141 "compat/31.0/31.0.ignore.cil",
142 ],
143}
144
Inseob Kimbee558e2021-11-30 14:58:10 +0900145se_filegroup {
146 name: "32.0.board.ignore.map",
147 srcs: [
148 "compat/32.0/32.0.ignore.cil",
149 ],
150}
151
Tri Voa5cfd3e2018-03-22 11:35:02 -0700152se_cil_compat_map {
Tri Vo61178552019-10-10 16:29:40 -0700153 name: "plat_28.0.cil",
154 stem: "28.0.cil",
Tri Vo438684b2018-09-29 17:47:10 -0700155 bottom_half: [":28.0.board.compat.map"],
Tri Vo61178552019-10-10 16:29:40 -0700156 top_half: "plat_29.0.cil",
Tri Vo50aa0292019-06-01 17:04:13 -0700157}
158
159se_cil_compat_map {
Tri Vo61178552019-10-10 16:29:40 -0700160 name: "plat_29.0.cil",
161 stem: "29.0.cil",
Tri Vo50aa0292019-06-01 17:04:13 -0700162 bottom_half: [":29.0.board.compat.map"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900163 top_half: "plat_30.0.cil",
164}
165
166se_cil_compat_map {
167 name: "plat_30.0.cil",
168 stem: "30.0.cil",
169 bottom_half: [":30.0.board.compat.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900170 top_half: "plat_31.0.cil",
171}
172
173se_cil_compat_map {
174 name: "plat_31.0.cil",
175 stem: "31.0.cil",
176 bottom_half: [":31.0.board.compat.map"],
Inseob Kimbee558e2021-11-30 14:58:10 +0900177 top_half: "plat_32.0.cil",
178}
179
180se_cil_compat_map {
181 name: "plat_32.0.cil",
182 stem: "32.0.cil",
183 bottom_half: [":32.0.board.compat.map"],
184 // top_half: "plat_33.0.cil",
Tri Vo61178552019-10-10 16:29:40 -0700185}
186
187se_cil_compat_map {
Tri Vo61178552019-10-10 16:29:40 -0700188 name: "system_ext_28.0.cil",
189 stem: "28.0.cil",
190 bottom_half: [":28.0.board.compat.map"],
191 top_half: "system_ext_29.0.cil",
192 system_ext_specific: true,
193}
194
195se_cil_compat_map {
196 name: "system_ext_29.0.cil",
197 stem: "29.0.cil",
198 bottom_half: [":29.0.board.compat.map"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900199 top_half: "system_ext_30.0.cil",
200 system_ext_specific: true,
201}
202
203se_cil_compat_map {
204 name: "system_ext_30.0.cil",
205 stem: "30.0.cil",
206 bottom_half: [":30.0.board.compat.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900207 top_half: "system_ext_31.0.cil",
208 system_ext_specific: true,
209}
210
211se_cil_compat_map {
212 name: "system_ext_31.0.cil",
213 stem: "31.0.cil",
214 bottom_half: [":31.0.board.compat.map"],
Inseob Kimbee558e2021-11-30 14:58:10 +0900215 top_half: "system_ext_32.0.cil",
216 system_ext_specific: true,
217}
218
219se_cil_compat_map {
220 name: "system_ext_32.0.cil",
221 stem: "32.0.cil",
222 bottom_half: [":32.0.board.compat.map"],
223 // top_half: "system_ext_33.0.cil",
Tri Vo61178552019-10-10 16:29:40 -0700224 system_ext_specific: true,
225}
226
227se_cil_compat_map {
Tri Vo61178552019-10-10 16:29:40 -0700228 name: "product_28.0.cil",
229 stem: "28.0.cil",
230 bottom_half: [":28.0.board.compat.map"],
231 top_half: "product_29.0.cil",
232 product_specific: true,
233}
234
235se_cil_compat_map {
236 name: "product_29.0.cil",
237 stem: "29.0.cil",
238 bottom_half: [":29.0.board.compat.map"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900239 top_half: "product_30.0.cil",
240 product_specific: true,
241}
242
243se_cil_compat_map {
244 name: "product_30.0.cil",
245 stem: "30.0.cil",
246 bottom_half: [":30.0.board.compat.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900247 top_half: "product_31.0.cil",
248 product_specific: true,
249}
250
251se_cil_compat_map {
252 name: "product_31.0.cil",
253 stem: "31.0.cil",
254 bottom_half: [":31.0.board.compat.map"],
Inseob Kimbee558e2021-11-30 14:58:10 +0900255 top_half: "product_32.0.cil",
256 product_specific: true,
257}
258
259se_cil_compat_map {
260 name: "product_32.0.cil",
261 stem: "32.0.cil",
262 bottom_half: [":32.0.board.compat.map"],
263 // top_half: "product_33.0.cil",
Tri Vo61178552019-10-10 16:29:40 -0700264 product_specific: true,
Tri Vo438684b2018-09-29 17:47:10 -0700265}
266
267se_cil_compat_map {
Tri Vo438684b2018-09-29 17:47:10 -0700268 name: "28.0.ignore.cil",
Jinguang Donge0125692019-03-05 17:20:54 +0800269 bottom_half: [":28.0.board.ignore.map"],
Tri Voe381deb2019-06-12 15:52:30 -0700270 top_half: "29.0.ignore.cil",
Jae Shin1fa96342018-07-11 18:30:44 +0900271}
Inseob Kimb554e592019-04-15 20:10:46 +0900272
Tri Vo50aa0292019-06-01 17:04:13 -0700273se_cil_compat_map {
274 name: "29.0.ignore.cil",
275 bottom_half: [":29.0.board.ignore.map"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900276 top_half: "30.0.ignore.cil",
277}
278
279se_cil_compat_map {
280 name: "30.0.ignore.cil",
281 bottom_half: [":30.0.board.ignore.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900282 top_half: "31.0.ignore.cil",
283}
284
285se_cil_compat_map {
286 name: "31.0.ignore.cil",
287 bottom_half: [":31.0.board.ignore.map"],
Inseob Kimbee558e2021-11-30 14:58:10 +0900288 top_half: "32.0.ignore.cil",
289}
290
291se_cil_compat_map {
292 name: "32.0.ignore.cil",
293 bottom_half: [":32.0.board.ignore.map"],
294 // top_half: "33.0.ignore.cil",
Tri Vo50aa0292019-06-01 17:04:13 -0700295}
296
P.Adarsh Reddy07dd59f2021-03-22 15:55:09 +0530297se_cil_compat_map {
298 name: "system_ext_30.0.ignore.cil",
299 bottom_half: [":30.0.board.ignore.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900300 top_half: "system_ext_31.0.ignore.cil",
301 system_ext_specific: true,
302}
303
304se_cil_compat_map {
305 name: "system_ext_31.0.ignore.cil",
306 bottom_half: [":31.0.board.ignore.map"],
Inseob Kimbee558e2021-11-30 14:58:10 +0900307 top_half: "system_ext_32.0.ignore.cil",
308 system_ext_specific: true,
309}
310
311se_cil_compat_map {
312 name: "system_ext_32.0.ignore.cil",
313 bottom_half: [":32.0.board.ignore.map"],
314 // top_half: "system_ext_33.0.ignore.cil",
P.Adarsh Reddy07dd59f2021-03-22 15:55:09 +0530315 system_ext_specific: true,
316}
317
318se_cil_compat_map {
319 name: "product_30.0.ignore.cil",
320 bottom_half: [":30.0.board.ignore.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900321 top_half: "product_31.0.ignore.cil",
322 product_specific: true,
323}
324
325se_cil_compat_map {
326 name: "product_31.0.ignore.cil",
327 bottom_half: [":31.0.board.ignore.map"],
Inseob Kimbee558e2021-11-30 14:58:10 +0900328 top_half: "product_32.0.ignore.cil",
329 product_specific: true,
330}
331
332se_cil_compat_map {
333 name: "product_32.0.ignore.cil",
334 bottom_half: [":32.0.board.ignore.map"],
335 // top_half: "product_33.0.ignore.cil",
P.Adarsh Reddy07dd59f2021-03-22 15:55:09 +0530336 product_specific: true,
337}
338
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800339se_compat_cil {
Tri Vo50aa0292019-06-01 17:04:13 -0700340 name: "28.0.compat.cil",
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800341 srcs: [":28.0.board.compat.cil"],
Tri Vo50aa0292019-06-01 17:04:13 -0700342}
343
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800344se_compat_cil {
Tri Vo50aa0292019-06-01 17:04:13 -0700345 name: "29.0.compat.cil",
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800346 srcs: [":29.0.board.compat.cil"],
Jeff Vander Stoep564e2922019-05-02 13:48:44 -0700347}
348
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800349se_compat_cil {
Inseob Kimace36ab2020-05-07 20:19:05 +0900350 name: "30.0.compat.cil",
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800351 srcs: [":30.0.board.compat.cil"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900352}
353
Yi-Yo Chiang8be93c02021-04-13 02:49:29 +0800354se_compat_cil {
Inseob Kim4f20ff72021-06-15 21:05:39 +0900355 name: "31.0.compat.cil",
356 srcs: [":31.0.board.compat.cil"],
357}
358
359se_compat_cil {
Inseob Kimbee558e2021-11-30 14:58:10 +0900360 name: "32.0.compat.cil",
361 srcs: [":32.0.board.compat.cil"],
362}
363
364se_compat_cil {
Yi-Yo Chiang8be93c02021-04-13 02:49:29 +0800365 name: "system_ext_28.0.compat.cil",
366 srcs: [":28.0.board.compat.cil"],
367 stem: "28.0.compat.cil",
368 system_ext_specific: true,
369}
370
371se_compat_cil {
372 name: "system_ext_29.0.compat.cil",
373 srcs: [":29.0.board.compat.cil"],
374 stem: "29.0.compat.cil",
375 system_ext_specific: true,
376}
377
378se_compat_cil {
379 name: "system_ext_30.0.compat.cil",
380 srcs: [":30.0.board.compat.cil"],
381 stem: "30.0.compat.cil",
382 system_ext_specific: true,
383}
384
Inseob Kim4f20ff72021-06-15 21:05:39 +0900385se_compat_cil {
386 name: "system_ext_31.0.compat.cil",
387 srcs: [":31.0.board.compat.cil"],
388 stem: "31.0.compat.cil",
389 system_ext_specific: true,
390}
391
Inseob Kimbee558e2021-11-30 14:58:10 +0900392se_compat_cil {
393 name: "system_ext_32.0.compat.cil",
394 srcs: [":32.0.board.compat.cil"],
395 stem: "32.0.compat.cil",
396 system_ext_specific: true,
397}
398
Inseob Kimb554e592019-04-15 20:10:46 +0900399se_filegroup {
400 name: "file_contexts_files",
401 srcs: ["file_contexts"],
402}
403
404se_filegroup {
405 name: "file_contexts_asan_files",
406 srcs: ["file_contexts_asan"],
407}
408
409se_filegroup {
410 name: "file_contexts_overlayfs_files",
411 srcs: ["file_contexts_overlayfs"],
412}
413
414se_filegroup {
415 name: "hwservice_contexts_files",
416 srcs: ["hwservice_contexts"],
417}
418
419se_filegroup {
420 name: "property_contexts_files",
421 srcs: ["property_contexts"],
422}
423
424se_filegroup {
425 name: "service_contexts_files",
426 srcs: ["service_contexts"],
427}
428
Janis Danisevskisc40681f2020-07-25 13:02:29 -0700429se_filegroup {
430 name: "keystore2_key_contexts_files",
431 srcs: ["keystore2_key_contexts"],
432}
433
Inseob Kimb554e592019-04-15 20:10:46 +0900434file_contexts {
435 name: "plat_file_contexts",
436 srcs: [":file_contexts_files"],
437 product_variables: {
438 address_sanitize: {
439 srcs: [":file_contexts_asan_files"],
440 },
441 debuggable: {
442 srcs: [":file_contexts_overlayfs_files"],
443 },
444 },
445
446 flatten_apex: {
447 srcs: ["apex/*-file_contexts"],
448 },
Yuntao Xu42e732c2021-11-18 22:33:02 +0000449}
Inseob Kimb554e592019-04-15 20:10:46 +0900450
Yuntao Xu42e732c2021-11-18 22:33:02 +0000451file_contexts {
452 name: "plat_file_contexts.recovery",
453 srcs: [":file_contexts_files"],
454 stem: "plat_file_contexts",
455 product_variables: {
456 address_sanitize: {
457 srcs: [":file_contexts_asan_files"],
458 },
459 debuggable: {
460 srcs: [":file_contexts_overlayfs_files"],
461 },
462 },
463
464 flatten_apex: {
465 srcs: ["apex/*-file_contexts"],
466 },
467
468 recovery: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900469}
470
471file_contexts {
472 name: "vendor_file_contexts",
473 srcs: [":file_contexts_files"],
474 soc_specific: true,
475 recovery_available: true,
476}
477
478file_contexts {
Bowgo Tsai86a048d2019-09-09 22:04:06 +0800479 name: "system_ext_file_contexts",
480 srcs: [":file_contexts_files"],
481 system_ext_specific: true,
482 recovery_available: true,
483}
484
485file_contexts {
Inseob Kimb554e592019-04-15 20:10:46 +0900486 name: "product_file_contexts",
487 srcs: [":file_contexts_files"],
488 product_specific: true,
489 recovery_available: true,
490}
491
492file_contexts {
493 name: "odm_file_contexts",
494 srcs: [":file_contexts_files"],
495 device_specific: true,
496 recovery_available: true,
497}
498
499hwservice_contexts {
500 name: "plat_hwservice_contexts",
501 srcs: [":hwservice_contexts_files"],
502}
503
504hwservice_contexts {
Bowgo Tsai241d36e2019-09-09 22:05:10 +0800505 name: "system_ext_hwservice_contexts",
506 srcs: [":hwservice_contexts_files"],
507 system_ext_specific: true,
508}
509
510hwservice_contexts {
Inseob Kimb554e592019-04-15 20:10:46 +0900511 name: "product_hwservice_contexts",
512 srcs: [":hwservice_contexts_files"],
513 product_specific: true,
514}
515
516hwservice_contexts {
517 name: "vendor_hwservice_contexts",
518 srcs: [":hwservice_contexts_files"],
519 reqd_mask: true,
520 soc_specific: true,
521}
522
523hwservice_contexts {
524 name: "odm_hwservice_contexts",
525 srcs: [":hwservice_contexts_files"],
526 device_specific: true,
527}
528
529property_contexts {
530 name: "plat_property_contexts",
531 srcs: [":property_contexts_files"],
Yuntao Xu42e732c2021-11-18 22:33:02 +0000532}
533
534property_contexts {
535 name: "plat_property_contexts.recovery",
536 srcs: [":property_contexts_files"],
537 stem: "plat_property_contexts",
538 recovery: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900539}
540
541property_contexts {
Bowgo Tsai1864cd02019-09-09 18:09:22 +0800542 name: "system_ext_property_contexts",
543 srcs: [":property_contexts_files"],
544 system_ext_specific: true,
545 recovery_available: true,
546}
547
548property_contexts {
Inseob Kimb554e592019-04-15 20:10:46 +0900549 name: "product_property_contexts",
550 srcs: [":property_contexts_files"],
551 product_specific: true,
552 recovery_available: true,
553}
554
555property_contexts {
556 name: "vendor_property_contexts",
557 srcs: [":property_contexts_files"],
558 reqd_mask: true,
559 soc_specific: true,
560 recovery_available: true,
561}
562
563property_contexts {
564 name: "odm_property_contexts",
565 srcs: [":property_contexts_files"],
566 device_specific: true,
567 recovery_available: true,
568}
569
570service_contexts {
571 name: "plat_service_contexts",
572 srcs: [":service_contexts_files"],
Yuntao Xu42e732c2021-11-18 22:33:02 +0000573}
574
575service_contexts {
576 name: "plat_service_contexts.recovery",
577 srcs: [":service_contexts_files"],
578 stem: "plat_service_contexts",
579 recovery: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900580}
581
582service_contexts {
Bowgo Tsai98231162019-09-09 22:05:29 +0800583 name: "system_ext_service_contexts",
584 srcs: [":service_contexts_files"],
585 system_ext_specific: true,
Yifan Hongd6b29012021-11-13 00:22:01 -0800586 recovery_available: true,
Bowgo Tsai98231162019-09-09 22:05:29 +0800587}
588
589service_contexts {
Inseob Kimb554e592019-04-15 20:10:46 +0900590 name: "product_service_contexts",
591 srcs: [":service_contexts_files"],
592 product_specific: true,
Yifan Hongd6b29012021-11-13 00:22:01 -0800593 recovery_available: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900594}
595
596service_contexts {
597 name: "vendor_service_contexts",
598 srcs: [":service_contexts_files"],
599 reqd_mask: true,
600 soc_specific: true,
Yifan Hongd6b29012021-11-13 00:22:01 -0800601 recovery_available: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900602}
yangbill3e345372020-04-15 13:55:47 +0800603
Janis Danisevskisc40681f2020-07-25 13:02:29 -0700604keystore2_key_contexts {
605 name: "plat_keystore2_key_contexts",
606 srcs: [":keystore2_key_contexts_files"],
607}
608
609keystore2_key_contexts {
610 name: "system_keystore2_key_contexts",
611 srcs: [":keystore2_key_contexts_files"],
612 system_ext_specific: true,
613}
614
615keystore2_key_contexts {
616 name: "product_keystore2_key_contexts",
617 srcs: [":keystore2_key_contexts_files"],
618 product_specific: true,
619}
620
621keystore2_key_contexts {
622 name: "vendor_keystore2_key_contexts",
623 srcs: [":keystore2_key_contexts_files"],
624 reqd_mask: true,
625 soc_specific: true,
626}
627
yangbill3e345372020-04-15 13:55:47 +0800628// For vts_treble_sys_prop_test
629filegroup {
630 name: "private_property_contexts",
631 srcs: ["private/property_contexts"],
632 visibility: [
633 "//test/vts-testcase/security/system_property",
634 ],
635}
Inseob Kime35b49b2021-02-18 19:15:41 +0900636
Inseob Kima49e7242021-03-22 10:26:13 +0900637se_build_files {
638 name: "se_build_files",
Inseob Kime35b49b2021-02-18 19:15:41 +0900639 srcs: [
Inseob Kima49e7242021-03-22 10:26:13 +0900640 "security_classes",
641 "initial_sids",
642 "access_vectors",
643 "global_macros",
644 "neverallow_macros",
645 "mls_macros",
646 "mls_decl",
647 "mls",
648 "policy_capabilities",
649 "te_macros",
650 "attributes",
651 "ioctl_defines",
652 "ioctl_macros",
653 "*.te",
654 "roles_decl",
655 "roles",
656 "users",
657 "initial_sid_contexts",
658 "fs_use",
659 "genfs_contexts",
660 "port_contexts",
Inseob Kime35b49b2021-02-18 19:15:41 +0900661 ],
662}
663
Inseob Kim0a707fa2021-12-09 23:35:11 +0900664reqd_mask_policy = [":se_build_files{.reqd_mask}"]
665plat_public_policy = [":se_build_files{.plat_public}"]
666plat_private_policy = [":se_build_files{.plat_private}"]
667system_ext_public_policy = [":se_build_files{.system_ext_public}"]
668system_ext_private_policy = [":se_build_files{.system_ext_private}"]
669product_public_policy = [":se_build_files{.product_public}"]
670product_private_policy = [":se_build_files{.product_private}"]
671
Inseob Kima49e7242021-03-22 10:26:13 +0900672// reqd_policy_mask - a policy.conf file which contains only the bare minimum
673// policy necessary to use checkpolicy.
674//
675// This bare-minimum policy needs to be present in all policy.conf files, but
676// should not necessarily be exported as part of the public policy.
677//
678// The rules generated by reqd_policy_mask will allow the compilation of public
679// policy and subsequent removal of CIL policy that should not be exported.
680se_policy_conf {
681 name: "reqd_policy_mask.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +0900682 srcs: reqd_mask_policy,
Inseob Kime35b49b2021-02-18 19:15:41 +0900683 installable: false,
684}
685
Inseob Kima49e7242021-03-22 10:26:13 +0900686se_policy_cil {
687 name: "reqd_policy_mask.cil",
688 src: ":reqd_policy_mask.conf",
689 secilc_check: false,
690 installable: false,
Inseob Kime35b49b2021-02-18 19:15:41 +0900691}
692
Inseob Kima49e7242021-03-22 10:26:13 +0900693// pub_policy - policy that will be exported to be a part of non-platform
694// policy corresponding to this platform version.
695//
696// This is a limited subset of policy that would not compile in checkpolicy on
697// its own.
698//
699// To get around this limitation, add only the required files from private
700// policy, which will generate CIL policy that will then be filtered out by the
701// reqd_policy_mask.
702//
703// There are three pub_policy.cil files below:
704// - pub_policy.cil: exported 'product', 'system_ext' and 'system' policy.
705// - system_ext_pub_policy.cil: exported 'system_ext' and 'system' policy.
706// - plat_pub_policy.cil: exported 'system' policy.
707//
708// Those above files will in turn be used to generate the following versioned cil files:
709// - product_mapping_file: the versioned, exported 'product' policy in product partition.
710// - system_ext_mapping_file: the versioned, exported 'system_ext' policy in system_ext partition.
711// - plat_mapping_file: the versioned, exported 'system' policy in system partition.
712// - plat_pub_versioned.cil: the versioned, exported 'product', 'system_ext' and 'system' policy
713// in vendor partition.
714//
715se_policy_conf {
716 name: "pub_policy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +0900717 srcs: plat_public_policy +
718 system_ext_public_policy +
719 product_public_policy +
720 reqd_mask_policy,
Inseob Kima49e7242021-03-22 10:26:13 +0900721 installable: false,
722}
723
724se_policy_cil {
725 name: "pub_policy.cil",
726 src: ":pub_policy.conf",
727 filter_out: [":reqd_policy_mask.cil"],
728 secilc_check: false,
729 installable: false,
730}
731
732se_policy_conf {
733 name: "system_ext_pub_policy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +0900734 srcs: plat_public_policy +
735 system_ext_public_policy +
736 reqd_mask_policy,
Inseob Kima49e7242021-03-22 10:26:13 +0900737 installable: false,
738}
739
740se_policy_cil {
741 name: "system_ext_pub_policy.cil",
742 src: ":system_ext_pub_policy.conf",
743 filter_out: [":reqd_policy_mask.cil"],
744 secilc_check: false,
745 installable: false,
746}
747
748se_policy_conf {
749 name: "plat_pub_policy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +0900750 srcs: plat_public_policy +
751 reqd_mask_policy,
Inseob Kima49e7242021-03-22 10:26:13 +0900752 installable: false,
753}
754
755se_policy_cil {
756 name: "plat_pub_policy.cil",
757 src: ":plat_pub_policy.conf",
758 filter_out: [":reqd_policy_mask.cil"],
759 secilc_check: false,
760 installable: false,
761}
762
763// plat_policy.conf - A combination of the private and public platform policy
764// which will ship with the device.
765//
766// The platform will always reflect the most recent platform version and is not
767// currently being attributized.
768se_policy_conf {
769 name: "plat_sepolicy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +0900770 srcs: plat_public_policy +
771 plat_private_policy,
Inseob Kima49e7242021-03-22 10:26:13 +0900772 installable: false,
773}
774
775se_policy_cil {
776 name: "plat_sepolicy.cil",
777 src: ":plat_sepolicy.conf",
778 additional_cil_files: ["private/technical_debt.cil"],
779}
780
Inseob Kim6cc75f42021-04-29 13:53:20 +0000781// userdebug_plat_policy.conf - the userdebug version plat_sepolicy.cil
782se_policy_conf {
783 name: "userdebug_plat_sepolicy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +0900784 srcs: plat_public_policy +
785 plat_private_policy,
Inseob Kim6cc75f42021-04-29 13:53:20 +0000786 build_variant: "userdebug",
787 installable: false,
788}
789
790se_policy_cil {
791 name: "userdebug_plat_sepolicy.cil",
792 src: ":userdebug_plat_sepolicy.conf",
793 additional_cil_files: ["private/technical_debt.cil"],
794 debug_ramdisk: true,
Yi-Yo Chiang68478b12021-10-16 03:23:05 +0800795 dist: {
796 targets: ["droidcore"],
797 },
Inseob Kim6cc75f42021-04-29 13:53:20 +0000798}
799
Yi-Yo Chiang857ffc42021-09-23 14:14:16 +0000800// A copy of the userdebug_plat_policy in GSI.
801soong_config_module_type {
802 name: "gsi_se_policy_cil",
803 module_type: "se_policy_cil",
804 config_namespace: "ANDROID",
805 bool_variables: [
806 "PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT",
807 ],
808 properties: [
809 "enabled",
810 "installable",
811 ],
812}
813
814gsi_se_policy_cil {
815 name: "system_ext_userdebug_plat_sepolicy.cil",
816 stem: "userdebug_plat_sepolicy.cil",
817 src: ":userdebug_plat_sepolicy.conf",
818 additional_cil_files: ["private/technical_debt.cil"],
819 system_ext_specific: true,
820 enabled: false,
821 installable: false,
822 soong_config_variables: {
823 PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT: {
824 enabled: true,
825 installable: true,
826 },
827 },
828}
829
Inseob Kima49e7242021-03-22 10:26:13 +0900830// system_ext_policy.conf - A combination of the private and public system_ext
831// policy which will ship with the device. System_ext policy is not attributized
832se_policy_conf {
833 name: "system_ext_sepolicy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +0900834 srcs: plat_public_policy +
835 plat_private_policy +
836 system_ext_public_policy +
837 system_ext_private_policy,
Inseob Kima49e7242021-03-22 10:26:13 +0900838 installable: false,
839}
840
841se_policy_cil {
842 name: "system_ext_sepolicy.cil",
843 src: ":system_ext_sepolicy.conf",
844 system_ext_specific: true,
845 filter_out: [":plat_sepolicy.cil"],
846 remove_line_marker: true,
847}
848
849// product_policy.conf - A combination of the private and public product policy
850// which will ship with the device. Product policy is not attributized
851se_policy_conf {
852 name: "product_sepolicy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +0900853 srcs: plat_public_policy +
854 plat_private_policy +
855 system_ext_public_policy +
856 system_ext_private_policy +
857 product_public_policy +
858 product_private_policy,
Inseob Kima49e7242021-03-22 10:26:13 +0900859 installable: false,
860}
861
862se_policy_cil {
863 name: "product_sepolicy.cil",
864 src: ":product_sepolicy.conf",
865 product_specific: true,
866 filter_out: [":plat_sepolicy.cil", ":system_ext_sepolicy.cil"],
867 remove_line_marker: true,
868}
869
Inseob Kim039175b2021-03-25 15:37:34 +0900870// policy mapping files
871// auto-generate the mapping file for current platform policy, since it needs to
872// track platform policy development
873se_versioned_policy {
874 name: "plat_mapping_file",
875 base: ":plat_pub_policy.cil",
876 mapping: true,
877 version: "current",
878 relative_install_path: "mapping", // install to /system/etc/selinux/mapping
879}
880
881se_versioned_policy {
882 name: "system_ext_mapping_file",
883 base: ":system_ext_pub_policy.cil",
884 mapping: true,
885 version: "current",
886 filter_out: [":plat_mapping_file"],
887 relative_install_path: "mapping", // install to /system_ext/etc/selinux/mapping
888 system_ext_specific: true,
889}
890
891se_versioned_policy {
892 name: "product_mapping_file",
893 base: ":pub_policy.cil",
894 mapping: true,
895 version: "current",
896 filter_out: [":plat_mapping_file", ":system_ext_mapping_file"],
897 relative_install_path: "mapping", // install to /product/etc/selinux/mapping
898 product_specific: true,
899}
900
901// plat_pub_versioned.cil - the exported platform policy associated with the version
902// that non-platform policy targets.
903se_versioned_policy {
904 name: "plat_pub_versioned.cil",
905 base: ":pub_policy.cil",
906 target_policy: ":pub_policy.cil",
907 version: "current",
908 dependent_cils: [
909 ":plat_sepolicy.cil",
910 ":system_ext_sepolicy.cil",
911 ":product_sepolicy.cil",
912 ":plat_mapping_file",
913 ":system_ext_mapping_file",
914 ":product_mapping_file",
915 ],
916 vendor: true,
917}
918
919//////////////////////////////////
920// Precompiled sepolicy is loaded if and only if:
921// - plat_sepolicy_and_mapping.sha256 equals
922// precompiled_sepolicy.plat_sepolicy_and_mapping.sha256
923// AND
924// - system_ext_sepolicy_and_mapping.sha256 equals
925// precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256
926// AND
927// - product_sepolicy_and_mapping.sha256 equals
928// precompiled_sepolicy.product_sepolicy_and_mapping.sha256
929// See system/core/init/selinux.cpp for details.
930//////////////////////////////////
931genrule {
932 name: "plat_sepolicy_and_mapping.sha256_gen",
933 srcs: [":plat_sepolicy.cil", ":plat_mapping_file"],
934 out: ["plat_sepolicy_and_mapping.sha256"],
935 cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)",
936}
937
938prebuilt_etc {
939 name: "plat_sepolicy_and_mapping.sha256",
940 filename: "plat_sepolicy_and_mapping.sha256",
941 src: ":plat_sepolicy_and_mapping.sha256_gen",
942 relative_install_path: "selinux",
943}
944
945genrule {
946 name: "system_ext_sepolicy_and_mapping.sha256_gen",
947 srcs: [":system_ext_sepolicy.cil", ":system_ext_mapping_file"],
948 out: ["system_ext_sepolicy_and_mapping.sha256"],
949 cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)",
950}
951
952prebuilt_etc {
953 name: "system_ext_sepolicy_and_mapping.sha256",
954 filename: "system_ext_sepolicy_and_mapping.sha256",
955 src: ":system_ext_sepolicy_and_mapping.sha256_gen",
956 relative_install_path: "selinux",
957 system_ext_specific: true,
958}
959
960genrule {
961 name: "product_sepolicy_and_mapping.sha256_gen",
962 srcs: [":product_sepolicy.cil", ":product_mapping_file"],
963 out: ["product_sepolicy_and_mapping.sha256"],
964 cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)",
965}
966
967prebuilt_etc {
968 name: "product_sepolicy_and_mapping.sha256",
969 filename: "product_sepolicy_and_mapping.sha256",
970 src: ":product_sepolicy_and_mapping.sha256_gen",
971 relative_install_path: "selinux",
972 product_specific: true,
973}
974
Inseob Kim1c056b12021-04-30 00:11:43 +0900975sepolicy_vers {
976 name: "plat_sepolicy_vers.txt",
977 version: "vendor",
978 vendor: true,
979}
980
Inseob Kim731182a2021-05-06 11:44:37 +0000981soong_config_module_type {
982 name: "precompiled_sepolicy_defaults",
983 module_type: "prebuilt_defaults",
984 config_namespace: "ANDROID",
985 bool_variables: ["BOARD_USES_ODMIMAGE"],
986 properties: ["vendor", "device_specific"],
987}
988
989precompiled_sepolicy_defaults {
990 name: "precompiled_sepolicy",
991 soong_config_variables: {
992 BOARD_USES_ODMIMAGE: {
993 device_specific: true,
994 conditions_default: {
995 vendor: true,
996 },
997 },
998 },
999}
1000
1001//////////////////////////////////
1002// SHA-256 digest of the plat_sepolicy.cil and plat_mapping_file against
1003// which precompiled_policy was built.
1004//////////////////////////////////
1005prebuilt_etc {
1006 defaults: ["precompiled_sepolicy"],
1007 name: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256",
1008 filename: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256",
1009 src: ":plat_sepolicy_and_mapping.sha256_gen",
1010 relative_install_path: "selinux",
1011}
1012
1013//////////////////////////////////
1014// SHA-256 digest of the system_ext_sepolicy.cil and system_ext_mapping_file against
1015// which precompiled_policy was built.
1016//////////////////////////////////
1017prebuilt_etc {
1018 defaults: ["precompiled_sepolicy"],
1019 name: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256",
1020 filename: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256",
1021 src: ":system_ext_sepolicy_and_mapping.sha256_gen",
1022 relative_install_path: "selinux",
1023}
1024
1025//////////////////////////////////
1026// SHA-256 digest of the product_sepolicy.cil and product_mapping_file against
1027// which precompiled_policy was built.
1028//////////////////////////////////
1029prebuilt_etc {
1030 defaults: ["precompiled_sepolicy"],
1031 name: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256",
1032 filename: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256",
1033 src: ":product_sepolicy_and_mapping.sha256_gen",
1034 relative_install_path: "selinux",
1035}
1036
1037
Inseob Kima49e7242021-03-22 10:26:13 +09001038//////////////////////////////////
1039// SELinux policy embedded into CTS.
1040// CTS checks neverallow rules of this policy against the policy of the device under test.
1041//////////////////////////////////
1042se_policy_conf {
1043 name: "general_sepolicy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +09001044 srcs: plat_public_policy +
1045 plat_private_policy,
Inseob Kima49e7242021-03-22 10:26:13 +09001046 build_variant: "user",
1047 cts: true,
1048 exclude_build_test: true,
1049}
Inseob Kimd5816612021-09-15 03:01:05 +00001050
1051//////////////////////////////////
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001052// Base system policy for treble sepolicy tests.
1053// If system sepolicy is extended (e.g. by SoC vendors), their plat_pub_versioned.cil may differ
1054// with system/sepolicy/prebuilts/api/{version}/plat_pub_versioned.cil. In that case,
1055// BOARD_PLAT_PUB_VERSIONED_POLICY can be used to specify extended plat_pub_versioned.cil.
1056// See treble_sepolicy_tests_for_release.mk for more details.
1057//////////////////////////////////
1058se_policy_conf {
1059 name: "base_plat_sepolicy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +09001060 srcs: plat_public_policy +
1061 plat_private_policy,
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001062 build_variant: "user",
1063 installable: false,
1064}
1065
1066se_policy_cil {
1067 name: "base_plat_sepolicy.cil",
1068 src: ":base_plat_sepolicy.conf",
1069 additional_cil_files: ["private/technical_debt.cil"],
1070 installable: false,
1071 secilc_check: false, // done by se_policy_binary
1072}
1073
1074se_policy_binary {
1075 name: "base_plat_sepolicy",
1076 srcs: [":base_plat_sepolicy.cil"],
1077 installable: false,
1078}
1079
1080se_policy_conf {
1081 name: "base_system_ext_sepolicy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +09001082 srcs: plat_public_policy +
1083 plat_private_policy +
1084 system_ext_public_policy +
1085 system_ext_private_policy,
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001086 build_variant: "user",
1087 installable: false,
1088}
1089
1090se_policy_cil {
1091 name: "base_system_ext_sepolicy.cil",
1092 src: ":base_system_ext_sepolicy.conf",
1093 additional_cil_files: ["private/technical_debt.cil"],
1094 system_ext_specific: true,
1095 installable: false,
1096 secilc_check: false, // done by se_policy_binary
1097}
1098
1099se_policy_binary {
1100 name: "base_system_ext_sepolicy",
1101 srcs: [":base_system_ext_sepolicy.cil"],
1102 system_ext_specific: true,
1103 installable: false,
1104}
1105
1106se_policy_conf {
1107 name: "base_product_sepolicy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +09001108 srcs: plat_public_policy +
1109 plat_private_policy +
1110 system_ext_public_policy +
1111 system_ext_private_policy +
1112 product_public_policy +
1113 product_private_policy,
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001114 build_variant: "user",
1115 installable: false,
1116}
1117
1118se_policy_cil {
1119 name: "base_product_sepolicy.cil",
1120 src: ":base_product_sepolicy.conf",
1121 additional_cil_files: ["private/technical_debt.cil"],
1122 product_specific: true,
1123 installable: false,
1124 secilc_check: false, // done by se_policy_binary
1125}
1126
1127se_policy_binary {
1128 name: "base_product_sepolicy",
1129 srcs: [":base_product_sepolicy.cil"],
1130 product_specific: true,
1131 installable: false,
1132}
1133
1134se_policy_conf {
1135 name: "base_plat_pub_policy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +09001136 srcs: plat_public_policy +
1137 reqd_mask_policy,
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001138 build_variant: "user",
1139 installable: false,
1140}
1141
1142se_policy_cil {
1143 name: "base_plat_pub_policy.cil",
1144 src: ":base_plat_pub_policy.conf",
1145 filter_out: [":reqd_policy_mask.cil"],
1146 secilc_check: false,
1147 installable: false,
1148}
1149
1150se_policy_conf {
1151 name: "base_system_ext_pub_policy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +09001152 srcs: plat_public_policy +
1153 system_ext_public_policy +
1154 reqd_mask_policy,
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001155 build_variant: "user",
1156 installable: false,
1157}
1158
1159se_policy_cil {
1160 name: "base_system_ext_pub_policy.cil",
1161 src: ":base_system_ext_pub_policy.conf",
1162 filter_out: [":reqd_policy_mask.cil"],
1163 secilc_check: false,
1164 installable: false,
1165}
1166
1167se_policy_conf {
1168 name: "base_product_pub_policy.conf",
Inseob Kim0a707fa2021-12-09 23:35:11 +09001169 srcs: plat_public_policy +
1170 system_ext_public_policy +
1171 product_public_policy +
1172 reqd_mask_policy,
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001173 build_variant: "user",
1174 installable: false,
1175}
1176
1177se_policy_cil {
1178 name: "base_product_pub_policy.cil",
1179 src: ":base_product_pub_policy.conf",
1180 filter_out: [":reqd_policy_mask.cil"],
1181 secilc_check: false,
1182 installable: false,
1183}
1184
Yi-Yo Chiang2c189652021-11-08 19:30:04 +08001185// bug_map - Bug tracking information for selinux denials loaded by auditd.
1186se_filegroup {
1187 name: "bug_map_files",
1188 srcs: ["bug_map"],
1189}
1190
1191se_bug_map {
1192 name: "plat_bug_map",
1193 srcs: [":bug_map_files"],
1194 stem: "bug_map",
1195}
1196
1197se_bug_map {
1198 name: "system_ext_bug_map",
1199 srcs: [":bug_map_files"],
1200 stem: "bug_map",
1201 system_ext_specific: true,
1202}
1203
1204se_bug_map {
1205 name: "vendor_bug_map",
1206 srcs: [":bug_map_files"],
1207 // Legacy file name of the vendor partition bug_map.
1208 stem: "selinux_denial_metadata",
1209 vendor: true,
1210}
1211
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001212//////////////////////////////////
Inseob Kimd5816612021-09-15 03:01:05 +00001213// se_freeze_test compares the plat sepolicy with the prebuilt sepolicy
1214// Additional directories can be specified via Makefile variables:
1215// SEPOLICY_FREEZE_TEST_EXTRA_DIRS and SEPOLICY_FREEZE_TEST_EXTRA_PREBUILT_DIRS.
1216//////////////////////////////////
1217se_freeze_test {
1218 name: "sepolicy_freeze_test",
1219}
Yuntao Xu42e732c2021-11-18 22:33:02 +00001220
1221//////////////////////////////////
1222// Makefile rules temporary imported to Soong
1223// TODO(b/33691272): remove these after migrating seapp to Soong
1224//////////////////////////////////
1225makefile_goal {
1226 name: "plat_seapp_contexts_rule",
1227 product_out_path: "obj/ETC/plat_seapp_contexts_intermediates/plat_seapp_contexts",
1228}
1229
1230makefile_goal {
1231 name: "plat_seapp_neverallows_rule",
1232 product_out_path: "obj/ETC/plat_seapp_neverallows_intermediates/plat_seapp_neverallows",
1233}