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 { |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 83 | name: "26.0.board.ignore.map", |
| 84 | srcs: [ |
| 85 | "compat/26.0/26.0.ignore.cil", |
| 86 | ], |
| 87 | } |
| 88 | |
| 89 | se_filegroup { |
| 90 | name: "27.0.board.ignore.map", |
| 91 | srcs: [ |
| 92 | "compat/27.0/27.0.ignore.cil", |
| 93 | ], |
| 94 | } |
| 95 | |
| 96 | se_filegroup { |
| 97 | name: "28.0.board.ignore.map", |
| 98 | srcs: [ |
| 99 | "compat/28.0/28.0.ignore.cil", |
| 100 | ], |
| 101 | } |
| 102 | |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 103 | se_filegroup { |
| 104 | name: "29.0.board.ignore.map", |
| 105 | srcs: [ |
| 106 | "compat/29.0/29.0.ignore.cil", |
| 107 | ], |
| 108 | } |
| 109 | |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 110 | se_filegroup { |
| 111 | name: "30.0.board.ignore.map", |
| 112 | srcs: [ |
| 113 | "compat/30.0/30.0.ignore.cil", |
| 114 | ], |
| 115 | } |
| 116 | |
Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 117 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 118 | name: "plat_26.0.cil", |
| 119 | stem: "26.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 120 | bottom_half: [":26.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 121 | top_half: "plat_27.0.cil", |
Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 125 | name: "plat_27.0.cil", |
| 126 | stem: "27.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 127 | bottom_half: [":27.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 128 | top_half: "plat_28.0.cil", |
Tri Vo | a5cfd3e | 2018-03-22 11:35:02 -0700 | [diff] [blame] | 129 | } |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 130 | |
| 131 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 132 | name: "plat_28.0.cil", |
| 133 | stem: "28.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 134 | bottom_half: [":28.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 135 | top_half: "plat_29.0.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 139 | name: "plat_29.0.cil", |
| 140 | stem: "29.0.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 141 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 142 | top_half: "plat_30.0.cil", |
| 143 | } |
| 144 | |
| 145 | se_cil_compat_map { |
| 146 | name: "plat_30.0.cil", |
| 147 | stem: "30.0.cil", |
| 148 | bottom_half: [":30.0.board.compat.map"], |
| 149 | // top_half: "plat_31.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | se_cil_compat_map { |
| 153 | name: "system_ext_26.0.cil", |
| 154 | stem: "26.0.cil", |
| 155 | bottom_half: [":26.0.board.compat.map"], |
| 156 | top_half: "system_ext_27.0.cil", |
| 157 | system_ext_specific: true, |
| 158 | } |
| 159 | |
| 160 | se_cil_compat_map { |
| 161 | name: "system_ext_27.0.cil", |
| 162 | stem: "27.0.cil", |
| 163 | bottom_half: [":27.0.board.compat.map"], |
| 164 | top_half: "system_ext_28.0.cil", |
| 165 | system_ext_specific: true, |
| 166 | } |
| 167 | |
| 168 | se_cil_compat_map { |
| 169 | name: "system_ext_28.0.cil", |
| 170 | stem: "28.0.cil", |
| 171 | bottom_half: [":28.0.board.compat.map"], |
| 172 | top_half: "system_ext_29.0.cil", |
| 173 | system_ext_specific: true, |
| 174 | } |
| 175 | |
| 176 | se_cil_compat_map { |
| 177 | name: "system_ext_29.0.cil", |
| 178 | stem: "29.0.cil", |
| 179 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 180 | top_half: "system_ext_30.0.cil", |
| 181 | system_ext_specific: true, |
| 182 | } |
| 183 | |
| 184 | se_cil_compat_map { |
| 185 | name: "system_ext_30.0.cil", |
| 186 | stem: "30.0.cil", |
| 187 | bottom_half: [":30.0.board.compat.map"], |
| 188 | // top_half: "system_ext_31.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 189 | system_ext_specific: true, |
| 190 | } |
| 191 | |
| 192 | se_cil_compat_map { |
| 193 | name: "product_26.0.cil", |
| 194 | stem: "26.0.cil", |
| 195 | bottom_half: [":26.0.board.compat.map"], |
| 196 | top_half: "product_27.0.cil", |
| 197 | product_specific: true, |
| 198 | } |
| 199 | |
| 200 | se_cil_compat_map { |
| 201 | name: "product_27.0.cil", |
| 202 | stem: "27.0.cil", |
| 203 | bottom_half: [":27.0.board.compat.map"], |
| 204 | top_half: "product_28.0.cil", |
| 205 | product_specific: true, |
| 206 | } |
| 207 | |
| 208 | se_cil_compat_map { |
| 209 | name: "product_28.0.cil", |
| 210 | stem: "28.0.cil", |
| 211 | bottom_half: [":28.0.board.compat.map"], |
| 212 | top_half: "product_29.0.cil", |
| 213 | product_specific: true, |
| 214 | } |
| 215 | |
| 216 | se_cil_compat_map { |
| 217 | name: "product_29.0.cil", |
| 218 | stem: "29.0.cil", |
| 219 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 220 | top_half: "product_30.0.cil", |
| 221 | product_specific: true, |
| 222 | } |
| 223 | |
| 224 | se_cil_compat_map { |
| 225 | name: "product_30.0.cil", |
| 226 | stem: "30.0.cil", |
| 227 | bottom_half: [":30.0.board.compat.map"], |
| 228 | // top_half: "product_31.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 229 | product_specific: true, |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 230 | } |
| 231 | |
| 232 | se_cil_compat_map { |
| 233 | name: "26.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 234 | bottom_half: [":26.0.board.ignore.map"], |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 235 | top_half: "27.0.ignore.cil", |
| 236 | } |
| 237 | |
| 238 | se_cil_compat_map { |
| 239 | name: "27.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 240 | bottom_half: [":27.0.board.ignore.map"], |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 241 | top_half: "28.0.ignore.cil", |
| 242 | } |
| 243 | |
| 244 | se_cil_compat_map { |
| 245 | name: "28.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 246 | bottom_half: [":28.0.board.ignore.map"], |
Tri Vo | e381deb | 2019-06-12 15:52:30 -0700 | [diff] [blame] | 247 | top_half: "29.0.ignore.cil", |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 248 | } |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 249 | |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 250 | se_cil_compat_map { |
| 251 | name: "29.0.ignore.cil", |
| 252 | bottom_half: [":29.0.board.ignore.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 253 | top_half: "30.0.ignore.cil", |
| 254 | } |
| 255 | |
| 256 | se_cil_compat_map { |
| 257 | name: "30.0.ignore.cil", |
| 258 | bottom_half: [":30.0.board.ignore.map"], |
| 259 | // top_half: "31.0.ignore.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 260 | } |
| 261 | |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 262 | prebuilt_etc { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 263 | name: "26.0.compat.cil", |
| 264 | src: "private/compat/26.0/26.0.compat.cil", |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 265 | sub_dir: "selinux/mapping", |
| 266 | } |
| 267 | |
| 268 | prebuilt_etc { |
| 269 | name: "27.0.compat.cil", |
| 270 | src: "private/compat/27.0/27.0.compat.cil", |
| 271 | sub_dir: "selinux/mapping", |
| 272 | } |
| 273 | |
| 274 | prebuilt_etc { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 275 | name: "28.0.compat.cil", |
| 276 | src: "private/compat/28.0/28.0.compat.cil", |
| 277 | sub_dir: "selinux/mapping", |
| 278 | } |
| 279 | |
| 280 | prebuilt_etc { |
| 281 | name: "29.0.compat.cil", |
| 282 | src: "private/compat/29.0/29.0.compat.cil", |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 283 | sub_dir: "selinux/mapping", |
| 284 | } |
| 285 | |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 286 | prebuilt_etc { |
| 287 | name: "30.0.compat.cil", |
| 288 | src: "private/compat/30.0/30.0.compat.cil", |
| 289 | sub_dir: "selinux/mapping", |
| 290 | } |
| 291 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 292 | se_filegroup { |
| 293 | name: "file_contexts_files", |
| 294 | srcs: ["file_contexts"], |
| 295 | } |
| 296 | |
| 297 | se_filegroup { |
| 298 | name: "file_contexts_asan_files", |
| 299 | srcs: ["file_contexts_asan"], |
| 300 | } |
| 301 | |
| 302 | se_filegroup { |
| 303 | name: "file_contexts_overlayfs_files", |
| 304 | srcs: ["file_contexts_overlayfs"], |
| 305 | } |
| 306 | |
| 307 | se_filegroup { |
| 308 | name: "hwservice_contexts_files", |
| 309 | srcs: ["hwservice_contexts"], |
| 310 | } |
| 311 | |
| 312 | se_filegroup { |
| 313 | name: "property_contexts_files", |
| 314 | srcs: ["property_contexts"], |
| 315 | } |
| 316 | |
| 317 | se_filegroup { |
| 318 | name: "service_contexts_files", |
| 319 | srcs: ["service_contexts"], |
| 320 | } |
| 321 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 322 | se_filegroup { |
| 323 | name: "keystore2_key_contexts_files", |
| 324 | srcs: ["keystore2_key_contexts"], |
| 325 | } |
| 326 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 327 | file_contexts { |
| 328 | name: "plat_file_contexts", |
| 329 | srcs: [":file_contexts_files"], |
| 330 | product_variables: { |
| 331 | address_sanitize: { |
| 332 | srcs: [":file_contexts_asan_files"], |
| 333 | }, |
| 334 | debuggable: { |
| 335 | srcs: [":file_contexts_overlayfs_files"], |
| 336 | }, |
| 337 | }, |
| 338 | |
| 339 | flatten_apex: { |
| 340 | srcs: ["apex/*-file_contexts"], |
| 341 | }, |
| 342 | |
| 343 | recovery_available: true, |
| 344 | } |
| 345 | |
| 346 | file_contexts { |
| 347 | name: "vendor_file_contexts", |
| 348 | srcs: [":file_contexts_files"], |
| 349 | soc_specific: true, |
| 350 | recovery_available: true, |
| 351 | } |
| 352 | |
| 353 | file_contexts { |
Bowgo Tsai | 86a048d | 2019-09-09 22:04:06 +0800 | [diff] [blame] | 354 | name: "system_ext_file_contexts", |
| 355 | srcs: [":file_contexts_files"], |
| 356 | system_ext_specific: true, |
| 357 | recovery_available: true, |
| 358 | } |
| 359 | |
| 360 | file_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 361 | name: "product_file_contexts", |
| 362 | srcs: [":file_contexts_files"], |
| 363 | product_specific: true, |
| 364 | recovery_available: true, |
| 365 | } |
| 366 | |
| 367 | file_contexts { |
| 368 | name: "odm_file_contexts", |
| 369 | srcs: [":file_contexts_files"], |
| 370 | device_specific: true, |
| 371 | recovery_available: true, |
| 372 | } |
| 373 | |
| 374 | hwservice_contexts { |
| 375 | name: "plat_hwservice_contexts", |
| 376 | srcs: [":hwservice_contexts_files"], |
| 377 | } |
| 378 | |
| 379 | hwservice_contexts { |
Bowgo Tsai | 241d36e | 2019-09-09 22:05:10 +0800 | [diff] [blame] | 380 | name: "system_ext_hwservice_contexts", |
| 381 | srcs: [":hwservice_contexts_files"], |
| 382 | system_ext_specific: true, |
| 383 | } |
| 384 | |
| 385 | hwservice_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 386 | name: "product_hwservice_contexts", |
| 387 | srcs: [":hwservice_contexts_files"], |
| 388 | product_specific: true, |
| 389 | } |
| 390 | |
| 391 | hwservice_contexts { |
| 392 | name: "vendor_hwservice_contexts", |
| 393 | srcs: [":hwservice_contexts_files"], |
| 394 | reqd_mask: true, |
| 395 | soc_specific: true, |
| 396 | } |
| 397 | |
| 398 | hwservice_contexts { |
| 399 | name: "odm_hwservice_contexts", |
| 400 | srcs: [":hwservice_contexts_files"], |
| 401 | device_specific: true, |
| 402 | } |
| 403 | |
| 404 | property_contexts { |
| 405 | name: "plat_property_contexts", |
| 406 | srcs: [":property_contexts_files"], |
| 407 | recovery_available: true, |
| 408 | } |
| 409 | |
| 410 | property_contexts { |
Bowgo Tsai | 1864cd0 | 2019-09-09 18:09:22 +0800 | [diff] [blame] | 411 | name: "system_ext_property_contexts", |
| 412 | srcs: [":property_contexts_files"], |
| 413 | system_ext_specific: true, |
| 414 | recovery_available: true, |
| 415 | } |
| 416 | |
| 417 | property_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 418 | name: "product_property_contexts", |
| 419 | srcs: [":property_contexts_files"], |
| 420 | product_specific: true, |
| 421 | recovery_available: true, |
| 422 | } |
| 423 | |
| 424 | property_contexts { |
| 425 | name: "vendor_property_contexts", |
| 426 | srcs: [":property_contexts_files"], |
| 427 | reqd_mask: true, |
| 428 | soc_specific: true, |
| 429 | recovery_available: true, |
| 430 | } |
| 431 | |
| 432 | property_contexts { |
| 433 | name: "odm_property_contexts", |
| 434 | srcs: [":property_contexts_files"], |
| 435 | device_specific: true, |
| 436 | recovery_available: true, |
| 437 | } |
| 438 | |
| 439 | service_contexts { |
| 440 | name: "plat_service_contexts", |
| 441 | srcs: [":service_contexts_files"], |
| 442 | } |
| 443 | |
| 444 | service_contexts { |
Bowgo Tsai | 9823116 | 2019-09-09 22:05:29 +0800 | [diff] [blame] | 445 | name: "system_ext_service_contexts", |
| 446 | srcs: [":service_contexts_files"], |
| 447 | system_ext_specific: true, |
| 448 | } |
| 449 | |
| 450 | service_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 451 | name: "product_service_contexts", |
| 452 | srcs: [":service_contexts_files"], |
| 453 | product_specific: true, |
| 454 | } |
| 455 | |
| 456 | service_contexts { |
| 457 | name: "vendor_service_contexts", |
| 458 | srcs: [":service_contexts_files"], |
| 459 | reqd_mask: true, |
| 460 | soc_specific: true, |
| 461 | } |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 462 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 463 | keystore2_key_contexts { |
| 464 | name: "plat_keystore2_key_contexts", |
| 465 | srcs: [":keystore2_key_contexts_files"], |
| 466 | } |
| 467 | |
| 468 | keystore2_key_contexts { |
| 469 | name: "system_keystore2_key_contexts", |
| 470 | srcs: [":keystore2_key_contexts_files"], |
| 471 | system_ext_specific: true, |
| 472 | } |
| 473 | |
| 474 | keystore2_key_contexts { |
| 475 | name: "product_keystore2_key_contexts", |
| 476 | srcs: [":keystore2_key_contexts_files"], |
| 477 | product_specific: true, |
| 478 | } |
| 479 | |
| 480 | keystore2_key_contexts { |
| 481 | name: "vendor_keystore2_key_contexts", |
| 482 | srcs: [":keystore2_key_contexts_files"], |
| 483 | reqd_mask: true, |
| 484 | soc_specific: true, |
| 485 | } |
| 486 | |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 487 | // For vts_treble_sys_prop_test |
| 488 | filegroup { |
| 489 | name: "private_property_contexts", |
| 490 | srcs: ["private/property_contexts"], |
| 491 | visibility: [ |
| 492 | "//test/vts-testcase/security/system_property", |
| 493 | ], |
| 494 | } |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 495 | |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 496 | se_build_files { |
| 497 | name: "se_build_files", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 498 | srcs: [ |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 499 | "security_classes", |
| 500 | "initial_sids", |
| 501 | "access_vectors", |
| 502 | "global_macros", |
| 503 | "neverallow_macros", |
| 504 | "mls_macros", |
| 505 | "mls_decl", |
| 506 | "mls", |
| 507 | "policy_capabilities", |
| 508 | "te_macros", |
| 509 | "attributes", |
| 510 | "ioctl_defines", |
| 511 | "ioctl_macros", |
| 512 | "*.te", |
| 513 | "roles_decl", |
| 514 | "roles", |
| 515 | "users", |
| 516 | "initial_sid_contexts", |
| 517 | "fs_use", |
| 518 | "genfs_contexts", |
| 519 | "port_contexts", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 520 | ], |
| 521 | } |
| 522 | |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 523 | // reqd_policy_mask - a policy.conf file which contains only the bare minimum |
| 524 | // policy necessary to use checkpolicy. |
| 525 | // |
| 526 | // This bare-minimum policy needs to be present in all policy.conf files, but |
| 527 | // should not necessarily be exported as part of the public policy. |
| 528 | // |
| 529 | // The rules generated by reqd_policy_mask will allow the compilation of public |
| 530 | // policy and subsequent removal of CIL policy that should not be exported. |
| 531 | se_policy_conf { |
| 532 | name: "reqd_policy_mask.conf", |
| 533 | srcs: [":se_build_files{.reqd_mask}"], |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 534 | installable: false, |
| 535 | } |
| 536 | |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 537 | se_policy_cil { |
| 538 | name: "reqd_policy_mask.cil", |
| 539 | src: ":reqd_policy_mask.conf", |
| 540 | secilc_check: false, |
| 541 | installable: false, |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 542 | } |
| 543 | |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 544 | // pub_policy - policy that will be exported to be a part of non-platform |
| 545 | // policy corresponding to this platform version. |
| 546 | // |
| 547 | // This is a limited subset of policy that would not compile in checkpolicy on |
| 548 | // its own. |
| 549 | // |
| 550 | // To get around this limitation, add only the required files from private |
| 551 | // policy, which will generate CIL policy that will then be filtered out by the |
| 552 | // reqd_policy_mask. |
| 553 | // |
| 554 | // There are three pub_policy.cil files below: |
| 555 | // - pub_policy.cil: exported 'product', 'system_ext' and 'system' policy. |
| 556 | // - system_ext_pub_policy.cil: exported 'system_ext' and 'system' policy. |
| 557 | // - plat_pub_policy.cil: exported 'system' policy. |
| 558 | // |
| 559 | // Those above files will in turn be used to generate the following versioned cil files: |
| 560 | // - product_mapping_file: the versioned, exported 'product' policy in product partition. |
| 561 | // - system_ext_mapping_file: the versioned, exported 'system_ext' policy in system_ext partition. |
| 562 | // - plat_mapping_file: the versioned, exported 'system' policy in system partition. |
| 563 | // - plat_pub_versioned.cil: the versioned, exported 'product', 'system_ext' and 'system' policy |
| 564 | // in vendor partition. |
| 565 | // |
| 566 | se_policy_conf { |
| 567 | name: "pub_policy.conf", |
| 568 | srcs: [":se_build_files{.product_public}"], // product_ includes system and system_ext |
| 569 | installable: false, |
| 570 | } |
| 571 | |
| 572 | se_policy_cil { |
| 573 | name: "pub_policy.cil", |
| 574 | src: ":pub_policy.conf", |
| 575 | filter_out: [":reqd_policy_mask.cil"], |
| 576 | secilc_check: false, |
| 577 | installable: false, |
| 578 | } |
| 579 | |
| 580 | se_policy_conf { |
| 581 | name: "system_ext_pub_policy.conf", |
| 582 | srcs: [":se_build_files{.system_ext_public}"], // system_ext_public includes system |
| 583 | installable: false, |
| 584 | } |
| 585 | |
| 586 | se_policy_cil { |
| 587 | name: "system_ext_pub_policy.cil", |
| 588 | src: ":system_ext_pub_policy.conf", |
| 589 | filter_out: [":reqd_policy_mask.cil"], |
| 590 | secilc_check: false, |
| 591 | installable: false, |
| 592 | } |
| 593 | |
| 594 | se_policy_conf { |
| 595 | name: "plat_pub_policy.conf", |
| 596 | srcs: [":se_build_files{.plat_public}"], |
| 597 | installable: false, |
| 598 | } |
| 599 | |
| 600 | se_policy_cil { |
| 601 | name: "plat_pub_policy.cil", |
| 602 | src: ":plat_pub_policy.conf", |
| 603 | filter_out: [":reqd_policy_mask.cil"], |
| 604 | secilc_check: false, |
| 605 | installable: false, |
| 606 | } |
| 607 | |
| 608 | // plat_policy.conf - A combination of the private and public platform policy |
| 609 | // which will ship with the device. |
| 610 | // |
| 611 | // The platform will always reflect the most recent platform version and is not |
| 612 | // currently being attributized. |
| 613 | se_policy_conf { |
| 614 | name: "plat_sepolicy.conf", |
| 615 | srcs: [":se_build_files{.plat}"], |
| 616 | installable: false, |
| 617 | } |
| 618 | |
| 619 | se_policy_cil { |
| 620 | name: "plat_sepolicy.cil", |
| 621 | src: ":plat_sepolicy.conf", |
| 622 | additional_cil_files: ["private/technical_debt.cil"], |
| 623 | } |
| 624 | |
| 625 | // system_ext_policy.conf - A combination of the private and public system_ext |
| 626 | // policy which will ship with the device. System_ext policy is not attributized |
| 627 | se_policy_conf { |
| 628 | name: "system_ext_sepolicy.conf", |
| 629 | srcs: [":se_build_files{.system_ext}"], |
| 630 | installable: false, |
| 631 | } |
| 632 | |
| 633 | se_policy_cil { |
| 634 | name: "system_ext_sepolicy.cil", |
| 635 | src: ":system_ext_sepolicy.conf", |
| 636 | system_ext_specific: true, |
| 637 | filter_out: [":plat_sepolicy.cil"], |
| 638 | remove_line_marker: true, |
| 639 | } |
| 640 | |
| 641 | // product_policy.conf - A combination of the private and public product policy |
| 642 | // which will ship with the device. Product policy is not attributized |
| 643 | se_policy_conf { |
| 644 | name: "product_sepolicy.conf", |
| 645 | srcs: [":se_build_files{.product}"], |
| 646 | installable: false, |
| 647 | } |
| 648 | |
| 649 | se_policy_cil { |
| 650 | name: "product_sepolicy.cil", |
| 651 | src: ":product_sepolicy.conf", |
| 652 | product_specific: true, |
| 653 | filter_out: [":plat_sepolicy.cil", ":system_ext_sepolicy.cil"], |
| 654 | remove_line_marker: true, |
| 655 | } |
| 656 | |
| 657 | ////////////////////////////////// |
| 658 | // SELinux policy embedded into CTS. |
| 659 | // CTS checks neverallow rules of this policy against the policy of the device under test. |
| 660 | ////////////////////////////////// |
| 661 | se_policy_conf { |
| 662 | name: "general_sepolicy.conf", |
| 663 | srcs: [":se_build_files{.plat}"], |
| 664 | build_variant: "user", |
| 665 | cts: true, |
| 666 | exclude_build_test: true, |
| 667 | } |
| 668 | |
| 669 | ////////////////////////////////// |
| 670 | // modules for microdroid |
| 671 | // TODO(b/178993690): migrate Android.mk to Android.bp and remove below |
| 672 | ////////////////////////////////// |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 673 | genrule { |
| 674 | name: "microdroid_plat_mapping_file_gen", |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 675 | srcs: [":plat_pub_policy.cil", ":reqd_policy_mask.cil"], |
| 676 | tools: ["build_sepolicy", "version_policy"], |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 677 | out: ["10000.0.cil"], |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 678 | cmd: "$(location build_sepolicy) filter_out -f $(location :reqd_policy_mask.cil) -t $(location :plat_pub_policy.cil)" + |
| 679 | "&& $(location version_policy) -b $(location :plat_pub_policy.cil) -m -n 10000.0 -o $(out)", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 680 | visibility: ["//visibility:private"], |
| 681 | } |
| 682 | |
| 683 | prebuilt_etc { |
| 684 | name: "microdroid_plat_mapping_file", |
| 685 | src: ":microdroid_plat_mapping_file_gen", |
| 686 | filename: "10000.0.cil", |
| 687 | relative_install_path: "selinux/mapping", |
| 688 | installable: false, |
| 689 | } |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 690 | |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 691 | // Normally plat_pub_versioned.cil is built from pub_policy.cil (including system_ext and product). |
| 692 | // But microdroid only has system, so its plat_pub_versioned.cil uses plat_pub_policy.cil. |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 693 | genrule { |
| 694 | name: "microdroid_plat_pub_versioned.cil_gen", |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 695 | srcs: [":plat_pub_policy.cil"], |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 696 | tools: ["version_policy"], |
| 697 | out: ["plat_pub_versioned.cil"], |
| 698 | cmd: "$(location version_policy) " + |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 699 | "-b $(location :plat_pub_policy.cil) " + |
| 700 | "-t $(location :plat_pub_policy.cil) " + |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 701 | "-n 10000.0 " + |
| 702 | "-o $(out)", |
| 703 | visibility: ["//visibility:private"], |
| 704 | } |
| 705 | |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 706 | prebuilt_etc { |
| 707 | name: "microdroid_plat_pub_versioned.cil", |
| 708 | src: ":microdroid_plat_pub_versioned.cil_gen", |
| 709 | filename: "plat_pub_versioned.cil", |
| 710 | relative_install_path: "selinux", |
| 711 | installable: false, |
| 712 | } |
| 713 | |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 714 | filegroup { |
| 715 | name: "microdroid_vendor_sepolicy_build_files", |
| 716 | srcs: [ |
| 717 | "reqd_mask/security_classes", |
| 718 | "reqd_mask/initial_sids", |
| 719 | "reqd_mask/access_vectors", |
| 720 | "public/global_macros", |
| 721 | "public/neverallow_macros", |
| 722 | "reqd_mask/mls_macros", |
| 723 | "reqd_mask/mls_decl", |
| 724 | "reqd_mask/mls", |
| 725 | "public/te_macros", |
| 726 | "public/attributes", |
| 727 | "public/ioctl_defines", |
| 728 | "public/ioctl_macros", |
| 729 | "public/*.te", |
| 730 | "reqd_mask/*.te", |
| 731 | "vendor/*.te", |
| 732 | "reqd_mask/roles_decl", |
| 733 | "public/roles", |
| 734 | "reqd_mask/roles", |
| 735 | "reqd_mask/users", |
| 736 | "reqd_mask/initial_sid_contexts", |
| 737 | ], |
| 738 | } |
| 739 | |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 740 | // These variables are based on aosp_cf_x86_64_only_phone-userdebug. Other than target_arch, |
| 741 | // these configurations should be fine to test microdroid on normal devices with full treble. |
| 742 | // The exception is target_arch. But as target_arch is meaningful only on mips, and as we are not |
| 743 | // running microdroid on mips for now, we skip assigning target_arch here. After cil files are fully |
| 744 | // migrated into Soong, these will have correct values. |
| 745 | policy_to_conf_flags = "$(location m4) --fatal-warnings " + |
| 746 | "-D mls_num_sens=1 -D mls_num_cats=1024 " + |
| 747 | "-D target_build_variant=userdebug " + |
| 748 | "-D target_with_asan=false " + |
| 749 | "-D target_with_native_coverage=false " + |
| 750 | "-D target_full_treble=true " + |
| 751 | "-D target_compatible_property=true " + |
| 752 | "-D target_treble_sysprop_neverallow=true " + |
| 753 | "-D target_enforce_sysprop_owner=true " |
| 754 | |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 755 | genrule { |
| 756 | name: "microdroid_vendor_sepolicy.cil_gen", |
| 757 | srcs: [ |
| 758 | ":microdroid_vendor_sepolicy_build_files", |
| 759 | ":microdroid_plat_pub_versioned.cil_gen", |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 760 | ":pub_policy.cil", |
| 761 | ":reqd_policy_mask.cil", |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 762 | ], |
Jiyong Park | cc9a099 | 2021-03-03 23:36:42 +0900 | [diff] [blame] | 763 | tools: [ |
| 764 | "m4", |
| 765 | "build_sepolicy", |
| 766 | "checkpolicy", |
| 767 | "secilc", |
| 768 | "version_policy", |
| 769 | ], |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 770 | out: ["vendor_sepolicy.cil"], |
| 771 | cmd: policy_to_conf_flags + " -s $(locations :microdroid_vendor_sepolicy_build_files) > $(out).conf && " + |
| 772 | "$(location build_sepolicy) " + |
Jiyong Park | cc9a099 | 2021-03-03 23:36:42 +0900 | [diff] [blame] | 773 | "--android_host_path $$(dirname $(location build_sepolicy)) " + |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 774 | "build_cil " + |
| 775 | "--input_policy_conf $(out).conf " + |
| 776 | "--checkpolicy_env ASAN_OPTIONS=detect_leaks=0 " + |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 777 | "--base_policy $(location :pub_policy.cil) " + |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 778 | "--filter_out_files $(location :microdroid_plat_pub_versioned.cil_gen) " + |
Inseob Kim | 7629e86 | 2021-03-17 19:07:15 +0900 | [diff] [blame^] | 779 | "--reqd_mask $(location :reqd_policy_mask.cil) " + |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 780 | "--treble_sepolicy_vers 10000.0 " + |
| 781 | "--policy_vers 30 " + |
| 782 | "--output_cil $(out)", |
| 783 | visibility: ["//visibility:private"], |
| 784 | } |
| 785 | |
| 786 | prebuilt_etc { |
| 787 | name: "microdroid_vendor_sepolicy.cil", |
| 788 | src: ":microdroid_vendor_sepolicy.cil_gen", |
| 789 | filename: "vendor_sepolicy.cil", |
| 790 | relative_install_path: "selinux", |
| 791 | installable: false, |
| 792 | } |