Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 1 | // 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 Badour | 601ebb4 | 2021-02-03 23:07:40 -0800 | [diff] [blame] | 15 | package { |
| 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 |
| 33 | license { |
| 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 Stoep | ecd288f | 2019-02-15 12:18:15 -0800 | [diff] [blame] | 45 | cc_defaults { name: "selinux_policy_version", cflags: ["-DSEPOLICY_VERSION=30"], } |
| 46 | |
Tri Vo | 84e247a | 2018-03-25 20:03:58 -0700 | [diff] [blame] | 47 | se_filegroup { |
| 48 | name: "26.0.board.compat.map", |
| 49 | srcs: [ |
| 50 | "compat/26.0/26.0.cil", |
| 51 | ], |
| 52 | } |
| 53 | |
| 54 | se_filegroup { |
| 55 | name: "27.0.board.compat.map", |
| 56 | srcs: [ |
| 57 | "compat/27.0/27.0.cil", |
| 58 | ], |
| 59 | } |
| 60 | |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 61 | se_filegroup { |
| 62 | name: "28.0.board.compat.map", |
| 63 | srcs: [ |
| 64 | "compat/28.0/28.0.cil", |
| 65 | ], |
| 66 | } |
| 67 | |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 68 | se_filegroup { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 69 | name: "29.0.board.compat.map", |
| 70 | srcs: [ |
| 71 | "compat/29.0/29.0.cil", |
| 72 | ], |
| 73 | } |
| 74 | |
| 75 | se_filegroup { |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 76 | name: "30.0.board.compat.map", |
| 77 | srcs: [ |
| 78 | "compat/30.0/30.0.cil", |
| 79 | ], |
| 80 | } |
| 81 | |
| 82 | se_filegroup { |
Yi-Yo Chiang | 8be93c0 | 2021-04-13 02:49:29 +0800 | [diff] [blame^] | 83 | name: "26.0.board.compat.cil", |
| 84 | srcs: [ |
| 85 | "compat/26.0/26.0.compat.cil", |
| 86 | ], |
| 87 | } |
| 88 | |
| 89 | se_filegroup { |
| 90 | name: "27.0.board.compat.cil", |
| 91 | srcs: [ |
| 92 | "compat/27.0/27.0.compat.cil", |
| 93 | ], |
| 94 | } |
| 95 | |
| 96 | se_filegroup { |
| 97 | name: "28.0.board.compat.cil", |
| 98 | srcs: [ |
| 99 | "compat/28.0/28.0.compat.cil", |
| 100 | ], |
| 101 | } |
| 102 | |
| 103 | se_filegroup { |
| 104 | name: "29.0.board.compat.cil", |
| 105 | srcs: [ |
| 106 | "compat/29.0/29.0.compat.cil", |
| 107 | ], |
| 108 | } |
| 109 | |
| 110 | se_filegroup { |
| 111 | name: "30.0.board.compat.cil", |
| 112 | srcs: [ |
| 113 | "compat/30.0/30.0.compat.cil", |
| 114 | ], |
| 115 | } |
| 116 | |
| 117 | se_filegroup { |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 118 | name: "26.0.board.ignore.map", |
| 119 | srcs: [ |
| 120 | "compat/26.0/26.0.ignore.cil", |
| 121 | ], |
| 122 | } |
| 123 | |
| 124 | se_filegroup { |
| 125 | name: "27.0.board.ignore.map", |
| 126 | srcs: [ |
| 127 | "compat/27.0/27.0.ignore.cil", |
| 128 | ], |
| 129 | } |
| 130 | |
| 131 | se_filegroup { |
| 132 | name: "28.0.board.ignore.map", |
| 133 | srcs: [ |
| 134 | "compat/28.0/28.0.ignore.cil", |
| 135 | ], |
| 136 | } |
| 137 | |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 138 | se_filegroup { |
| 139 | name: "29.0.board.ignore.map", |
| 140 | srcs: [ |
| 141 | "compat/29.0/29.0.ignore.cil", |
| 142 | ], |
| 143 | } |
| 144 | |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 145 | se_filegroup { |
| 146 | name: "30.0.board.ignore.map", |
| 147 | srcs: [ |
| 148 | "compat/30.0/30.0.ignore.cil", |
| 149 | ], |
| 150 | } |
| 151 | |
Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 152 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 153 | name: "plat_26.0.cil", |
| 154 | stem: "26.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 155 | bottom_half: [":26.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 156 | top_half: "plat_27.0.cil", |
Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 160 | name: "plat_27.0.cil", |
| 161 | stem: "27.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 162 | bottom_half: [":27.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 163 | top_half: "plat_28.0.cil", |
Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 164 | } |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 165 | |
| 166 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 167 | name: "plat_28.0.cil", |
| 168 | stem: "28.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 169 | bottom_half: [":28.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 170 | top_half: "plat_29.0.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 174 | name: "plat_29.0.cil", |
| 175 | stem: "29.0.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 176 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 177 | top_half: "plat_30.0.cil", |
| 178 | } |
| 179 | |
| 180 | se_cil_compat_map { |
| 181 | name: "plat_30.0.cil", |
| 182 | stem: "30.0.cil", |
| 183 | bottom_half: [":30.0.board.compat.map"], |
| 184 | // top_half: "plat_31.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | se_cil_compat_map { |
| 188 | name: "system_ext_26.0.cil", |
| 189 | stem: "26.0.cil", |
| 190 | bottom_half: [":26.0.board.compat.map"], |
| 191 | top_half: "system_ext_27.0.cil", |
| 192 | system_ext_specific: true, |
| 193 | } |
| 194 | |
| 195 | se_cil_compat_map { |
| 196 | name: "system_ext_27.0.cil", |
| 197 | stem: "27.0.cil", |
| 198 | bottom_half: [":27.0.board.compat.map"], |
| 199 | top_half: "system_ext_28.0.cil", |
| 200 | system_ext_specific: true, |
| 201 | } |
| 202 | |
| 203 | se_cil_compat_map { |
| 204 | name: "system_ext_28.0.cil", |
| 205 | stem: "28.0.cil", |
| 206 | bottom_half: [":28.0.board.compat.map"], |
| 207 | top_half: "system_ext_29.0.cil", |
| 208 | system_ext_specific: true, |
| 209 | } |
| 210 | |
| 211 | se_cil_compat_map { |
| 212 | name: "system_ext_29.0.cil", |
| 213 | stem: "29.0.cil", |
| 214 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 215 | top_half: "system_ext_30.0.cil", |
| 216 | system_ext_specific: true, |
| 217 | } |
| 218 | |
| 219 | se_cil_compat_map { |
| 220 | name: "system_ext_30.0.cil", |
| 221 | stem: "30.0.cil", |
| 222 | bottom_half: [":30.0.board.compat.map"], |
| 223 | // top_half: "system_ext_31.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 224 | system_ext_specific: true, |
| 225 | } |
| 226 | |
| 227 | se_cil_compat_map { |
| 228 | name: "product_26.0.cil", |
| 229 | stem: "26.0.cil", |
| 230 | bottom_half: [":26.0.board.compat.map"], |
| 231 | top_half: "product_27.0.cil", |
| 232 | product_specific: true, |
| 233 | } |
| 234 | |
| 235 | se_cil_compat_map { |
| 236 | name: "product_27.0.cil", |
| 237 | stem: "27.0.cil", |
| 238 | bottom_half: [":27.0.board.compat.map"], |
| 239 | top_half: "product_28.0.cil", |
| 240 | product_specific: true, |
| 241 | } |
| 242 | |
| 243 | se_cil_compat_map { |
| 244 | name: "product_28.0.cil", |
| 245 | stem: "28.0.cil", |
| 246 | bottom_half: [":28.0.board.compat.map"], |
| 247 | top_half: "product_29.0.cil", |
| 248 | product_specific: true, |
| 249 | } |
| 250 | |
| 251 | se_cil_compat_map { |
| 252 | name: "product_29.0.cil", |
| 253 | stem: "29.0.cil", |
| 254 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 255 | top_half: "product_30.0.cil", |
| 256 | product_specific: true, |
| 257 | } |
| 258 | |
| 259 | se_cil_compat_map { |
| 260 | name: "product_30.0.cil", |
| 261 | stem: "30.0.cil", |
| 262 | bottom_half: [":30.0.board.compat.map"], |
| 263 | // top_half: "product_31.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 264 | product_specific: true, |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 265 | } |
| 266 | |
| 267 | se_cil_compat_map { |
| 268 | name: "26.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 269 | bottom_half: [":26.0.board.ignore.map"], |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 270 | top_half: "27.0.ignore.cil", |
| 271 | } |
| 272 | |
| 273 | se_cil_compat_map { |
| 274 | name: "27.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 275 | bottom_half: [":27.0.board.ignore.map"], |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 276 | top_half: "28.0.ignore.cil", |
| 277 | } |
| 278 | |
| 279 | se_cil_compat_map { |
| 280 | name: "28.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 281 | bottom_half: [":28.0.board.ignore.map"], |
Tri Vo | e381deb | 2019-06-12 15:52:30 -0700 | [diff] [blame] | 282 | top_half: "29.0.ignore.cil", |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 283 | } |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 284 | |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 285 | se_cil_compat_map { |
| 286 | name: "29.0.ignore.cil", |
| 287 | bottom_half: [":29.0.board.ignore.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 288 | top_half: "30.0.ignore.cil", |
| 289 | } |
| 290 | |
| 291 | se_cil_compat_map { |
| 292 | name: "30.0.ignore.cil", |
| 293 | bottom_half: [":30.0.board.ignore.map"], |
| 294 | // top_half: "31.0.ignore.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 295 | } |
| 296 | |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 297 | prebuilt_etc { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 298 | name: "26.0.compat.cil", |
| 299 | src: "private/compat/26.0/26.0.compat.cil", |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 300 | sub_dir: "selinux/mapping", |
| 301 | } |
| 302 | |
| 303 | prebuilt_etc { |
| 304 | name: "27.0.compat.cil", |
| 305 | src: "private/compat/27.0/27.0.compat.cil", |
| 306 | sub_dir: "selinux/mapping", |
| 307 | } |
| 308 | |
| 309 | prebuilt_etc { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 310 | name: "28.0.compat.cil", |
| 311 | src: "private/compat/28.0/28.0.compat.cil", |
| 312 | sub_dir: "selinux/mapping", |
| 313 | } |
| 314 | |
| 315 | prebuilt_etc { |
| 316 | name: "29.0.compat.cil", |
| 317 | src: "private/compat/29.0/29.0.compat.cil", |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 318 | sub_dir: "selinux/mapping", |
| 319 | } |
| 320 | |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 321 | prebuilt_etc { |
| 322 | name: "30.0.compat.cil", |
| 323 | src: "private/compat/30.0/30.0.compat.cil", |
| 324 | sub_dir: "selinux/mapping", |
| 325 | } |
| 326 | |
Yi-Yo Chiang | 8be93c0 | 2021-04-13 02:49:29 +0800 | [diff] [blame^] | 327 | se_compat_cil { |
| 328 | name: "system_ext_26.0.compat.cil", |
| 329 | srcs: [":26.0.board.compat.cil"], |
| 330 | stem: "26.0.compat.cil", |
| 331 | system_ext_specific: true, |
| 332 | } |
| 333 | |
| 334 | se_compat_cil { |
| 335 | name: "system_ext_27.0.compat.cil", |
| 336 | srcs: [":27.0.board.compat.cil"], |
| 337 | stem: "27.0.compat.cil", |
| 338 | system_ext_specific: true, |
| 339 | } |
| 340 | |
| 341 | se_compat_cil { |
| 342 | name: "system_ext_28.0.compat.cil", |
| 343 | srcs: [":28.0.board.compat.cil"], |
| 344 | stem: "28.0.compat.cil", |
| 345 | system_ext_specific: true, |
| 346 | } |
| 347 | |
| 348 | se_compat_cil { |
| 349 | name: "system_ext_29.0.compat.cil", |
| 350 | srcs: [":29.0.board.compat.cil"], |
| 351 | stem: "29.0.compat.cil", |
| 352 | system_ext_specific: true, |
| 353 | } |
| 354 | |
| 355 | se_compat_cil { |
| 356 | name: "system_ext_30.0.compat.cil", |
| 357 | srcs: [":30.0.board.compat.cil"], |
| 358 | stem: "30.0.compat.cil", |
| 359 | system_ext_specific: true, |
| 360 | } |
| 361 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 362 | se_filegroup { |
| 363 | name: "file_contexts_files", |
| 364 | srcs: ["file_contexts"], |
| 365 | } |
| 366 | |
| 367 | se_filegroup { |
| 368 | name: "file_contexts_asan_files", |
| 369 | srcs: ["file_contexts_asan"], |
| 370 | } |
| 371 | |
| 372 | se_filegroup { |
| 373 | name: "file_contexts_overlayfs_files", |
| 374 | srcs: ["file_contexts_overlayfs"], |
| 375 | } |
| 376 | |
| 377 | se_filegroup { |
| 378 | name: "hwservice_contexts_files", |
| 379 | srcs: ["hwservice_contexts"], |
| 380 | } |
| 381 | |
| 382 | se_filegroup { |
| 383 | name: "property_contexts_files", |
| 384 | srcs: ["property_contexts"], |
| 385 | } |
| 386 | |
| 387 | se_filegroup { |
| 388 | name: "service_contexts_files", |
| 389 | srcs: ["service_contexts"], |
| 390 | } |
| 391 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 392 | se_filegroup { |
| 393 | name: "keystore2_key_contexts_files", |
| 394 | srcs: ["keystore2_key_contexts"], |
| 395 | } |
| 396 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 397 | file_contexts { |
| 398 | name: "plat_file_contexts", |
| 399 | srcs: [":file_contexts_files"], |
| 400 | product_variables: { |
| 401 | address_sanitize: { |
| 402 | srcs: [":file_contexts_asan_files"], |
| 403 | }, |
| 404 | debuggable: { |
| 405 | srcs: [":file_contexts_overlayfs_files"], |
| 406 | }, |
| 407 | }, |
| 408 | |
| 409 | flatten_apex: { |
| 410 | srcs: ["apex/*-file_contexts"], |
| 411 | }, |
| 412 | |
| 413 | recovery_available: true, |
| 414 | } |
| 415 | |
| 416 | file_contexts { |
| 417 | name: "vendor_file_contexts", |
| 418 | srcs: [":file_contexts_files"], |
| 419 | soc_specific: true, |
| 420 | recovery_available: true, |
| 421 | } |
| 422 | |
| 423 | file_contexts { |
Bowgo Tsai | 86a048d | 2019-09-09 22:04:06 +0800 | [diff] [blame] | 424 | name: "system_ext_file_contexts", |
| 425 | srcs: [":file_contexts_files"], |
| 426 | system_ext_specific: true, |
| 427 | recovery_available: true, |
| 428 | } |
| 429 | |
| 430 | file_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 431 | name: "product_file_contexts", |
| 432 | srcs: [":file_contexts_files"], |
| 433 | product_specific: true, |
| 434 | recovery_available: true, |
| 435 | } |
| 436 | |
| 437 | file_contexts { |
| 438 | name: "odm_file_contexts", |
| 439 | srcs: [":file_contexts_files"], |
| 440 | device_specific: true, |
| 441 | recovery_available: true, |
| 442 | } |
| 443 | |
| 444 | hwservice_contexts { |
| 445 | name: "plat_hwservice_contexts", |
| 446 | srcs: [":hwservice_contexts_files"], |
| 447 | } |
| 448 | |
| 449 | hwservice_contexts { |
Bowgo Tsai | 241d36e | 2019-09-09 22:05:10 +0800 | [diff] [blame] | 450 | name: "system_ext_hwservice_contexts", |
| 451 | srcs: [":hwservice_contexts_files"], |
| 452 | system_ext_specific: true, |
| 453 | } |
| 454 | |
| 455 | hwservice_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 456 | name: "product_hwservice_contexts", |
| 457 | srcs: [":hwservice_contexts_files"], |
| 458 | product_specific: true, |
| 459 | } |
| 460 | |
| 461 | hwservice_contexts { |
| 462 | name: "vendor_hwservice_contexts", |
| 463 | srcs: [":hwservice_contexts_files"], |
| 464 | reqd_mask: true, |
| 465 | soc_specific: true, |
| 466 | } |
| 467 | |
| 468 | hwservice_contexts { |
| 469 | name: "odm_hwservice_contexts", |
| 470 | srcs: [":hwservice_contexts_files"], |
| 471 | device_specific: true, |
| 472 | } |
| 473 | |
| 474 | property_contexts { |
| 475 | name: "plat_property_contexts", |
| 476 | srcs: [":property_contexts_files"], |
| 477 | recovery_available: true, |
| 478 | } |
| 479 | |
| 480 | property_contexts { |
Bowgo Tsai | 1864cd0 | 2019-09-09 18:09:22 +0800 | [diff] [blame] | 481 | name: "system_ext_property_contexts", |
| 482 | srcs: [":property_contexts_files"], |
| 483 | system_ext_specific: true, |
| 484 | recovery_available: true, |
| 485 | } |
| 486 | |
| 487 | property_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 488 | name: "product_property_contexts", |
| 489 | srcs: [":property_contexts_files"], |
| 490 | product_specific: true, |
| 491 | recovery_available: true, |
| 492 | } |
| 493 | |
| 494 | property_contexts { |
| 495 | name: "vendor_property_contexts", |
| 496 | srcs: [":property_contexts_files"], |
| 497 | reqd_mask: true, |
| 498 | soc_specific: true, |
| 499 | recovery_available: true, |
| 500 | } |
| 501 | |
| 502 | property_contexts { |
| 503 | name: "odm_property_contexts", |
| 504 | srcs: [":property_contexts_files"], |
| 505 | device_specific: true, |
| 506 | recovery_available: true, |
| 507 | } |
| 508 | |
| 509 | service_contexts { |
| 510 | name: "plat_service_contexts", |
| 511 | srcs: [":service_contexts_files"], |
| 512 | } |
| 513 | |
| 514 | service_contexts { |
Bowgo Tsai | 9823116 | 2019-09-09 22:05:29 +0800 | [diff] [blame] | 515 | name: "system_ext_service_contexts", |
| 516 | srcs: [":service_contexts_files"], |
| 517 | system_ext_specific: true, |
| 518 | } |
| 519 | |
| 520 | service_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 521 | name: "product_service_contexts", |
| 522 | srcs: [":service_contexts_files"], |
| 523 | product_specific: true, |
| 524 | } |
| 525 | |
| 526 | service_contexts { |
| 527 | name: "vendor_service_contexts", |
| 528 | srcs: [":service_contexts_files"], |
| 529 | reqd_mask: true, |
| 530 | soc_specific: true, |
| 531 | } |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 532 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 533 | keystore2_key_contexts { |
| 534 | name: "plat_keystore2_key_contexts", |
| 535 | srcs: [":keystore2_key_contexts_files"], |
| 536 | } |
| 537 | |
| 538 | keystore2_key_contexts { |
| 539 | name: "system_keystore2_key_contexts", |
| 540 | srcs: [":keystore2_key_contexts_files"], |
| 541 | system_ext_specific: true, |
| 542 | } |
| 543 | |
| 544 | keystore2_key_contexts { |
| 545 | name: "product_keystore2_key_contexts", |
| 546 | srcs: [":keystore2_key_contexts_files"], |
| 547 | product_specific: true, |
| 548 | } |
| 549 | |
| 550 | keystore2_key_contexts { |
| 551 | name: "vendor_keystore2_key_contexts", |
| 552 | srcs: [":keystore2_key_contexts_files"], |
| 553 | reqd_mask: true, |
| 554 | soc_specific: true, |
| 555 | } |
| 556 | |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 557 | // For vts_treble_sys_prop_test |
| 558 | filegroup { |
| 559 | name: "private_property_contexts", |
| 560 | srcs: ["private/property_contexts"], |
| 561 | visibility: [ |
| 562 | "//test/vts-testcase/security/system_property", |
| 563 | ], |
| 564 | } |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 565 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 566 | se_build_files { |
| 567 | name: "se_build_files", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 568 | srcs: [ |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 569 | "security_classes", |
| 570 | "initial_sids", |
| 571 | "access_vectors", |
| 572 | "global_macros", |
| 573 | "neverallow_macros", |
| 574 | "mls_macros", |
| 575 | "mls_decl", |
| 576 | "mls", |
| 577 | "policy_capabilities", |
| 578 | "te_macros", |
| 579 | "attributes", |
| 580 | "ioctl_defines", |
| 581 | "ioctl_macros", |
| 582 | "*.te", |
| 583 | "roles_decl", |
| 584 | "roles", |
| 585 | "users", |
| 586 | "initial_sid_contexts", |
| 587 | "fs_use", |
| 588 | "genfs_contexts", |
| 589 | "port_contexts", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 590 | ], |
| 591 | } |
| 592 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 593 | // reqd_policy_mask - a policy.conf file which contains only the bare minimum |
| 594 | // policy necessary to use checkpolicy. |
| 595 | // |
| 596 | // This bare-minimum policy needs to be present in all policy.conf files, but |
| 597 | // should not necessarily be exported as part of the public policy. |
| 598 | // |
| 599 | // The rules generated by reqd_policy_mask will allow the compilation of public |
| 600 | // policy and subsequent removal of CIL policy that should not be exported. |
| 601 | se_policy_conf { |
| 602 | name: "reqd_policy_mask.conf", |
| 603 | srcs: [":se_build_files{.reqd_mask}"], |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 604 | installable: false, |
| 605 | } |
| 606 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 607 | se_policy_cil { |
| 608 | name: "reqd_policy_mask.cil", |
| 609 | src: ":reqd_policy_mask.conf", |
| 610 | secilc_check: false, |
| 611 | installable: false, |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 612 | } |
| 613 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 614 | // pub_policy - policy that will be exported to be a part of non-platform |
| 615 | // policy corresponding to this platform version. |
| 616 | // |
| 617 | // This is a limited subset of policy that would not compile in checkpolicy on |
| 618 | // its own. |
| 619 | // |
| 620 | // To get around this limitation, add only the required files from private |
| 621 | // policy, which will generate CIL policy that will then be filtered out by the |
| 622 | // reqd_policy_mask. |
| 623 | // |
| 624 | // There are three pub_policy.cil files below: |
| 625 | // - pub_policy.cil: exported 'product', 'system_ext' and 'system' policy. |
| 626 | // - system_ext_pub_policy.cil: exported 'system_ext' and 'system' policy. |
| 627 | // - plat_pub_policy.cil: exported 'system' policy. |
| 628 | // |
| 629 | // Those above files will in turn be used to generate the following versioned cil files: |
| 630 | // - product_mapping_file: the versioned, exported 'product' policy in product partition. |
| 631 | // - system_ext_mapping_file: the versioned, exported 'system_ext' policy in system_ext partition. |
| 632 | // - plat_mapping_file: the versioned, exported 'system' policy in system partition. |
| 633 | // - plat_pub_versioned.cil: the versioned, exported 'product', 'system_ext' and 'system' policy |
| 634 | // in vendor partition. |
| 635 | // |
| 636 | se_policy_conf { |
| 637 | name: "pub_policy.conf", |
| 638 | srcs: [":se_build_files{.product_public}"], // product_ includes system and system_ext |
| 639 | installable: false, |
| 640 | } |
| 641 | |
| 642 | se_policy_cil { |
| 643 | name: "pub_policy.cil", |
| 644 | src: ":pub_policy.conf", |
| 645 | filter_out: [":reqd_policy_mask.cil"], |
| 646 | secilc_check: false, |
| 647 | installable: false, |
| 648 | } |
| 649 | |
| 650 | se_policy_conf { |
| 651 | name: "system_ext_pub_policy.conf", |
| 652 | srcs: [":se_build_files{.system_ext_public}"], // system_ext_public includes system |
| 653 | installable: false, |
| 654 | } |
| 655 | |
| 656 | se_policy_cil { |
| 657 | name: "system_ext_pub_policy.cil", |
| 658 | src: ":system_ext_pub_policy.conf", |
| 659 | filter_out: [":reqd_policy_mask.cil"], |
| 660 | secilc_check: false, |
| 661 | installable: false, |
| 662 | } |
| 663 | |
| 664 | se_policy_conf { |
| 665 | name: "plat_pub_policy.conf", |
| 666 | srcs: [":se_build_files{.plat_public}"], |
| 667 | installable: false, |
| 668 | } |
| 669 | |
| 670 | se_policy_cil { |
| 671 | name: "plat_pub_policy.cil", |
| 672 | src: ":plat_pub_policy.conf", |
| 673 | filter_out: [":reqd_policy_mask.cil"], |
| 674 | secilc_check: false, |
| 675 | installable: false, |
| 676 | } |
| 677 | |
| 678 | // plat_policy.conf - A combination of the private and public platform policy |
| 679 | // which will ship with the device. |
| 680 | // |
| 681 | // The platform will always reflect the most recent platform version and is not |
| 682 | // currently being attributized. |
| 683 | se_policy_conf { |
| 684 | name: "plat_sepolicy.conf", |
| 685 | srcs: [":se_build_files{.plat}"], |
| 686 | installable: false, |
| 687 | } |
| 688 | |
| 689 | se_policy_cil { |
| 690 | name: "plat_sepolicy.cil", |
| 691 | src: ":plat_sepolicy.conf", |
| 692 | additional_cil_files: ["private/technical_debt.cil"], |
| 693 | } |
| 694 | |
| 695 | // system_ext_policy.conf - A combination of the private and public system_ext |
| 696 | // policy which will ship with the device. System_ext policy is not attributized |
| 697 | se_policy_conf { |
| 698 | name: "system_ext_sepolicy.conf", |
| 699 | srcs: [":se_build_files{.system_ext}"], |
| 700 | installable: false, |
| 701 | } |
| 702 | |
| 703 | se_policy_cil { |
| 704 | name: "system_ext_sepolicy.cil", |
| 705 | src: ":system_ext_sepolicy.conf", |
| 706 | system_ext_specific: true, |
| 707 | filter_out: [":plat_sepolicy.cil"], |
| 708 | remove_line_marker: true, |
| 709 | } |
| 710 | |
| 711 | // product_policy.conf - A combination of the private and public product policy |
| 712 | // which will ship with the device. Product policy is not attributized |
| 713 | se_policy_conf { |
| 714 | name: "product_sepolicy.conf", |
| 715 | srcs: [":se_build_files{.product}"], |
| 716 | installable: false, |
| 717 | } |
| 718 | |
| 719 | se_policy_cil { |
| 720 | name: "product_sepolicy.cil", |
| 721 | src: ":product_sepolicy.conf", |
| 722 | product_specific: true, |
| 723 | filter_out: [":plat_sepolicy.cil", ":system_ext_sepolicy.cil"], |
| 724 | remove_line_marker: true, |
| 725 | } |
| 726 | |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 727 | // policy mapping files |
| 728 | // auto-generate the mapping file for current platform policy, since it needs to |
| 729 | // track platform policy development |
| 730 | se_versioned_policy { |
| 731 | name: "plat_mapping_file", |
| 732 | base: ":plat_pub_policy.cil", |
| 733 | mapping: true, |
| 734 | version: "current", |
| 735 | relative_install_path: "mapping", // install to /system/etc/selinux/mapping |
| 736 | } |
| 737 | |
| 738 | se_versioned_policy { |
| 739 | name: "system_ext_mapping_file", |
| 740 | base: ":system_ext_pub_policy.cil", |
| 741 | mapping: true, |
| 742 | version: "current", |
| 743 | filter_out: [":plat_mapping_file"], |
| 744 | relative_install_path: "mapping", // install to /system_ext/etc/selinux/mapping |
| 745 | system_ext_specific: true, |
| 746 | } |
| 747 | |
| 748 | se_versioned_policy { |
| 749 | name: "product_mapping_file", |
| 750 | base: ":pub_policy.cil", |
| 751 | mapping: true, |
| 752 | version: "current", |
| 753 | filter_out: [":plat_mapping_file", ":system_ext_mapping_file"], |
| 754 | relative_install_path: "mapping", // install to /product/etc/selinux/mapping |
| 755 | product_specific: true, |
| 756 | } |
| 757 | |
| 758 | // plat_pub_versioned.cil - the exported platform policy associated with the version |
| 759 | // that non-platform policy targets. |
| 760 | se_versioned_policy { |
| 761 | name: "plat_pub_versioned.cil", |
| 762 | base: ":pub_policy.cil", |
| 763 | target_policy: ":pub_policy.cil", |
| 764 | version: "current", |
| 765 | dependent_cils: [ |
| 766 | ":plat_sepolicy.cil", |
| 767 | ":system_ext_sepolicy.cil", |
| 768 | ":product_sepolicy.cil", |
| 769 | ":plat_mapping_file", |
| 770 | ":system_ext_mapping_file", |
| 771 | ":product_mapping_file", |
| 772 | ], |
| 773 | vendor: true, |
| 774 | } |
| 775 | |
| 776 | ////////////////////////////////// |
| 777 | // Precompiled sepolicy is loaded if and only if: |
| 778 | // - plat_sepolicy_and_mapping.sha256 equals |
| 779 | // precompiled_sepolicy.plat_sepolicy_and_mapping.sha256 |
| 780 | // AND |
| 781 | // - system_ext_sepolicy_and_mapping.sha256 equals |
| 782 | // precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256 |
| 783 | // AND |
| 784 | // - product_sepolicy_and_mapping.sha256 equals |
| 785 | // precompiled_sepolicy.product_sepolicy_and_mapping.sha256 |
| 786 | // See system/core/init/selinux.cpp for details. |
| 787 | ////////////////////////////////// |
| 788 | genrule { |
| 789 | name: "plat_sepolicy_and_mapping.sha256_gen", |
| 790 | srcs: [":plat_sepolicy.cil", ":plat_mapping_file"], |
| 791 | out: ["plat_sepolicy_and_mapping.sha256"], |
| 792 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 793 | } |
| 794 | |
| 795 | prebuilt_etc { |
| 796 | name: "plat_sepolicy_and_mapping.sha256", |
| 797 | filename: "plat_sepolicy_and_mapping.sha256", |
| 798 | src: ":plat_sepolicy_and_mapping.sha256_gen", |
| 799 | relative_install_path: "selinux", |
| 800 | } |
| 801 | |
| 802 | genrule { |
| 803 | name: "system_ext_sepolicy_and_mapping.sha256_gen", |
| 804 | srcs: [":system_ext_sepolicy.cil", ":system_ext_mapping_file"], |
| 805 | out: ["system_ext_sepolicy_and_mapping.sha256"], |
| 806 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 807 | } |
| 808 | |
| 809 | prebuilt_etc { |
| 810 | name: "system_ext_sepolicy_and_mapping.sha256", |
| 811 | filename: "system_ext_sepolicy_and_mapping.sha256", |
| 812 | src: ":system_ext_sepolicy_and_mapping.sha256_gen", |
| 813 | relative_install_path: "selinux", |
| 814 | system_ext_specific: true, |
| 815 | } |
| 816 | |
| 817 | genrule { |
| 818 | name: "product_sepolicy_and_mapping.sha256_gen", |
| 819 | srcs: [":product_sepolicy.cil", ":product_mapping_file"], |
| 820 | out: ["product_sepolicy_and_mapping.sha256"], |
| 821 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 822 | } |
| 823 | |
| 824 | prebuilt_etc { |
| 825 | name: "product_sepolicy_and_mapping.sha256", |
| 826 | filename: "product_sepolicy_and_mapping.sha256", |
| 827 | src: ":product_sepolicy_and_mapping.sha256_gen", |
| 828 | relative_install_path: "selinux", |
| 829 | product_specific: true, |
| 830 | } |
| 831 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 832 | ////////////////////////////////// |
| 833 | // SELinux policy embedded into CTS. |
| 834 | // CTS checks neverallow rules of this policy against the policy of the device under test. |
| 835 | ////////////////////////////////// |
| 836 | se_policy_conf { |
| 837 | name: "general_sepolicy.conf", |
| 838 | srcs: [":se_build_files{.plat}"], |
| 839 | build_variant: "user", |
| 840 | cts: true, |
| 841 | exclude_build_test: true, |
| 842 | } |
| 843 | |
| 844 | ////////////////////////////////// |
| 845 | // modules for microdroid |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 846 | ////////////////////////////////// |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 847 | |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 848 | // microdroid's system sepolicy is almost identical to host's system sepolicy, except that |
| 849 | // microdroid doesn't have system_ext and product. So microdroid's plat_pub_versioned.cil is |
| 850 | // generated with plat_pub_policy.cil (exported system), not pub_policy.cil (exported system + |
| 851 | // system_ext + product). Other two files, plat_sepolicy.cil and plat_mapping_file, are copied from |
| 852 | // host's files. |
| 853 | se_versioned_policy { |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 854 | name: "microdroid_plat_pub_versioned.cil", |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 855 | stem: "plat_pub_versioned.cil", |
| 856 | base: ":plat_pub_policy.cil", |
| 857 | target_policy: ":plat_pub_policy.cil", |
| 858 | version: "current", |
| 859 | dependent_cils: [ |
| 860 | ":plat_sepolicy.cil", |
| 861 | ":plat_mapping_file", |
| 862 | ], |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 863 | installable: false, |
| 864 | } |
| 865 | |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 866 | // microdroid's vendor sepolicy is a minimalized sepolicy needed for microdroid to boot. It just |
| 867 | // contains system/sepolicy/public and system/sepolicy/vendor. |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 868 | se_policy_conf { |
| 869 | name: "microdroid_vendor_sepolicy.conf", |
Inseob Kim | 39fbcf7 | 2021-04-05 17:52:51 +0900 | [diff] [blame] | 870 | srcs: [":se_build_files{.plat_vendor}"], |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 871 | installable: false, |
| 872 | } |
| 873 | |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 874 | se_policy_cil { |
| 875 | name: "microdroid_vendor_sepolicy.cil.raw", |
| 876 | src: ":microdroid_vendor_sepolicy.conf", |
| 877 | filter_out: [":reqd_policy_mask.cil"], |
| 878 | secilc_check: false, // will be done in se_versioned_policy module |
| 879 | installable: false, |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 880 | } |
| 881 | |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 882 | se_versioned_policy { |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 883 | name: "microdroid_vendor_sepolicy.cil", |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 884 | stem: "vendor_sepolicy.cil", |
| 885 | base: ":plat_pub_policy.cil", |
| 886 | target_policy: ":microdroid_vendor_sepolicy.cil.raw", |
| 887 | version: "current", // microdroid is bundled to system |
| 888 | dependent_cils: [ |
| 889 | ":plat_sepolicy.cil", |
| 890 | ":microdroid_plat_pub_versioned.cil", |
| 891 | ":plat_mapping_file", |
| 892 | ], |
| 893 | filter_out: [":microdroid_plat_pub_versioned.cil"], |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 894 | installable: false, |
| 895 | } |