blob: 61bd4c9db940bc9a6604121de2dc21cdcb363118 [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 },
Inseob Kim1b965982021-11-04 12:22:20 +0000497}
Inseob Kimb554e592019-04-15 20:10:46 +0900498
Inseob Kim1b965982021-11-04 12:22:20 +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"],
Inseob Kim1b965982021-11-04 12:22:20 +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"],
621}
622
623service_contexts {
Bowgo Tsai98231162019-09-09 22:05:29 +0800624 name: "system_ext_service_contexts",
625 srcs: [":service_contexts_files"],
626 system_ext_specific: true,
627}
628
629service_contexts {
Inseob Kimb554e592019-04-15 20:10:46 +0900630 name: "product_service_contexts",
631 srcs: [":service_contexts_files"],
632 product_specific: true,
633}
634
635service_contexts {
636 name: "vendor_service_contexts",
637 srcs: [":service_contexts_files"],
638 reqd_mask: true,
639 soc_specific: true,
640}
yangbill3e345372020-04-15 13:55:47 +0800641
Janis Danisevskisc40681f2020-07-25 13:02:29 -0700642keystore2_key_contexts {
643 name: "plat_keystore2_key_contexts",
644 srcs: [":keystore2_key_contexts_files"],
645}
646
647keystore2_key_contexts {
648 name: "system_keystore2_key_contexts",
649 srcs: [":keystore2_key_contexts_files"],
650 system_ext_specific: true,
651}
652
653keystore2_key_contexts {
654 name: "product_keystore2_key_contexts",
655 srcs: [":keystore2_key_contexts_files"],
656 product_specific: true,
657}
658
659keystore2_key_contexts {
660 name: "vendor_keystore2_key_contexts",
661 srcs: [":keystore2_key_contexts_files"],
662 reqd_mask: true,
663 soc_specific: true,
664}
665
yangbill3e345372020-04-15 13:55:47 +0800666// For vts_treble_sys_prop_test
667filegroup {
668 name: "private_property_contexts",
669 srcs: ["private/property_contexts"],
670 visibility: [
671 "//test/vts-testcase/security/system_property",
672 ],
673}
Inseob Kime35b49b2021-02-18 19:15:41 +0900674
Inseob Kima49e7242021-03-22 10:26:13 +0900675se_build_files {
676 name: "se_build_files",
Inseob Kime35b49b2021-02-18 19:15:41 +0900677 srcs: [
Inseob Kima49e7242021-03-22 10:26:13 +0900678 "security_classes",
679 "initial_sids",
680 "access_vectors",
681 "global_macros",
682 "neverallow_macros",
683 "mls_macros",
684 "mls_decl",
685 "mls",
686 "policy_capabilities",
687 "te_macros",
688 "attributes",
689 "ioctl_defines",
690 "ioctl_macros",
691 "*.te",
692 "roles_decl",
693 "roles",
694 "users",
695 "initial_sid_contexts",
696 "fs_use",
697 "genfs_contexts",
698 "port_contexts",
Inseob Kime35b49b2021-02-18 19:15:41 +0900699 ],
700}
701
Inseob Kima49e7242021-03-22 10:26:13 +0900702// reqd_policy_mask - a policy.conf file which contains only the bare minimum
703// policy necessary to use checkpolicy.
704//
705// This bare-minimum policy needs to be present in all policy.conf files, but
706// should not necessarily be exported as part of the public policy.
707//
708// The rules generated by reqd_policy_mask will allow the compilation of public
709// policy and subsequent removal of CIL policy that should not be exported.
710se_policy_conf {
711 name: "reqd_policy_mask.conf",
712 srcs: [":se_build_files{.reqd_mask}"],
Inseob Kime35b49b2021-02-18 19:15:41 +0900713 installable: false,
714}
715
Inseob Kima49e7242021-03-22 10:26:13 +0900716se_policy_cil {
717 name: "reqd_policy_mask.cil",
718 src: ":reqd_policy_mask.conf",
719 secilc_check: false,
720 installable: false,
Inseob Kime35b49b2021-02-18 19:15:41 +0900721}
722
Inseob Kima49e7242021-03-22 10:26:13 +0900723// pub_policy - policy that will be exported to be a part of non-platform
724// policy corresponding to this platform version.
725//
726// This is a limited subset of policy that would not compile in checkpolicy on
727// its own.
728//
729// To get around this limitation, add only the required files from private
730// policy, which will generate CIL policy that will then be filtered out by the
731// reqd_policy_mask.
732//
733// There are three pub_policy.cil files below:
734// - pub_policy.cil: exported 'product', 'system_ext' and 'system' policy.
735// - system_ext_pub_policy.cil: exported 'system_ext' and 'system' policy.
736// - plat_pub_policy.cil: exported 'system' policy.
737//
738// Those above files will in turn be used to generate the following versioned cil files:
739// - product_mapping_file: the versioned, exported 'product' policy in product partition.
740// - system_ext_mapping_file: the versioned, exported 'system_ext' policy in system_ext partition.
741// - plat_mapping_file: the versioned, exported 'system' policy in system partition.
742// - plat_pub_versioned.cil: the versioned, exported 'product', 'system_ext' and 'system' policy
743// in vendor partition.
744//
745se_policy_conf {
746 name: "pub_policy.conf",
747 srcs: [":se_build_files{.product_public}"], // product_ includes system and system_ext
748 installable: false,
749}
750
751se_policy_cil {
752 name: "pub_policy.cil",
753 src: ":pub_policy.conf",
754 filter_out: [":reqd_policy_mask.cil"],
755 secilc_check: false,
756 installable: false,
757}
758
759se_policy_conf {
760 name: "system_ext_pub_policy.conf",
761 srcs: [":se_build_files{.system_ext_public}"], // system_ext_public includes system
762 installable: false,
763}
764
765se_policy_cil {
766 name: "system_ext_pub_policy.cil",
767 src: ":system_ext_pub_policy.conf",
768 filter_out: [":reqd_policy_mask.cil"],
769 secilc_check: false,
770 installable: false,
771}
772
773se_policy_conf {
774 name: "plat_pub_policy.conf",
775 srcs: [":se_build_files{.plat_public}"],
776 installable: false,
777}
778
779se_policy_cil {
780 name: "plat_pub_policy.cil",
781 src: ":plat_pub_policy.conf",
782 filter_out: [":reqd_policy_mask.cil"],
783 secilc_check: false,
784 installable: false,
785}
786
787// plat_policy.conf - A combination of the private and public platform policy
788// which will ship with the device.
789//
790// The platform will always reflect the most recent platform version and is not
791// currently being attributized.
792se_policy_conf {
793 name: "plat_sepolicy.conf",
794 srcs: [":se_build_files{.plat}"],
795 installable: false,
796}
797
798se_policy_cil {
799 name: "plat_sepolicy.cil",
800 src: ":plat_sepolicy.conf",
801 additional_cil_files: ["private/technical_debt.cil"],
802}
803
Inseob Kim6cc75f42021-04-29 13:53:20 +0000804// userdebug_plat_policy.conf - the userdebug version plat_sepolicy.cil
805se_policy_conf {
806 name: "userdebug_plat_sepolicy.conf",
807 srcs: [":se_build_files{.plat}"],
808 build_variant: "userdebug",
809 installable: false,
810}
811
812se_policy_cil {
813 name: "userdebug_plat_sepolicy.cil",
814 src: ":userdebug_plat_sepolicy.conf",
815 additional_cil_files: ["private/technical_debt.cil"],
816 debug_ramdisk: true,
Yi-Yo Chiang68478b12021-10-16 03:23:05 +0800817 dist: {
818 targets: ["droidcore"],
819 },
Inseob Kim6cc75f42021-04-29 13:53:20 +0000820}
821
Yi-Yo Chiang857ffc42021-09-23 14:14:16 +0000822// A copy of the userdebug_plat_policy in GSI.
823soong_config_module_type {
824 name: "gsi_se_policy_cil",
825 module_type: "se_policy_cil",
826 config_namespace: "ANDROID",
827 bool_variables: [
828 "PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT",
829 ],
830 properties: [
831 "enabled",
832 "installable",
833 ],
834}
835
836gsi_se_policy_cil {
837 name: "system_ext_userdebug_plat_sepolicy.cil",
838 stem: "userdebug_plat_sepolicy.cil",
839 src: ":userdebug_plat_sepolicy.conf",
840 additional_cil_files: ["private/technical_debt.cil"],
841 system_ext_specific: true,
842 enabled: false,
843 installable: false,
844 soong_config_variables: {
845 PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT: {
846 enabled: true,
847 installable: true,
848 },
849 },
850}
851
Inseob Kima49e7242021-03-22 10:26:13 +0900852// system_ext_policy.conf - A combination of the private and public system_ext
853// policy which will ship with the device. System_ext policy is not attributized
854se_policy_conf {
855 name: "system_ext_sepolicy.conf",
856 srcs: [":se_build_files{.system_ext}"],
857 installable: false,
858}
859
860se_policy_cil {
861 name: "system_ext_sepolicy.cil",
862 src: ":system_ext_sepolicy.conf",
863 system_ext_specific: true,
864 filter_out: [":plat_sepolicy.cil"],
865 remove_line_marker: true,
866}
867
868// product_policy.conf - A combination of the private and public product policy
869// which will ship with the device. Product policy is not attributized
870se_policy_conf {
871 name: "product_sepolicy.conf",
872 srcs: [":se_build_files{.product}"],
873 installable: false,
874}
875
876se_policy_cil {
877 name: "product_sepolicy.cil",
878 src: ":product_sepolicy.conf",
879 product_specific: true,
880 filter_out: [":plat_sepolicy.cil", ":system_ext_sepolicy.cil"],
881 remove_line_marker: true,
882}
883
Inseob Kim039175b2021-03-25 15:37:34 +0900884// policy mapping files
885// auto-generate the mapping file for current platform policy, since it needs to
886// track platform policy development
887se_versioned_policy {
888 name: "plat_mapping_file",
889 base: ":plat_pub_policy.cil",
890 mapping: true,
891 version: "current",
892 relative_install_path: "mapping", // install to /system/etc/selinux/mapping
893}
894
895se_versioned_policy {
896 name: "system_ext_mapping_file",
897 base: ":system_ext_pub_policy.cil",
898 mapping: true,
899 version: "current",
900 filter_out: [":plat_mapping_file"],
901 relative_install_path: "mapping", // install to /system_ext/etc/selinux/mapping
902 system_ext_specific: true,
903}
904
905se_versioned_policy {
906 name: "product_mapping_file",
907 base: ":pub_policy.cil",
908 mapping: true,
909 version: "current",
910 filter_out: [":plat_mapping_file", ":system_ext_mapping_file"],
911 relative_install_path: "mapping", // install to /product/etc/selinux/mapping
912 product_specific: true,
913}
914
915// plat_pub_versioned.cil - the exported platform policy associated with the version
916// that non-platform policy targets.
917se_versioned_policy {
918 name: "plat_pub_versioned.cil",
919 base: ":pub_policy.cil",
920 target_policy: ":pub_policy.cil",
921 version: "current",
922 dependent_cils: [
923 ":plat_sepolicy.cil",
924 ":system_ext_sepolicy.cil",
925 ":product_sepolicy.cil",
926 ":plat_mapping_file",
927 ":system_ext_mapping_file",
928 ":product_mapping_file",
929 ],
930 vendor: true,
931}
932
933//////////////////////////////////
934// Precompiled sepolicy is loaded if and only if:
935// - plat_sepolicy_and_mapping.sha256 equals
936// precompiled_sepolicy.plat_sepolicy_and_mapping.sha256
937// AND
938// - system_ext_sepolicy_and_mapping.sha256 equals
939// precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256
940// AND
941// - product_sepolicy_and_mapping.sha256 equals
942// precompiled_sepolicy.product_sepolicy_and_mapping.sha256
943// See system/core/init/selinux.cpp for details.
944//////////////////////////////////
945genrule {
946 name: "plat_sepolicy_and_mapping.sha256_gen",
947 srcs: [":plat_sepolicy.cil", ":plat_mapping_file"],
948 out: ["plat_sepolicy_and_mapping.sha256"],
949 cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)",
950}
951
952prebuilt_etc {
953 name: "plat_sepolicy_and_mapping.sha256",
954 filename: "plat_sepolicy_and_mapping.sha256",
955 src: ":plat_sepolicy_and_mapping.sha256_gen",
956 relative_install_path: "selinux",
957}
958
959genrule {
960 name: "system_ext_sepolicy_and_mapping.sha256_gen",
961 srcs: [":system_ext_sepolicy.cil", ":system_ext_mapping_file"],
962 out: ["system_ext_sepolicy_and_mapping.sha256"],
963 cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)",
964}
965
966prebuilt_etc {
967 name: "system_ext_sepolicy_and_mapping.sha256",
968 filename: "system_ext_sepolicy_and_mapping.sha256",
969 src: ":system_ext_sepolicy_and_mapping.sha256_gen",
970 relative_install_path: "selinux",
971 system_ext_specific: true,
972}
973
974genrule {
975 name: "product_sepolicy_and_mapping.sha256_gen",
976 srcs: [":product_sepolicy.cil", ":product_mapping_file"],
977 out: ["product_sepolicy_and_mapping.sha256"],
978 cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)",
979}
980
981prebuilt_etc {
982 name: "product_sepolicy_and_mapping.sha256",
983 filename: "product_sepolicy_and_mapping.sha256",
984 src: ":product_sepolicy_and_mapping.sha256_gen",
985 relative_install_path: "selinux",
986 product_specific: true,
987}
988
Inseob Kim1c056b12021-04-30 00:11:43 +0900989sepolicy_vers {
990 name: "plat_sepolicy_vers.txt",
991 version: "vendor",
992 vendor: true,
993}
994
Inseob Kim731182a2021-05-06 11:44:37 +0000995soong_config_module_type {
996 name: "precompiled_sepolicy_defaults",
997 module_type: "prebuilt_defaults",
998 config_namespace: "ANDROID",
999 bool_variables: ["BOARD_USES_ODMIMAGE"],
1000 properties: ["vendor", "device_specific"],
1001}
1002
1003precompiled_sepolicy_defaults {
1004 name: "precompiled_sepolicy",
1005 soong_config_variables: {
1006 BOARD_USES_ODMIMAGE: {
1007 device_specific: true,
1008 conditions_default: {
1009 vendor: true,
1010 },
1011 },
1012 },
1013}
1014
1015//////////////////////////////////
1016// SHA-256 digest of the plat_sepolicy.cil and plat_mapping_file against
1017// which precompiled_policy was built.
1018//////////////////////////////////
1019prebuilt_etc {
1020 defaults: ["precompiled_sepolicy"],
1021 name: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256",
1022 filename: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256",
1023 src: ":plat_sepolicy_and_mapping.sha256_gen",
1024 relative_install_path: "selinux",
1025}
1026
1027//////////////////////////////////
1028// SHA-256 digest of the system_ext_sepolicy.cil and system_ext_mapping_file against
1029// which precompiled_policy was built.
1030//////////////////////////////////
1031prebuilt_etc {
1032 defaults: ["precompiled_sepolicy"],
1033 name: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256",
1034 filename: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256",
1035 src: ":system_ext_sepolicy_and_mapping.sha256_gen",
1036 relative_install_path: "selinux",
1037}
1038
1039//////////////////////////////////
1040// SHA-256 digest of the product_sepolicy.cil and product_mapping_file against
1041// which precompiled_policy was built.
1042//////////////////////////////////
1043prebuilt_etc {
1044 defaults: ["precompiled_sepolicy"],
1045 name: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256",
1046 filename: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256",
1047 src: ":product_sepolicy_and_mapping.sha256_gen",
1048 relative_install_path: "selinux",
1049}
1050
1051
Inseob Kima49e7242021-03-22 10:26:13 +09001052//////////////////////////////////
1053// SELinux policy embedded into CTS.
1054// CTS checks neverallow rules of this policy against the policy of the device under test.
1055//////////////////////////////////
1056se_policy_conf {
1057 name: "general_sepolicy.conf",
1058 srcs: [":se_build_files{.plat}"],
1059 build_variant: "user",
1060 cts: true,
1061 exclude_build_test: true,
1062}
Inseob Kimd5816612021-09-15 03:01:05 +00001063
1064//////////////////////////////////
Inseob Kim4d90b7e2021-09-27 13:43:01 +00001065// Base system policy for treble sepolicy tests.
1066// If system sepolicy is extended (e.g. by SoC vendors), their plat_pub_versioned.cil may differ
1067// with system/sepolicy/prebuilts/api/{version}/plat_pub_versioned.cil. In that case,
1068// BOARD_PLAT_PUB_VERSIONED_POLICY can be used to specify extended plat_pub_versioned.cil.
1069// See treble_sepolicy_tests_for_release.mk for more details.
1070//////////////////////////////////
1071se_policy_conf {
1072 name: "base_plat_sepolicy.conf",
1073 srcs: [":se_build_files{.plat}"],
1074 build_variant: "user",
1075 installable: false,
1076}
1077
1078se_policy_cil {
1079 name: "base_plat_sepolicy.cil",
1080 src: ":base_plat_sepolicy.conf",
1081 additional_cil_files: ["private/technical_debt.cil"],
1082 installable: false,
1083 secilc_check: false, // done by se_policy_binary
1084}
1085
1086se_policy_binary {
1087 name: "base_plat_sepolicy",
1088 srcs: [":base_plat_sepolicy.cil"],
1089 installable: false,
1090}
1091
1092se_policy_conf {
1093 name: "base_system_ext_sepolicy.conf",
1094 srcs: [":se_build_files{.system_ext}"],
1095 build_variant: "user",
1096 installable: false,
1097}
1098
1099se_policy_cil {
1100 name: "base_system_ext_sepolicy.cil",
1101 src: ":base_system_ext_sepolicy.conf",
1102 additional_cil_files: ["private/technical_debt.cil"],
1103 system_ext_specific: true,
1104 installable: false,
1105 secilc_check: false, // done by se_policy_binary
1106}
1107
1108se_policy_binary {
1109 name: "base_system_ext_sepolicy",
1110 srcs: [":base_system_ext_sepolicy.cil"],
1111 system_ext_specific: true,
1112 installable: false,
1113}
1114
1115se_policy_conf {
1116 name: "base_product_sepolicy.conf",
1117 srcs: [":se_build_files{.product}"],
1118 build_variant: "user",
1119 installable: false,
1120}
1121
1122se_policy_cil {
1123 name: "base_product_sepolicy.cil",
1124 src: ":base_product_sepolicy.conf",
1125 additional_cil_files: ["private/technical_debt.cil"],
1126 product_specific: true,
1127 installable: false,
1128 secilc_check: false, // done by se_policy_binary
1129}
1130
1131se_policy_binary {
1132 name: "base_product_sepolicy",
1133 srcs: [":base_product_sepolicy.cil"],
1134 product_specific: true,
1135 installable: false,
1136}
1137
1138se_policy_conf {
1139 name: "base_plat_pub_policy.conf",
1140 srcs: [":se_build_files{.plat_public}"],
1141 build_variant: "user",
1142 installable: false,
1143}
1144
1145se_policy_cil {
1146 name: "base_plat_pub_policy.cil",
1147 src: ":base_plat_pub_policy.conf",
1148 filter_out: [":reqd_policy_mask.cil"],
1149 secilc_check: false,
1150 installable: false,
1151}
1152
1153se_policy_conf {
1154 name: "base_system_ext_pub_policy.conf",
1155 srcs: [":se_build_files{.system_ext_public}"], // system_ext_public includes system
1156 build_variant: "user",
1157 installable: false,
1158}
1159
1160se_policy_cil {
1161 name: "base_system_ext_pub_policy.cil",
1162 src: ":base_system_ext_pub_policy.conf",
1163 filter_out: [":reqd_policy_mask.cil"],
1164 secilc_check: false,
1165 installable: false,
1166}
1167
1168se_policy_conf {
1169 name: "base_product_pub_policy.conf",
1170 srcs: [":se_build_files{.product_public}"], // product_ includes system and system_ext
1171 build_variant: "user",
1172 installable: false,
1173}
1174
1175se_policy_cil {
1176 name: "base_product_pub_policy.cil",
1177 src: ":base_product_pub_policy.conf",
1178 filter_out: [":reqd_policy_mask.cil"],
1179 secilc_check: false,
1180 installable: false,
1181}
1182
1183//////////////////////////////////
Inseob Kimd5816612021-09-15 03:01:05 +00001184// se_freeze_test compares the plat sepolicy with the prebuilt sepolicy
1185// Additional directories can be specified via Makefile variables:
1186// SEPOLICY_FREEZE_TEST_EXTRA_DIRS and SEPOLICY_FREEZE_TEST_EXTRA_PREBUILT_DIRS.
1187//////////////////////////////////
1188se_freeze_test {
1189 name: "sepolicy_freeze_test",
1190}
Inseob Kim1b965982021-11-04 12:22:20 +00001191
1192//////////////////////////////////
1193// Makefile rules temporary imported to Soong
1194// TODO(b/33691272): remove these after migrating seapp to Soong
1195//////////////////////////////////
1196makefile_goal {
1197 name: "plat_seapp_contexts_rule",
1198 product_out_path: "obj/ETC/plat_seapp_contexts_intermediates/plat_seapp_contexts",
1199}
1200
1201makefile_goal {
1202 name: "plat_seapp_neverallows_rule",
1203 product_out_path: "obj/ETC/plat_seapp_neverallows_intermediates/plat_seapp_neverallows",
1204}