blob: a3538310383cbb8c2f19994e5aff97318b618943 [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 {
48 name: "26.0.board.compat.map",
49 srcs: [
50 "compat/26.0/26.0.cil",
51 ],
52}
53
54se_filegroup {
55 name: "27.0.board.compat.map",
56 srcs: [
57 "compat/27.0/27.0.cil",
58 ],
59}
60
Jae Shin1fa96342018-07-11 18:30:44 +090061se_filegroup {
62 name: "28.0.board.compat.map",
63 srcs: [
64 "compat/28.0/28.0.cil",
65 ],
66}
67
Jinguang Donge0125692019-03-05 17:20:54 +080068se_filegroup {
Tri Vo50aa0292019-06-01 17:04:13 -070069 name: "29.0.board.compat.map",
70 srcs: [
71 "compat/29.0/29.0.cil",
72 ],
73}
74
75se_filegroup {
Inseob Kimace36ab2020-05-07 20:19:05 +090076 name: "30.0.board.compat.map",
77 srcs: [
78 "compat/30.0/30.0.cil",
79 ],
80}
81
82se_filegroup {
Inseob Kim4f20ff72021-06-15 21:05:39 +090083 name: "31.0.board.compat.map",
84 srcs: [
85 "compat/31.0/31.0.cil",
86 ],
87}
88
89se_filegroup {
Yi-Yo Chiang8be93c02021-04-13 02:49:29 +080090 name: "26.0.board.compat.cil",
91 srcs: [
92 "compat/26.0/26.0.compat.cil",
93 ],
94}
95
96se_filegroup {
97 name: "27.0.board.compat.cil",
98 srcs: [
99 "compat/27.0/27.0.compat.cil",
100 ],
101}
102
103se_filegroup {
104 name: "28.0.board.compat.cil",
105 srcs: [
106 "compat/28.0/28.0.compat.cil",
107 ],
108}
109
110se_filegroup {
111 name: "29.0.board.compat.cil",
112 srcs: [
113 "compat/29.0/29.0.compat.cil",
114 ],
115}
116
117se_filegroup {
118 name: "30.0.board.compat.cil",
119 srcs: [
120 "compat/30.0/30.0.compat.cil",
121 ],
122}
123
124se_filegroup {
Inseob Kim4f20ff72021-06-15 21:05:39 +0900125 name: "31.0.board.compat.cil",
126 srcs: [
127 "compat/31.0/31.0.compat.cil",
128 ],
129}
130
131se_filegroup {
Jinguang Donge0125692019-03-05 17:20:54 +0800132 name: "26.0.board.ignore.map",
133 srcs: [
134 "compat/26.0/26.0.ignore.cil",
135 ],
136}
137
138se_filegroup {
139 name: "27.0.board.ignore.map",
140 srcs: [
141 "compat/27.0/27.0.ignore.cil",
142 ],
143}
144
145se_filegroup {
146 name: "28.0.board.ignore.map",
147 srcs: [
148 "compat/28.0/28.0.ignore.cil",
149 ],
150}
151
Tri Vo50aa0292019-06-01 17:04:13 -0700152se_filegroup {
153 name: "29.0.board.ignore.map",
154 srcs: [
155 "compat/29.0/29.0.ignore.cil",
156 ],
157}
158
Inseob Kimace36ab2020-05-07 20:19:05 +0900159se_filegroup {
160 name: "30.0.board.ignore.map",
161 srcs: [
162 "compat/30.0/30.0.ignore.cil",
163 ],
164}
165
Inseob Kim4f20ff72021-06-15 21:05:39 +0900166se_filegroup {
167 name: "31.0.board.ignore.map",
168 srcs: [
169 "compat/31.0/31.0.ignore.cil",
170 ],
171}
172
Tri Voa5cfd3e2018-03-22 11:35:02 -0700173se_cil_compat_map {
Tri Vo61178552019-10-10 16:29:40 -0700174 name: "plat_26.0.cil",
175 stem: "26.0.cil",
Tri Vo438684b2018-09-29 17:47:10 -0700176 bottom_half: [":26.0.board.compat.map"],
Tri Vo61178552019-10-10 16:29:40 -0700177 top_half: "plat_27.0.cil",
Tri Voa5cfd3e2018-03-22 11:35:02 -0700178}
179
180se_cil_compat_map {
Tri Vo61178552019-10-10 16:29:40 -0700181 name: "plat_27.0.cil",
182 stem: "27.0.cil",
Tri Vo438684b2018-09-29 17:47:10 -0700183 bottom_half: [":27.0.board.compat.map"],
Tri Vo61178552019-10-10 16:29:40 -0700184 top_half: "plat_28.0.cil",
Tri Voa5cfd3e2018-03-22 11:35:02 -0700185}
Jae Shin1fa96342018-07-11 18:30:44 +0900186
187se_cil_compat_map {
Tri Vo61178552019-10-10 16:29:40 -0700188 name: "plat_28.0.cil",
189 stem: "28.0.cil",
Tri Vo438684b2018-09-29 17:47:10 -0700190 bottom_half: [":28.0.board.compat.map"],
Tri Vo61178552019-10-10 16:29:40 -0700191 top_half: "plat_29.0.cil",
Tri Vo50aa0292019-06-01 17:04:13 -0700192}
193
194se_cil_compat_map {
Tri Vo61178552019-10-10 16:29:40 -0700195 name: "plat_29.0.cil",
196 stem: "29.0.cil",
Tri Vo50aa0292019-06-01 17:04:13 -0700197 bottom_half: [":29.0.board.compat.map"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900198 top_half: "plat_30.0.cil",
199}
200
201se_cil_compat_map {
202 name: "plat_30.0.cil",
203 stem: "30.0.cil",
204 bottom_half: [":30.0.board.compat.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900205 top_half: "plat_31.0.cil",
206}
207
208se_cil_compat_map {
209 name: "plat_31.0.cil",
210 stem: "31.0.cil",
211 bottom_half: [":31.0.board.compat.map"],
212 // top_half: "plat_32.0.cil",
Tri Vo61178552019-10-10 16:29:40 -0700213}
214
215se_cil_compat_map {
216 name: "system_ext_26.0.cil",
217 stem: "26.0.cil",
218 bottom_half: [":26.0.board.compat.map"],
219 top_half: "system_ext_27.0.cil",
220 system_ext_specific: true,
221}
222
223se_cil_compat_map {
224 name: "system_ext_27.0.cil",
225 stem: "27.0.cil",
226 bottom_half: [":27.0.board.compat.map"],
227 top_half: "system_ext_28.0.cil",
228 system_ext_specific: true,
229}
230
231se_cil_compat_map {
232 name: "system_ext_28.0.cil",
233 stem: "28.0.cil",
234 bottom_half: [":28.0.board.compat.map"],
235 top_half: "system_ext_29.0.cil",
236 system_ext_specific: true,
237}
238
239se_cil_compat_map {
240 name: "system_ext_29.0.cil",
241 stem: "29.0.cil",
242 bottom_half: [":29.0.board.compat.map"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900243 top_half: "system_ext_30.0.cil",
244 system_ext_specific: true,
245}
246
247se_cil_compat_map {
248 name: "system_ext_30.0.cil",
249 stem: "30.0.cil",
250 bottom_half: [":30.0.board.compat.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900251 top_half: "system_ext_31.0.cil",
252 system_ext_specific: true,
253}
254
255se_cil_compat_map {
256 name: "system_ext_31.0.cil",
257 stem: "31.0.cil",
258 bottom_half: [":31.0.board.compat.map"],
259 // top_half: "system_ext_32.0.cil",
Tri Vo61178552019-10-10 16:29:40 -0700260 system_ext_specific: true,
261}
262
263se_cil_compat_map {
264 name: "product_26.0.cil",
265 stem: "26.0.cil",
266 bottom_half: [":26.0.board.compat.map"],
267 top_half: "product_27.0.cil",
268 product_specific: true,
269}
270
271se_cil_compat_map {
272 name: "product_27.0.cil",
273 stem: "27.0.cil",
274 bottom_half: [":27.0.board.compat.map"],
275 top_half: "product_28.0.cil",
276 product_specific: true,
277}
278
279se_cil_compat_map {
280 name: "product_28.0.cil",
281 stem: "28.0.cil",
282 bottom_half: [":28.0.board.compat.map"],
283 top_half: "product_29.0.cil",
284 product_specific: true,
285}
286
287se_cil_compat_map {
288 name: "product_29.0.cil",
289 stem: "29.0.cil",
290 bottom_half: [":29.0.board.compat.map"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900291 top_half: "product_30.0.cil",
292 product_specific: true,
293}
294
295se_cil_compat_map {
296 name: "product_30.0.cil",
297 stem: "30.0.cil",
298 bottom_half: [":30.0.board.compat.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900299 top_half: "product_31.0.cil",
300 product_specific: true,
301}
302
303se_cil_compat_map {
304 name: "product_31.0.cil",
305 stem: "31.0.cil",
306 bottom_half: [":31.0.board.compat.map"],
307 // top_half: "product_32.0.cil",
Tri Vo61178552019-10-10 16:29:40 -0700308 product_specific: true,
Tri Vo438684b2018-09-29 17:47:10 -0700309}
310
311se_cil_compat_map {
312 name: "26.0.ignore.cil",
Jinguang Donge0125692019-03-05 17:20:54 +0800313 bottom_half: [":26.0.board.ignore.map"],
Tri Vo438684b2018-09-29 17:47:10 -0700314 top_half: "27.0.ignore.cil",
315}
316
317se_cil_compat_map {
318 name: "27.0.ignore.cil",
Jinguang Donge0125692019-03-05 17:20:54 +0800319 bottom_half: [":27.0.board.ignore.map"],
Tri Vo438684b2018-09-29 17:47:10 -0700320 top_half: "28.0.ignore.cil",
321}
322
323se_cil_compat_map {
324 name: "28.0.ignore.cil",
Jinguang Donge0125692019-03-05 17:20:54 +0800325 bottom_half: [":28.0.board.ignore.map"],
Tri Voe381deb2019-06-12 15:52:30 -0700326 top_half: "29.0.ignore.cil",
Jae Shin1fa96342018-07-11 18:30:44 +0900327}
Inseob Kimb554e592019-04-15 20:10:46 +0900328
Tri Vo50aa0292019-06-01 17:04:13 -0700329se_cil_compat_map {
330 name: "29.0.ignore.cil",
331 bottom_half: [":29.0.board.ignore.map"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900332 top_half: "30.0.ignore.cil",
333}
334
335se_cil_compat_map {
336 name: "30.0.ignore.cil",
337 bottom_half: [":30.0.board.ignore.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900338 top_half: "31.0.ignore.cil",
339}
340
341se_cil_compat_map {
342 name: "31.0.ignore.cil",
343 bottom_half: [":31.0.board.ignore.map"],
344 // top_half: "32.0.ignore.cil",
Tri Vo50aa0292019-06-01 17:04:13 -0700345}
346
P.Adarsh Reddy07dd59f2021-03-22 15:55:09 +0530347se_cil_compat_map {
348 name: "system_ext_30.0.ignore.cil",
349 bottom_half: [":30.0.board.ignore.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900350 top_half: "system_ext_31.0.ignore.cil",
351 system_ext_specific: true,
352}
353
354se_cil_compat_map {
355 name: "system_ext_31.0.ignore.cil",
356 bottom_half: [":31.0.board.ignore.map"],
357 // top_half: "system_ext_32.0.ignore.cil",
P.Adarsh Reddy07dd59f2021-03-22 15:55:09 +0530358 system_ext_specific: true,
359}
360
361se_cil_compat_map {
362 name: "product_30.0.ignore.cil",
363 bottom_half: [":30.0.board.ignore.map"],
Inseob Kim4f20ff72021-06-15 21:05:39 +0900364 top_half: "product_31.0.ignore.cil",
365 product_specific: true,
366}
367
368se_cil_compat_map {
369 name: "product_31.0.ignore.cil",
370 bottom_half: [":31.0.board.ignore.map"],
371 // top_half: "product_32.0.ignore.cil",
P.Adarsh Reddy07dd59f2021-03-22 15:55:09 +0530372 product_specific: true,
373}
374
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800375se_compat_cil {
Tri Vo50aa0292019-06-01 17:04:13 -0700376 name: "26.0.compat.cil",
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800377 srcs: [":26.0.board.compat.cil"],
Jeff Vander Stoep564e2922019-05-02 13:48:44 -0700378}
379
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800380se_compat_cil {
Jeff Vander Stoep564e2922019-05-02 13:48:44 -0700381 name: "27.0.compat.cil",
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800382 srcs: [":27.0.board.compat.cil"],
Jeff Vander Stoep564e2922019-05-02 13:48:44 -0700383}
384
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800385se_compat_cil {
Tri Vo50aa0292019-06-01 17:04:13 -0700386 name: "28.0.compat.cil",
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800387 srcs: [":28.0.board.compat.cil"],
Tri Vo50aa0292019-06-01 17:04:13 -0700388}
389
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800390se_compat_cil {
Tri Vo50aa0292019-06-01 17:04:13 -0700391 name: "29.0.compat.cil",
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800392 srcs: [":29.0.board.compat.cil"],
Jeff Vander Stoep564e2922019-05-02 13:48:44 -0700393}
394
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800395se_compat_cil {
Inseob Kimace36ab2020-05-07 20:19:05 +0900396 name: "30.0.compat.cil",
Yi-Yo Chianga2251122021-04-13 02:51:48 +0800397 srcs: [":30.0.board.compat.cil"],
Inseob Kimace36ab2020-05-07 20:19:05 +0900398}
399
Yi-Yo Chiang8be93c02021-04-13 02:49:29 +0800400se_compat_cil {
Inseob Kim4f20ff72021-06-15 21:05:39 +0900401 name: "31.0.compat.cil",
402 srcs: [":31.0.board.compat.cil"],
403}
404
405se_compat_cil {
Yi-Yo Chiang8be93c02021-04-13 02:49:29 +0800406 name: "system_ext_26.0.compat.cil",
407 srcs: [":26.0.board.compat.cil"],
408 stem: "26.0.compat.cil",
409 system_ext_specific: true,
410}
411
412se_compat_cil {
413 name: "system_ext_27.0.compat.cil",
414 srcs: [":27.0.board.compat.cil"],
415 stem: "27.0.compat.cil",
416 system_ext_specific: true,
417}
418
419se_compat_cil {
420 name: "system_ext_28.0.compat.cil",
421 srcs: [":28.0.board.compat.cil"],
422 stem: "28.0.compat.cil",
423 system_ext_specific: true,
424}
425
426se_compat_cil {
427 name: "system_ext_29.0.compat.cil",
428 srcs: [":29.0.board.compat.cil"],
429 stem: "29.0.compat.cil",
430 system_ext_specific: true,
431}
432
433se_compat_cil {
434 name: "system_ext_30.0.compat.cil",
435 srcs: [":30.0.board.compat.cil"],
436 stem: "30.0.compat.cil",
437 system_ext_specific: true,
438}
439
Inseob Kim4f20ff72021-06-15 21:05:39 +0900440se_compat_cil {
441 name: "system_ext_31.0.compat.cil",
442 srcs: [":31.0.board.compat.cil"],
443 stem: "31.0.compat.cil",
444 system_ext_specific: true,
445}
446
Inseob Kimb554e592019-04-15 20:10:46 +0900447se_filegroup {
448 name: "file_contexts_files",
449 srcs: ["file_contexts"],
450}
451
452se_filegroup {
453 name: "file_contexts_asan_files",
454 srcs: ["file_contexts_asan"],
455}
456
457se_filegroup {
458 name: "file_contexts_overlayfs_files",
459 srcs: ["file_contexts_overlayfs"],
460}
461
462se_filegroup {
463 name: "hwservice_contexts_files",
464 srcs: ["hwservice_contexts"],
465}
466
467se_filegroup {
468 name: "property_contexts_files",
469 srcs: ["property_contexts"],
470}
471
472se_filegroup {
473 name: "service_contexts_files",
474 srcs: ["service_contexts"],
475}
476
Janis Danisevskisc40681f2020-07-25 13:02:29 -0700477se_filegroup {
478 name: "keystore2_key_contexts_files",
479 srcs: ["keystore2_key_contexts"],
480}
481
Inseob Kimb554e592019-04-15 20:10:46 +0900482file_contexts {
483 name: "plat_file_contexts",
484 srcs: [":file_contexts_files"],
485 product_variables: {
486 address_sanitize: {
487 srcs: [":file_contexts_asan_files"],
488 },
489 debuggable: {
490 srcs: [":file_contexts_overlayfs_files"],
491 },
492 },
493
494 flatten_apex: {
495 srcs: ["apex/*-file_contexts"],
496 },
Yuntao Xu42e732c2021-11-18 22:33:02 +0000497}
Inseob Kimb554e592019-04-15 20:10:46 +0900498
Yuntao Xu42e732c2021-11-18 22:33:02 +0000499file_contexts {
500 name: "plat_file_contexts.recovery",
501 srcs: [":file_contexts_files"],
502 stem: "plat_file_contexts",
503 product_variables: {
504 address_sanitize: {
505 srcs: [":file_contexts_asan_files"],
506 },
507 debuggable: {
508 srcs: [":file_contexts_overlayfs_files"],
509 },
510 },
511
512 flatten_apex: {
513 srcs: ["apex/*-file_contexts"],
514 },
515
516 recovery: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900517}
518
519file_contexts {
520 name: "vendor_file_contexts",
521 srcs: [":file_contexts_files"],
522 soc_specific: true,
523 recovery_available: true,
524}
525
526file_contexts {
Bowgo Tsai86a048d2019-09-09 22:04:06 +0800527 name: "system_ext_file_contexts",
528 srcs: [":file_contexts_files"],
529 system_ext_specific: true,
530 recovery_available: true,
531}
532
533file_contexts {
Inseob Kimb554e592019-04-15 20:10:46 +0900534 name: "product_file_contexts",
535 srcs: [":file_contexts_files"],
536 product_specific: true,
537 recovery_available: true,
538}
539
540file_contexts {
541 name: "odm_file_contexts",
542 srcs: [":file_contexts_files"],
543 device_specific: true,
544 recovery_available: true,
545}
546
547hwservice_contexts {
548 name: "plat_hwservice_contexts",
549 srcs: [":hwservice_contexts_files"],
550}
551
552hwservice_contexts {
Bowgo Tsai241d36e2019-09-09 22:05:10 +0800553 name: "system_ext_hwservice_contexts",
554 srcs: [":hwservice_contexts_files"],
555 system_ext_specific: true,
556}
557
558hwservice_contexts {
Inseob Kimb554e592019-04-15 20:10:46 +0900559 name: "product_hwservice_contexts",
560 srcs: [":hwservice_contexts_files"],
561 product_specific: true,
562}
563
564hwservice_contexts {
565 name: "vendor_hwservice_contexts",
566 srcs: [":hwservice_contexts_files"],
567 reqd_mask: true,
568 soc_specific: true,
569}
570
571hwservice_contexts {
572 name: "odm_hwservice_contexts",
573 srcs: [":hwservice_contexts_files"],
574 device_specific: true,
575}
576
577property_contexts {
578 name: "plat_property_contexts",
579 srcs: [":property_contexts_files"],
Yuntao Xu42e732c2021-11-18 22:33:02 +0000580}
581
582property_contexts {
583 name: "plat_property_contexts.recovery",
584 srcs: [":property_contexts_files"],
585 stem: "plat_property_contexts",
586 recovery: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900587}
588
589property_contexts {
Bowgo Tsai1864cd02019-09-09 18:09:22 +0800590 name: "system_ext_property_contexts",
591 srcs: [":property_contexts_files"],
592 system_ext_specific: true,
593 recovery_available: true,
594}
595
596property_contexts {
Inseob Kimb554e592019-04-15 20:10:46 +0900597 name: "product_property_contexts",
598 srcs: [":property_contexts_files"],
599 product_specific: true,
600 recovery_available: true,
601}
602
603property_contexts {
604 name: "vendor_property_contexts",
605 srcs: [":property_contexts_files"],
606 reqd_mask: true,
607 soc_specific: true,
608 recovery_available: true,
609}
610
611property_contexts {
612 name: "odm_property_contexts",
613 srcs: [":property_contexts_files"],
614 device_specific: true,
615 recovery_available: true,
616}
617
618service_contexts {
619 name: "plat_service_contexts",
620 srcs: [":service_contexts_files"],
Yuntao Xu42e732c2021-11-18 22:33:02 +0000621}
622
623service_contexts {
624 name: "plat_service_contexts.recovery",
625 srcs: [":service_contexts_files"],
626 stem: "plat_service_contexts",
627 recovery: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900628}
629
630service_contexts {
Bowgo Tsai98231162019-09-09 22:05:29 +0800631 name: "system_ext_service_contexts",
632 srcs: [":service_contexts_files"],
633 system_ext_specific: true,
Yifan Hongd6b29012021-11-13 00:22:01 -0800634 recovery_available: true,
Bowgo Tsai98231162019-09-09 22:05:29 +0800635}
636
637service_contexts {
Inseob Kimb554e592019-04-15 20:10:46 +0900638 name: "product_service_contexts",
639 srcs: [":service_contexts_files"],
640 product_specific: true,
Yifan Hongd6b29012021-11-13 00:22:01 -0800641 recovery_available: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900642}
643
644service_contexts {
645 name: "vendor_service_contexts",
646 srcs: [":service_contexts_files"],
647 reqd_mask: true,
648 soc_specific: true,
Yifan Hongd6b29012021-11-13 00:22:01 -0800649 recovery_available: true,
Inseob Kimb554e592019-04-15 20:10:46 +0900650}
yangbill3e345372020-04-15 13:55:47 +0800651
Janis Danisevskisc40681f2020-07-25 13:02:29 -0700652keystore2_key_contexts {
653 name: "plat_keystore2_key_contexts",
654 srcs: [":keystore2_key_contexts_files"],
655}
656
657keystore2_key_contexts {
658 name: "system_keystore2_key_contexts",
659 srcs: [":keystore2_key_contexts_files"],
660 system_ext_specific: true,
661}
662
663keystore2_key_contexts {
664 name: "product_keystore2_key_contexts",
665 srcs: [":keystore2_key_contexts_files"],
666 product_specific: true,
667}
668
669keystore2_key_contexts {
670 name: "vendor_keystore2_key_contexts",
671 srcs: [":keystore2_key_contexts_files"],
672 reqd_mask: true,
673 soc_specific: true,
674}
675
yangbill3e345372020-04-15 13:55:47 +0800676// For vts_treble_sys_prop_test
677filegroup {
678 name: "private_property_contexts",
679 srcs: ["private/property_contexts"],
680 visibility: [
681 "//test/vts-testcase/security/system_property",
682 ],
683}
Inseob Kime35b49b2021-02-18 19:15:41 +0900684
Inseob Kima49e7242021-03-22 10:26:13 +0900685se_build_files {
686 name: "se_build_files",
Inseob Kime35b49b2021-02-18 19:15:41 +0900687 srcs: [
Inseob Kima49e7242021-03-22 10:26:13 +0900688 "security_classes",
689 "initial_sids",
690 "access_vectors",
691 "global_macros",
692 "neverallow_macros",
693 "mls_macros",
694 "mls_decl",
695 "mls",
696 "policy_capabilities",
697 "te_macros",
698 "attributes",
699 "ioctl_defines",
700 "ioctl_macros",
701 "*.te",
702 "roles_decl",
703 "roles",
704 "users",
705 "initial_sid_contexts",
706 "fs_use",
707 "genfs_contexts",
708 "port_contexts",
Inseob Kime35b49b2021-02-18 19:15:41 +0900709 ],
710}
711
Inseob Kima49e7242021-03-22 10:26:13 +0900712// reqd_policy_mask - a policy.conf file which contains only the bare minimum
713// policy necessary to use checkpolicy.
714//
715// This bare-minimum policy needs to be present in all policy.conf files, but
716// should not necessarily be exported as part of the public policy.
717//
718// The rules generated by reqd_policy_mask will allow the compilation of public
719// policy and subsequent removal of CIL policy that should not be exported.
720se_policy_conf {
721 name: "reqd_policy_mask.conf",
722 srcs: [":se_build_files{.reqd_mask}"],
Inseob Kime35b49b2021-02-18 19:15:41 +0900723 installable: false,
724}
725
Inseob Kima49e7242021-03-22 10:26:13 +0900726se_policy_cil {
727 name: "reqd_policy_mask.cil",
728 src: ":reqd_policy_mask.conf",
729 secilc_check: false,
730 installable: false,
Inseob Kime35b49b2021-02-18 19:15:41 +0900731}
732
Inseob Kima49e7242021-03-22 10:26:13 +0900733// pub_policy - policy that will be exported to be a part of non-platform
734// policy corresponding to this platform version.
735//
736// This is a limited subset of policy that would not compile in checkpolicy on
737// its own.
738//
739// To get around this limitation, add only the required files from private
740// policy, which will generate CIL policy that will then be filtered out by the
741// reqd_policy_mask.
742//
743// There are three pub_policy.cil files below:
744// - pub_policy.cil: exported 'product', 'system_ext' and 'system' policy.
745// - system_ext_pub_policy.cil: exported 'system_ext' and 'system' policy.
746// - plat_pub_policy.cil: exported 'system' policy.
747//
748// Those above files will in turn be used to generate the following versioned cil files:
749// - product_mapping_file: the versioned, exported 'product' policy in product partition.
750// - system_ext_mapping_file: the versioned, exported 'system_ext' policy in system_ext partition.
751// - plat_mapping_file: the versioned, exported 'system' policy in system partition.
752// - plat_pub_versioned.cil: the versioned, exported 'product', 'system_ext' and 'system' policy
753// in vendor partition.
754//
755se_policy_conf {
756 name: "pub_policy.conf",
757 srcs: [":se_build_files{.product_public}"], // product_ includes system and system_ext
758 installable: false,
759}
760
761se_policy_cil {
762 name: "pub_policy.cil",
763 src: ":pub_policy.conf",
764 filter_out: [":reqd_policy_mask.cil"],
765 secilc_check: false,
766 installable: false,
767}
768
769se_policy_conf {
770 name: "system_ext_pub_policy.conf",
771 srcs: [":se_build_files{.system_ext_public}"], // system_ext_public includes system
772 installable: false,
773}
774
775se_policy_cil {
776 name: "system_ext_pub_policy.cil",
777 src: ":system_ext_pub_policy.conf",
778 filter_out: [":reqd_policy_mask.cil"],
779 secilc_check: false,
780 installable: false,
781}
782
783se_policy_conf {
784 name: "plat_pub_policy.conf",
785 srcs: [":se_build_files{.plat_public}"],
786 installable: false,
787}
788
789se_policy_cil {
790 name: "plat_pub_policy.cil",
791 src: ":plat_pub_policy.conf",
792 filter_out: [":reqd_policy_mask.cil"],
793 secilc_check: false,
794 installable: false,
795}
796
797// plat_policy.conf - A combination of the private and public platform policy
798// which will ship with the device.
799//
800// The platform will always reflect the most recent platform version and is not
801// currently being attributized.
802se_policy_conf {
803 name: "plat_sepolicy.conf",
804 srcs: [":se_build_files{.plat}"],
805 installable: false,
806}
807
808se_policy_cil {
809 name: "plat_sepolicy.cil",
810 src: ":plat_sepolicy.conf",
811 additional_cil_files: ["private/technical_debt.cil"],
812}
813
Inseob Kim6cc75f42021-04-29 13:53:20 +0000814// userdebug_plat_policy.conf - the userdebug version plat_sepolicy.cil
815se_policy_conf {
816 name: "userdebug_plat_sepolicy.conf",
817 srcs: [":se_build_files{.plat}"],
818 build_variant: "userdebug",
819 installable: false,
820}
821
822se_policy_cil {
823 name: "userdebug_plat_sepolicy.cil",
824 src: ":userdebug_plat_sepolicy.conf",
825 additional_cil_files: ["private/technical_debt.cil"],
826 debug_ramdisk: true,
Yi-Yo Chiang68478b12021-10-16 03:23:05 +0800827 dist: {
828 targets: ["droidcore"],
829 },
Inseob Kim6cc75f42021-04-29 13:53:20 +0000830}
831
Yi-Yo Chiang857ffc42021-09-23 14:14:16 +0000832// A copy of the userdebug_plat_policy in GSI.
833soong_config_module_type {
834 name: "gsi_se_policy_cil",
835 module_type: "se_policy_cil",
836 config_namespace: "ANDROID",
837 bool_variables: [
838 "PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT",
839 ],
840 properties: [
841 "enabled",
842 "installable",
843 ],
844}
845
846gsi_se_policy_cil {
847 name: "system_ext_userdebug_plat_sepolicy.cil",
848 stem: "userdebug_plat_sepolicy.cil",
849 src: ":userdebug_plat_sepolicy.conf",
850 additional_cil_files: ["private/technical_debt.cil"],
851 system_ext_specific: true,
852 enabled: false,
853 installable: false,
854 soong_config_variables: {
855 PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT: {
856 enabled: true,
857 installable: true,
858 },
859 },
860}
861
Inseob Kima49e7242021-03-22 10:26:13 +0900862// system_ext_policy.conf - A combination of the private and public system_ext
863// policy which will ship with the device. System_ext policy is not attributized
864se_policy_conf {
865 name: "system_ext_sepolicy.conf",
866 srcs: [":se_build_files{.system_ext}"],
867 installable: false,
868}
869
870se_policy_cil {
871 name: "system_ext_sepolicy.cil",
872 src: ":system_ext_sepolicy.conf",
873 system_ext_specific: true,
874 filter_out: [":plat_sepolicy.cil"],
875 remove_line_marker: true,
876}
877
878// product_policy.conf - A combination of the private and public product policy
879// which will ship with the device. Product policy is not attributized
880se_policy_conf {
881 name: "product_sepolicy.conf",
882 srcs: [":se_build_files{.product}"],
883 installable: false,
884}
885
886se_policy_cil {
887 name: "product_sepolicy.cil",
888 src: ":product_sepolicy.conf",
889 product_specific: true,
890 filter_out: [":plat_sepolicy.cil", ":system_ext_sepolicy.cil"],
891 remove_line_marker: true,
892}
893
Inseob Kim039175b2021-03-25 15:37:34 +0900894// policy mapping files
895// auto-generate the mapping file for current platform policy, since it needs to
896// track platform policy development
897se_versioned_policy {
898 name: "plat_mapping_file",
899 base: ":plat_pub_policy.cil",
900 mapping: true,
901 version: "current",
902 relative_install_path: "mapping", // install to /system/etc/selinux/mapping
903}
904
905se_versioned_policy {
906 name: "system_ext_mapping_file",
907 base: ":system_ext_pub_policy.cil",
908 mapping: true,
909 version: "current",
910 filter_out: [":plat_mapping_file"],
911 relative_install_path: "mapping", // install to /system_ext/etc/selinux/mapping
912 system_ext_specific: true,
913}
914
915se_versioned_policy {
916 name: "product_mapping_file",
917 base: ":pub_policy.cil",
918 mapping: true,
919 version: "current",
920 filter_out: [":plat_mapping_file", ":system_ext_mapping_file"],
921 relative_install_path: "mapping", // install to /product/etc/selinux/mapping
922 product_specific: true,
923}
924
925// plat_pub_versioned.cil - the exported platform policy associated with the version
926// that non-platform policy targets.
927se_versioned_policy {
928 name: "plat_pub_versioned.cil",
929 base: ":pub_policy.cil",
930 target_policy: ":pub_policy.cil",
931 version: "current",
932 dependent_cils: [
933 ":plat_sepolicy.cil",
934 ":system_ext_sepolicy.cil",
935 ":product_sepolicy.cil",
936 ":plat_mapping_file",
937 ":system_ext_mapping_file",
938 ":product_mapping_file",
939 ],
940 vendor: true,
941}
942
943//////////////////////////////////
944// Precompiled sepolicy is loaded if and only if:
945// - plat_sepolicy_and_mapping.sha256 equals
946// precompiled_sepolicy.plat_sepolicy_and_mapping.sha256
947// AND
948// - system_ext_sepolicy_and_mapping.sha256 equals
949// precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256
950// AND
951// - product_sepolicy_and_mapping.sha256 equals
952// precompiled_sepolicy.product_sepolicy_and_mapping.sha256
953// See system/core/init/selinux.cpp for details.
954//////////////////////////////////
955genrule {
956 name: "plat_sepolicy_and_mapping.sha256_gen",
957 srcs: [":plat_sepolicy.cil", ":plat_mapping_file"],
958 out: ["plat_sepolicy_and_mapping.sha256"],
959 cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)",
960}
961
962prebuilt_etc {
963 name: "plat_sepolicy_and_mapping.sha256",
964 filename: "plat_sepolicy_and_mapping.sha256",
965 src: ":plat_sepolicy_and_mapping.sha256_gen",
966 relative_install_path: "selinux",
967}
968
969genrule {
970 name: "system_ext_sepolicy_and_mapping.sha256_gen",
971 srcs: [":system_ext_sepolicy.cil", ":system_ext_mapping_file"],
972 out: ["system_ext_sepolicy_and_mapping.sha256"],
973 cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)",
974}
975
976prebuilt_etc {
977 name: "system_ext_sepolicy_and_mapping.sha256",
978 filename: "system_ext_sepolicy_and_mapping.sha256",
979 src: ":system_ext_sepolicy_and_mapping.sha256_gen",
980 relative_install_path: "selinux",
981 system_ext_specific: true,
982}
983
984genrule {
985 name: "product_sepolicy_and_mapping.sha256_gen",
986 srcs: [":product_sepolicy.cil", ":product_mapping_file"],
987 out: ["product_sepolicy_and_mapping.sha256"],
988 cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)",
989}
990
991prebuilt_etc {
992 name: "product_sepolicy_and_mapping.sha256",
993 filename: "product_sepolicy_and_mapping.sha256",
994 src: ":product_sepolicy_and_mapping.sha256_gen",
995 relative_install_path: "selinux",
996 product_specific: true,
997}
998
Inseob Kim1c056b12021-04-30 00:11:43 +0900999sepolicy_vers {
1000 name: "plat_sepolicy_vers.txt",
1001 version: "vendor",
1002 vendor: true,
1003}
1004
Inseob Kim731182a2021-05-06 11:44:37 +00001005soong_config_module_type {
1006 name: "precompiled_sepolicy_defaults",
1007 module_type: "prebuilt_defaults",
1008 config_namespace: "ANDROID",
1009 bool_variables: ["BOARD_USES_ODMIMAGE"],
1010 properties: ["vendor", "device_specific"],
1011}
1012
1013precompiled_sepolicy_defaults {
1014 name: "precompiled_sepolicy",
1015 soong_config_variables: {
1016 BOARD_USES_ODMIMAGE: {
1017 device_specific: true,
1018 conditions_default: {
1019 vendor: true,
1020 },
1021 },
1022 },
1023}
1024
1025//////////////////////////////////
1026// SHA-256 digest of the plat_sepolicy.cil and plat_mapping_file against
1027// which precompiled_policy was built.
1028//////////////////////////////////
1029prebuilt_etc {
1030 defaults: ["precompiled_sepolicy"],
1031 name: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256",
1032 filename: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256",
1033 src: ":plat_sepolicy_and_mapping.sha256_gen",
1034 relative_install_path: "selinux",
1035}
1036
1037//////////////////////////////////
1038// SHA-256 digest of the system_ext_sepolicy.cil and system_ext_mapping_file against
1039// which precompiled_policy was built.
1040//////////////////////////////////
1041prebuilt_etc {
1042 defaults: ["precompiled_sepolicy"],
1043 name: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256",
1044 filename: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256",
1045 src: ":system_ext_sepolicy_and_mapping.sha256_gen",
1046 relative_install_path: "selinux",
1047}
1048
1049//////////////////////////////////
1050// SHA-256 digest of the product_sepolicy.cil and product_mapping_file against
1051// which precompiled_policy was built.
1052//////////////////////////////////
1053prebuilt_etc {
1054 defaults: ["precompiled_sepolicy"],
1055 name: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256",
1056 filename: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256",
1057 src: ":product_sepolicy_and_mapping.sha256_gen",
1058 relative_install_path: "selinux",
1059}
1060
1061
Inseob Kima49e7242021-03-22 10:26:13 +09001062//////////////////////////////////
1063// SELinux policy embedded into CTS.
1064// CTS checks neverallow rules of this policy against the policy of the device under test.
1065//////////////////////////////////
1066se_policy_conf {
1067 name: "general_sepolicy.conf",
1068 srcs: [":se_build_files{.plat}"],
1069 build_variant: "user",
1070 cts: true,
1071 exclude_build_test: true,
1072}
Inseob Kimd5816612021-09-15 03:01:05 +00001073
1074//////////////////////////////////
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001075// Base system policy for treble sepolicy tests.
1076// If system sepolicy is extended (e.g. by SoC vendors), their plat_pub_versioned.cil may differ
1077// with system/sepolicy/prebuilts/api/{version}/plat_pub_versioned.cil. In that case,
1078// BOARD_PLAT_PUB_VERSIONED_POLICY can be used to specify extended plat_pub_versioned.cil.
1079// See treble_sepolicy_tests_for_release.mk for more details.
1080//////////////////////////////////
1081se_policy_conf {
1082 name: "base_plat_sepolicy.conf",
1083 srcs: [":se_build_files{.plat}"],
1084 build_variant: "user",
1085 installable: false,
1086}
1087
1088se_policy_cil {
1089 name: "base_plat_sepolicy.cil",
1090 src: ":base_plat_sepolicy.conf",
1091 additional_cil_files: ["private/technical_debt.cil"],
1092 installable: false,
1093 secilc_check: false, // done by se_policy_binary
1094}
1095
1096se_policy_binary {
1097 name: "base_plat_sepolicy",
1098 srcs: [":base_plat_sepolicy.cil"],
1099 installable: false,
1100}
1101
1102se_policy_conf {
1103 name: "base_system_ext_sepolicy.conf",
1104 srcs: [":se_build_files{.system_ext}"],
1105 build_variant: "user",
1106 installable: false,
1107}
1108
1109se_policy_cil {
1110 name: "base_system_ext_sepolicy.cil",
1111 src: ":base_system_ext_sepolicy.conf",
1112 additional_cil_files: ["private/technical_debt.cil"],
1113 system_ext_specific: true,
1114 installable: false,
1115 secilc_check: false, // done by se_policy_binary
1116}
1117
1118se_policy_binary {
1119 name: "base_system_ext_sepolicy",
1120 srcs: [":base_system_ext_sepolicy.cil"],
1121 system_ext_specific: true,
1122 installable: false,
1123}
1124
1125se_policy_conf {
1126 name: "base_product_sepolicy.conf",
1127 srcs: [":se_build_files{.product}"],
1128 build_variant: "user",
1129 installable: false,
1130}
1131
1132se_policy_cil {
1133 name: "base_product_sepolicy.cil",
1134 src: ":base_product_sepolicy.conf",
1135 additional_cil_files: ["private/technical_debt.cil"],
1136 product_specific: true,
1137 installable: false,
1138 secilc_check: false, // done by se_policy_binary
1139}
1140
1141se_policy_binary {
1142 name: "base_product_sepolicy",
1143 srcs: [":base_product_sepolicy.cil"],
1144 product_specific: true,
1145 installable: false,
1146}
1147
1148se_policy_conf {
1149 name: "base_plat_pub_policy.conf",
1150 srcs: [":se_build_files{.plat_public}"],
1151 build_variant: "user",
1152 installable: false,
1153}
1154
1155se_policy_cil {
1156 name: "base_plat_pub_policy.cil",
1157 src: ":base_plat_pub_policy.conf",
1158 filter_out: [":reqd_policy_mask.cil"],
1159 secilc_check: false,
1160 installable: false,
1161}
1162
1163se_policy_conf {
1164 name: "base_system_ext_pub_policy.conf",
1165 srcs: [":se_build_files{.system_ext_public}"], // system_ext_public includes system
1166 build_variant: "user",
1167 installable: false,
1168}
1169
1170se_policy_cil {
1171 name: "base_system_ext_pub_policy.cil",
1172 src: ":base_system_ext_pub_policy.conf",
1173 filter_out: [":reqd_policy_mask.cil"],
1174 secilc_check: false,
1175 installable: false,
1176}
1177
1178se_policy_conf {
1179 name: "base_product_pub_policy.conf",
1180 srcs: [":se_build_files{.product_public}"], // product_ includes system and system_ext
1181 build_variant: "user",
1182 installable: false,
1183}
1184
1185se_policy_cil {
1186 name: "base_product_pub_policy.cil",
1187 src: ":base_product_pub_policy.conf",
1188 filter_out: [":reqd_policy_mask.cil"],
1189 secilc_check: false,
1190 installable: false,
1191}
1192
Yi-Yo Chiang2c189652021-11-08 19:30:04 +08001193// bug_map - Bug tracking information for selinux denials loaded by auditd.
1194se_filegroup {
1195 name: "bug_map_files",
1196 srcs: ["bug_map"],
1197}
1198
1199se_bug_map {
1200 name: "plat_bug_map",
1201 srcs: [":bug_map_files"],
1202 stem: "bug_map",
1203}
1204
1205se_bug_map {
1206 name: "system_ext_bug_map",
1207 srcs: [":bug_map_files"],
1208 stem: "bug_map",
1209 system_ext_specific: true,
1210}
1211
1212se_bug_map {
1213 name: "vendor_bug_map",
1214 srcs: [":bug_map_files"],
1215 // Legacy file name of the vendor partition bug_map.
1216 stem: "selinux_denial_metadata",
1217 vendor: true,
1218}
1219
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001220//////////////////////////////////
Inseob Kimd5816612021-09-15 03:01:05 +00001221// se_freeze_test compares the plat sepolicy with the prebuilt sepolicy
1222// Additional directories can be specified via Makefile variables:
1223// SEPOLICY_FREEZE_TEST_EXTRA_DIRS and SEPOLICY_FREEZE_TEST_EXTRA_PREBUILT_DIRS.
1224//////////////////////////////////
1225se_freeze_test {
1226 name: "sepolicy_freeze_test",
1227}
Yuntao Xu42e732c2021-11-18 22:33:02 +00001228
1229//////////////////////////////////
1230// Makefile rules temporary imported to Soong
1231// TODO(b/33691272): remove these after migrating seapp to Soong
1232//////////////////////////////////
1233makefile_goal {
1234 name: "plat_seapp_contexts_rule",
1235 product_out_path: "obj/ETC/plat_seapp_contexts_intermediates/plat_seapp_contexts",
1236}
1237
1238makefile_goal {
1239 name: "plat_seapp_neverallows_rule",
1240 product_out_path: "obj/ETC/plat_seapp_neverallows_intermediates/plat_seapp_neverallows",
1241}