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 | |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 47 | // For vts_treble_sys_prop_test |
| 48 | filegroup { |
| 49 | name: "private_property_contexts", |
| 50 | srcs: ["private/property_contexts"], |
| 51 | visibility: [ |
| 52 | "//test/vts-testcase/security/system_property", |
| 53 | ], |
| 54 | } |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 55 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 56 | se_build_files { |
| 57 | name: "se_build_files", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 58 | srcs: [ |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 59 | "security_classes", |
| 60 | "initial_sids", |
| 61 | "access_vectors", |
| 62 | "global_macros", |
| 63 | "neverallow_macros", |
| 64 | "mls_macros", |
| 65 | "mls_decl", |
| 66 | "mls", |
| 67 | "policy_capabilities", |
| 68 | "te_macros", |
| 69 | "attributes", |
| 70 | "ioctl_defines", |
| 71 | "ioctl_macros", |
| 72 | "*.te", |
| 73 | "roles_decl", |
| 74 | "roles", |
| 75 | "users", |
| 76 | "initial_sid_contexts", |
| 77 | "fs_use", |
| 78 | "genfs_contexts", |
| 79 | "port_contexts", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 80 | ], |
| 81 | } |
| 82 | |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 83 | se_build_files { |
| 84 | name: "sepolicy_technical_debt", |
| 85 | srcs: ["technical_debt.cil"], |
| 86 | } |
| 87 | |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 88 | reqd_mask_policy = [":se_build_files{.reqd_mask}"] |
| 89 | plat_public_policy = [":se_build_files{.plat_public}"] |
| 90 | plat_private_policy = [":se_build_files{.plat_private}"] |
| 91 | system_ext_public_policy = [":se_build_files{.system_ext_public}"] |
| 92 | system_ext_private_policy = [":se_build_files{.system_ext_private}"] |
| 93 | product_public_policy = [":se_build_files{.product_public}"] |
| 94 | product_private_policy = [":se_build_files{.product_private}"] |
| 95 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 96 | // reqd_policy_mask - a policy.conf file which contains only the bare minimum |
| 97 | // policy necessary to use checkpolicy. |
| 98 | // |
| 99 | // This bare-minimum policy needs to be present in all policy.conf files, but |
| 100 | // should not necessarily be exported as part of the public policy. |
| 101 | // |
| 102 | // The rules generated by reqd_policy_mask will allow the compilation of public |
| 103 | // policy and subsequent removal of CIL policy that should not be exported. |
| 104 | se_policy_conf { |
| 105 | name: "reqd_policy_mask.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 106 | srcs: reqd_mask_policy, |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 107 | installable: false, |
| 108 | } |
| 109 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 110 | se_policy_cil { |
| 111 | name: "reqd_policy_mask.cil", |
| 112 | src: ":reqd_policy_mask.conf", |
| 113 | secilc_check: false, |
| 114 | installable: false, |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 115 | } |
| 116 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 117 | // pub_policy - policy that will be exported to be a part of non-platform |
| 118 | // policy corresponding to this platform version. |
| 119 | // |
| 120 | // This is a limited subset of policy that would not compile in checkpolicy on |
| 121 | // its own. |
| 122 | // |
| 123 | // To get around this limitation, add only the required files from private |
| 124 | // policy, which will generate CIL policy that will then be filtered out by the |
| 125 | // reqd_policy_mask. |
| 126 | // |
| 127 | // There are three pub_policy.cil files below: |
| 128 | // - pub_policy.cil: exported 'product', 'system_ext' and 'system' policy. |
| 129 | // - system_ext_pub_policy.cil: exported 'system_ext' and 'system' policy. |
| 130 | // - plat_pub_policy.cil: exported 'system' policy. |
| 131 | // |
| 132 | // Those above files will in turn be used to generate the following versioned cil files: |
| 133 | // - product_mapping_file: the versioned, exported 'product' policy in product partition. |
| 134 | // - system_ext_mapping_file: the versioned, exported 'system_ext' policy in system_ext partition. |
| 135 | // - plat_mapping_file: the versioned, exported 'system' policy in system partition. |
| 136 | // - plat_pub_versioned.cil: the versioned, exported 'product', 'system_ext' and 'system' policy |
| 137 | // in vendor partition. |
| 138 | // |
| 139 | se_policy_conf { |
| 140 | name: "pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 141 | srcs: plat_public_policy + |
| 142 | system_ext_public_policy + |
| 143 | product_public_policy + |
| 144 | reqd_mask_policy, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 145 | vendor: true, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 146 | installable: false, |
| 147 | } |
| 148 | |
| 149 | se_policy_cil { |
| 150 | name: "pub_policy.cil", |
| 151 | src: ":pub_policy.conf", |
| 152 | filter_out: [":reqd_policy_mask.cil"], |
| 153 | secilc_check: false, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 154 | vendor: true, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 155 | installable: false, |
| 156 | } |
| 157 | |
| 158 | se_policy_conf { |
| 159 | name: "system_ext_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 160 | srcs: plat_public_policy + |
| 161 | system_ext_public_policy + |
| 162 | reqd_mask_policy, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 163 | system_ext_specific: true, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 164 | installable: false, |
| 165 | } |
| 166 | |
| 167 | se_policy_cil { |
| 168 | name: "system_ext_pub_policy.cil", |
| 169 | src: ":system_ext_pub_policy.conf", |
| 170 | filter_out: [":reqd_policy_mask.cil"], |
| 171 | secilc_check: false, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 172 | system_ext_specific: true, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 173 | installable: false, |
| 174 | } |
| 175 | |
| 176 | se_policy_conf { |
| 177 | name: "plat_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 178 | srcs: plat_public_policy + |
| 179 | reqd_mask_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 180 | installable: false, |
| 181 | } |
| 182 | |
| 183 | se_policy_cil { |
| 184 | name: "plat_pub_policy.cil", |
| 185 | src: ":plat_pub_policy.conf", |
| 186 | filter_out: [":reqd_policy_mask.cil"], |
| 187 | secilc_check: false, |
| 188 | installable: false, |
| 189 | } |
| 190 | |
| 191 | // plat_policy.conf - A combination of the private and public platform policy |
| 192 | // which will ship with the device. |
| 193 | // |
| 194 | // The platform will always reflect the most recent platform version and is not |
| 195 | // currently being attributized. |
| 196 | se_policy_conf { |
| 197 | name: "plat_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 198 | srcs: plat_public_policy + |
| 199 | plat_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 200 | installable: false, |
| 201 | } |
| 202 | |
| 203 | se_policy_cil { |
| 204 | name: "plat_sepolicy.cil", |
| 205 | src: ":plat_sepolicy.conf", |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 206 | additional_cil_files: [":sepolicy_technical_debt{.plat_private}"], |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 207 | } |
| 208 | |
Lokesh Gidra | 1269a17 | 2022-08-01 17:20:38 +0000 | [diff] [blame] | 209 | |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 210 | // userdebug_plat_policy.conf - the userdebug version plat_sepolicy.cil |
| 211 | se_policy_conf { |
| 212 | name: "userdebug_plat_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 213 | srcs: plat_public_policy + |
| 214 | plat_private_policy, |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 215 | build_variant: "userdebug", |
| 216 | installable: false, |
| 217 | } |
| 218 | |
| 219 | se_policy_cil { |
| 220 | name: "userdebug_plat_sepolicy.cil", |
| 221 | src: ":userdebug_plat_sepolicy.conf", |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 222 | additional_cil_files: [":sepolicy_technical_debt{.plat_private}"], |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 223 | debug_ramdisk: true, |
Yi-Yo Chiang | 68478b1 | 2021-10-16 03:23:05 +0800 | [diff] [blame] | 224 | dist: { |
| 225 | targets: ["droidcore"], |
| 226 | }, |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 227 | } |
| 228 | |
Yi-Yo Chiang | 857ffc4 | 2021-09-23 14:14:16 +0000 | [diff] [blame] | 229 | // A copy of the userdebug_plat_policy in GSI. |
| 230 | soong_config_module_type { |
| 231 | name: "gsi_se_policy_cil", |
| 232 | module_type: "se_policy_cil", |
| 233 | config_namespace: "ANDROID", |
| 234 | bool_variables: [ |
| 235 | "PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT", |
| 236 | ], |
| 237 | properties: [ |
| 238 | "enabled", |
| 239 | "installable", |
| 240 | ], |
| 241 | } |
| 242 | |
| 243 | gsi_se_policy_cil { |
| 244 | name: "system_ext_userdebug_plat_sepolicy.cil", |
| 245 | stem: "userdebug_plat_sepolicy.cil", |
| 246 | src: ":userdebug_plat_sepolicy.conf", |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 247 | additional_cil_files: [":sepolicy_technical_debt{.plat_private}"], |
Yi-Yo Chiang | 857ffc4 | 2021-09-23 14:14:16 +0000 | [diff] [blame] | 248 | system_ext_specific: true, |
| 249 | enabled: false, |
| 250 | installable: false, |
| 251 | soong_config_variables: { |
| 252 | PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT: { |
| 253 | enabled: true, |
| 254 | installable: true, |
| 255 | }, |
| 256 | }, |
| 257 | } |
| 258 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 259 | // system_ext_policy.conf - A combination of the private and public system_ext |
| 260 | // policy which will ship with the device. System_ext policy is not attributized |
| 261 | se_policy_conf { |
| 262 | name: "system_ext_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 263 | srcs: plat_public_policy + |
| 264 | plat_private_policy + |
| 265 | system_ext_public_policy + |
| 266 | system_ext_private_policy, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 267 | system_ext_specific: true, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 268 | installable: false, |
| 269 | } |
| 270 | |
| 271 | se_policy_cil { |
| 272 | name: "system_ext_sepolicy.cil", |
| 273 | src: ":system_ext_sepolicy.conf", |
| 274 | system_ext_specific: true, |
| 275 | filter_out: [":plat_sepolicy.cil"], |
| 276 | remove_line_marker: true, |
| 277 | } |
| 278 | |
| 279 | // product_policy.conf - A combination of the private and public product policy |
| 280 | // which will ship with the device. Product policy is not attributized |
| 281 | se_policy_conf { |
| 282 | name: "product_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 283 | srcs: plat_public_policy + |
| 284 | plat_private_policy + |
| 285 | system_ext_public_policy + |
| 286 | system_ext_private_policy + |
| 287 | product_public_policy + |
| 288 | product_private_policy, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 289 | product_specific: true, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 290 | installable: false, |
| 291 | } |
| 292 | |
| 293 | se_policy_cil { |
| 294 | name: "product_sepolicy.cil", |
| 295 | src: ":product_sepolicy.conf", |
| 296 | product_specific: true, |
| 297 | filter_out: [":plat_sepolicy.cil", ":system_ext_sepolicy.cil"], |
| 298 | remove_line_marker: true, |
| 299 | } |
| 300 | |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 301 | // policy mapping files |
| 302 | // auto-generate the mapping file for current platform policy, since it needs to |
| 303 | // track platform policy development |
| 304 | se_versioned_policy { |
| 305 | name: "plat_mapping_file", |
| 306 | base: ":plat_pub_policy.cil", |
| 307 | mapping: true, |
| 308 | version: "current", |
| 309 | relative_install_path: "mapping", // install to /system/etc/selinux/mapping |
| 310 | } |
| 311 | |
| 312 | se_versioned_policy { |
| 313 | name: "system_ext_mapping_file", |
| 314 | base: ":system_ext_pub_policy.cil", |
| 315 | mapping: true, |
| 316 | version: "current", |
| 317 | filter_out: [":plat_mapping_file"], |
| 318 | relative_install_path: "mapping", // install to /system_ext/etc/selinux/mapping |
| 319 | system_ext_specific: true, |
| 320 | } |
| 321 | |
| 322 | se_versioned_policy { |
| 323 | name: "product_mapping_file", |
| 324 | base: ":pub_policy.cil", |
| 325 | mapping: true, |
| 326 | version: "current", |
| 327 | filter_out: [":plat_mapping_file", ":system_ext_mapping_file"], |
| 328 | relative_install_path: "mapping", // install to /product/etc/selinux/mapping |
| 329 | product_specific: true, |
| 330 | } |
| 331 | |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 332 | ////////////////////////////////// |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 333 | // vendor/odm sepolicy |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 334 | ////////////////////////////////// |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 335 | |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 336 | // plat_pub_versioned.cil - the exported platform policy associated with the version |
| 337 | // that non-platform policy targets. |
| 338 | se_versioned_policy { |
| 339 | name: "plat_pub_versioned.cil", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 340 | base: ":pub_policy.cil", |
| 341 | target_policy: ":pub_policy.cil", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 342 | version: "vendor", |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 343 | vendor: true, |
| 344 | } |
| 345 | |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 346 | // vendor_policy.cil - the vendor sepolicy. This needs attributization and to be combined |
| 347 | // with the platform-provided policy. It makes use of the reqd_policy_mask files from private |
| 348 | // policy and the platform public policy files in order to use checkpolicy. |
| 349 | se_policy_conf { |
| 350 | name: "vendor_sepolicy.conf", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 351 | srcs: plat_public_policy + |
| 352 | system_ext_public_policy + |
| 353 | product_public_policy + |
| 354 | reqd_mask_policy + [ |
| 355 | ":se_build_files{.plat_vendor}", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 356 | ":se_build_files{.vendor}", |
| 357 | ], |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 358 | vendor: true, |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 359 | installable: false, |
| 360 | } |
| 361 | |
| 362 | se_policy_cil { |
| 363 | name: "vendor_sepolicy.cil.raw", |
| 364 | src: ":vendor_sepolicy.conf", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 365 | filter_out: [":reqd_policy_mask.cil"], |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 366 | secilc_check: false, // will be done in se_versioned_policy module |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 367 | vendor: true, |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 368 | installable: false, |
| 369 | } |
| 370 | |
| 371 | se_versioned_policy { |
| 372 | name: "vendor_sepolicy.cil", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 373 | base: ":pub_policy.cil", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 374 | target_policy: ":vendor_sepolicy.cil.raw", |
| 375 | version: "vendor", |
| 376 | dependent_cils: [ |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 377 | ":plat_sepolicy.cil", |
| 378 | ":system_ext_sepolicy.cil", |
| 379 | ":product_sepolicy.cil", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 380 | ":plat_pub_versioned.cil", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 381 | ":plat_mapping_file", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 382 | ], |
| 383 | filter_out: [":plat_pub_versioned.cil"], |
| 384 | vendor: true, |
| 385 | } |
| 386 | |
| 387 | // odm_policy.cil - the odl sepolicy. This needs attributization and to be combined |
| 388 | // with the platform-provided policy. It makes use of the reqd_policy_mask files from private |
| 389 | // policy and the platform public policy files in order to use checkpolicy. |
| 390 | se_policy_conf { |
| 391 | name: "odm_sepolicy.conf", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 392 | srcs: plat_public_policy + |
| 393 | system_ext_public_policy + |
| 394 | product_public_policy + |
| 395 | reqd_mask_policy + [ |
| 396 | ":se_build_files{.plat_vendor}", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 397 | ":se_build_files{.vendor}", |
| 398 | ":se_build_files{.odm}", |
| 399 | ], |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 400 | device_specific: true, |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 401 | installable: false, |
| 402 | } |
| 403 | |
| 404 | se_policy_cil { |
| 405 | name: "odm_sepolicy.cil.raw", |
| 406 | src: ":odm_sepolicy.conf", |
| 407 | filter_out: [ |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 408 | ":reqd_policy_mask.cil", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 409 | ":vendor_sepolicy.cil", |
| 410 | ], |
| 411 | secilc_check: false, // will be done in se_versioned_policy module |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 412 | device_specific: true, |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 413 | installable: false, |
| 414 | } |
| 415 | |
| 416 | se_versioned_policy { |
| 417 | name: "odm_sepolicy.cil", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 418 | base: ":pub_policy.cil", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 419 | target_policy: ":odm_sepolicy.cil.raw", |
| 420 | version: "vendor", |
| 421 | dependent_cils: [ |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 422 | ":plat_sepolicy.cil", |
| 423 | ":system_ext_sepolicy.cil", |
| 424 | ":product_sepolicy.cil", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 425 | ":plat_pub_versioned.cil", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 426 | ":plat_mapping_file", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 427 | ":vendor_sepolicy.cil", |
| 428 | ], |
| 429 | filter_out: [":plat_pub_versioned.cil", ":vendor_sepolicy.cil"], |
| 430 | device_specific: true, |
| 431 | } |
| 432 | |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 433 | ////////////////////////////////// |
| 434 | // Precompiled sepolicy is loaded if and only if: |
| 435 | // - plat_sepolicy_and_mapping.sha256 equals |
| 436 | // precompiled_sepolicy.plat_sepolicy_and_mapping.sha256 |
| 437 | // AND |
| 438 | // - system_ext_sepolicy_and_mapping.sha256 equals |
| 439 | // precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256 |
| 440 | // AND |
| 441 | // - product_sepolicy_and_mapping.sha256 equals |
| 442 | // precompiled_sepolicy.product_sepolicy_and_mapping.sha256 |
| 443 | // See system/core/init/selinux.cpp for details. |
| 444 | ////////////////////////////////// |
| 445 | genrule { |
| 446 | name: "plat_sepolicy_and_mapping.sha256_gen", |
| 447 | srcs: [":plat_sepolicy.cil", ":plat_mapping_file"], |
| 448 | out: ["plat_sepolicy_and_mapping.sha256"], |
| 449 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 450 | } |
| 451 | |
| 452 | prebuilt_etc { |
| 453 | name: "plat_sepolicy_and_mapping.sha256", |
| 454 | filename: "plat_sepolicy_and_mapping.sha256", |
| 455 | src: ":plat_sepolicy_and_mapping.sha256_gen", |
| 456 | relative_install_path: "selinux", |
| 457 | } |
| 458 | |
| 459 | genrule { |
| 460 | name: "system_ext_sepolicy_and_mapping.sha256_gen", |
| 461 | srcs: [":system_ext_sepolicy.cil", ":system_ext_mapping_file"], |
| 462 | out: ["system_ext_sepolicy_and_mapping.sha256"], |
| 463 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 464 | } |
| 465 | |
| 466 | prebuilt_etc { |
| 467 | name: "system_ext_sepolicy_and_mapping.sha256", |
| 468 | filename: "system_ext_sepolicy_and_mapping.sha256", |
| 469 | src: ":system_ext_sepolicy_and_mapping.sha256_gen", |
| 470 | relative_install_path: "selinux", |
| 471 | system_ext_specific: true, |
| 472 | } |
| 473 | |
| 474 | genrule { |
| 475 | name: "product_sepolicy_and_mapping.sha256_gen", |
| 476 | srcs: [":product_sepolicy.cil", ":product_mapping_file"], |
| 477 | out: ["product_sepolicy_and_mapping.sha256"], |
| 478 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 479 | } |
| 480 | |
| 481 | prebuilt_etc { |
| 482 | name: "product_sepolicy_and_mapping.sha256", |
| 483 | filename: "product_sepolicy_and_mapping.sha256", |
| 484 | src: ":product_sepolicy_and_mapping.sha256_gen", |
| 485 | relative_install_path: "selinux", |
| 486 | product_specific: true, |
| 487 | } |
| 488 | |
Inseob Kim | 1c056b1 | 2021-04-30 00:11:43 +0900 | [diff] [blame] | 489 | sepolicy_vers { |
| 490 | name: "plat_sepolicy_vers.txt", |
| 491 | version: "vendor", |
| 492 | vendor: true, |
| 493 | } |
| 494 | |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 495 | soong_config_module_type { |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 496 | name: "precompiled_sepolicy_prebuilts_defaults", |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 497 | module_type: "prebuilt_defaults", |
| 498 | config_namespace: "ANDROID", |
| 499 | bool_variables: ["BOARD_USES_ODMIMAGE"], |
| 500 | properties: ["vendor", "device_specific"], |
| 501 | } |
| 502 | |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 503 | precompiled_sepolicy_prebuilts_defaults { |
| 504 | name: "precompiled_sepolicy_prebuilts", |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 505 | soong_config_variables: { |
| 506 | BOARD_USES_ODMIMAGE: { |
| 507 | device_specific: true, |
| 508 | conditions_default: { |
| 509 | vendor: true, |
| 510 | }, |
| 511 | }, |
| 512 | }, |
| 513 | } |
| 514 | |
| 515 | ////////////////////////////////// |
| 516 | // SHA-256 digest of the plat_sepolicy.cil and plat_mapping_file against |
| 517 | // which precompiled_policy was built. |
| 518 | ////////////////////////////////// |
| 519 | prebuilt_etc { |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 520 | defaults: ["precompiled_sepolicy_prebuilts"], |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 521 | name: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256", |
| 522 | filename: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256", |
| 523 | src: ":plat_sepolicy_and_mapping.sha256_gen", |
| 524 | relative_install_path: "selinux", |
| 525 | } |
| 526 | |
| 527 | ////////////////////////////////// |
| 528 | // SHA-256 digest of the system_ext_sepolicy.cil and system_ext_mapping_file against |
| 529 | // which precompiled_policy was built. |
| 530 | ////////////////////////////////// |
| 531 | prebuilt_etc { |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 532 | defaults: ["precompiled_sepolicy_prebuilts"], |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 533 | name: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256", |
| 534 | filename: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256", |
| 535 | src: ":system_ext_sepolicy_and_mapping.sha256_gen", |
| 536 | relative_install_path: "selinux", |
| 537 | } |
| 538 | |
| 539 | ////////////////////////////////// |
| 540 | // SHA-256 digest of the product_sepolicy.cil and product_mapping_file against |
| 541 | // which precompiled_policy was built. |
| 542 | ////////////////////////////////// |
| 543 | prebuilt_etc { |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 544 | defaults: ["precompiled_sepolicy_prebuilts"], |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 545 | name: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256", |
| 546 | filename: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256", |
| 547 | src: ":product_sepolicy_and_mapping.sha256_gen", |
| 548 | relative_install_path: "selinux", |
| 549 | } |
| 550 | |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 551 | soong_config_module_type { |
| 552 | name: "precompiled_se_policy_binary", |
| 553 | module_type: "se_policy_binary", |
| 554 | config_namespace: "ANDROID", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 555 | bool_variables: ["BOARD_USES_ODMIMAGE"], |
| 556 | properties: ["vendor", "device_specific"], |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 557 | } |
| 558 | |
Garfield Tan | d8c51f2 | 2023-10-02 14:17:04 -0700 | [diff] [blame^] | 559 | filegroup { |
| 560 | name: "precompiled_sepolicy_srcs", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 561 | srcs: [ |
| 562 | ":plat_sepolicy.cil", |
Sandro | 143988d | 2022-08-05 11:38:56 +0000 | [diff] [blame] | 563 | ":plat_pub_versioned.cil", |
| 564 | ":system_ext_sepolicy.cil", |
| 565 | ":product_sepolicy.cil", |
| 566 | ":vendor_sepolicy.cil", |
| 567 | ":odm_sepolicy.cil", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 568 | ":plat_mapping_file", |
| 569 | ":system_ext_mapping_file", |
| 570 | ":product_mapping_file", |
Sandro | 143988d | 2022-08-05 11:38:56 +0000 | [diff] [blame] | 571 | ], |
Garfield Tan | d8c51f2 | 2023-10-02 14:17:04 -0700 | [diff] [blame^] | 572 | // Make precompiled_sepolicy_srcs as public so that OEMs have access to them. |
| 573 | // Useful when some partitions need to be bind mounted across VM boundaries. |
| 574 | visibility: ["//visibility:public"], |
| 575 | } |
| 576 | |
| 577 | precompiled_se_policy_binary { |
| 578 | name: "precompiled_sepolicy", |
| 579 | srcs: [ |
| 580 | ":precompiled_sepolicy_srcs", |
| 581 | ], |
Sandro | 143988d | 2022-08-05 11:38:56 +0000 | [diff] [blame] | 582 | soong_config_variables: { |
| 583 | BOARD_USES_ODMIMAGE: { |
| 584 | device_specific: true, |
| 585 | conditions_default: { |
| 586 | vendor: true, |
| 587 | }, |
| 588 | }, |
Sandro | 143988d | 2022-08-05 11:38:56 +0000 | [diff] [blame] | 589 | }, |
| 590 | required: [ |
| 591 | "sepolicy_neverallows", |
Sandro | 143988d | 2022-08-05 11:38:56 +0000 | [diff] [blame] | 592 | ], |
| 593 | dist: { |
| 594 | targets: ["base-sepolicy-files-for-mapping"], |
| 595 | }, |
| 596 | } |
| 597 | |
Inseob Kim | 5bbcd68 | 2021-12-28 14:57:03 +0900 | [diff] [blame] | 598 | // policy for recovery |
| 599 | se_policy_conf { |
| 600 | name: "recovery_sepolicy.conf", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 601 | srcs: plat_public_policy + |
| 602 | plat_private_policy + |
| 603 | system_ext_public_policy + |
| 604 | system_ext_private_policy + |
| 605 | product_public_policy + |
| 606 | product_private_policy + [ |
| 607 | ":se_build_files{.plat_vendor}", |
Inseob Kim | 5bbcd68 | 2021-12-28 14:57:03 +0900 | [diff] [blame] | 608 | ":se_build_files{.vendor}", |
| 609 | ":se_build_files{.odm}", |
| 610 | ], |
| 611 | target_recovery: true, |
| 612 | installable: false, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 613 | recovery: true, |
Inseob Kim | 5bbcd68 | 2021-12-28 14:57:03 +0900 | [diff] [blame] | 614 | } |
| 615 | |
| 616 | se_policy_cil { |
| 617 | name: "recovery_sepolicy.cil", |
| 618 | src: ":recovery_sepolicy.conf", |
| 619 | secilc_check: false, // will be done in se_policy_binary module |
| 620 | installable: false, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 621 | recovery: true, |
Inseob Kim | 5bbcd68 | 2021-12-28 14:57:03 +0900 | [diff] [blame] | 622 | } |
| 623 | |
| 624 | se_policy_binary { |
| 625 | name: "sepolicy.recovery", |
| 626 | srcs: [":recovery_sepolicy.cil"], |
| 627 | stem: "sepolicy", |
| 628 | recovery: true, |
| 629 | } |
| 630 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 631 | ////////////////////////////////// |
| 632 | // SELinux policy embedded into CTS. |
| 633 | // CTS checks neverallow rules of this policy against the policy of the device under test. |
| 634 | ////////////////////////////////// |
| 635 | se_policy_conf { |
| 636 | name: "general_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 637 | srcs: plat_public_policy + |
| 638 | plat_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 639 | build_variant: "user", |
| 640 | cts: true, |
| 641 | exclude_build_test: true, |
| 642 | } |
Inseob Kim | d581661 | 2021-09-15 03:01:05 +0000 | [diff] [blame] | 643 | |
| 644 | ////////////////////////////////// |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 645 | // Base system policy for treble sepolicy tests. |
| 646 | // If system sepolicy is extended (e.g. by SoC vendors), their plat_pub_versioned.cil may differ |
| 647 | // with system/sepolicy/prebuilts/api/{version}/plat_pub_versioned.cil. In that case, |
| 648 | // BOARD_PLAT_PUB_VERSIONED_POLICY can be used to specify extended plat_pub_versioned.cil. |
| 649 | // See treble_sepolicy_tests_for_release.mk for more details. |
| 650 | ////////////////////////////////// |
| 651 | se_policy_conf { |
| 652 | name: "base_plat_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 653 | srcs: plat_public_policy + |
| 654 | plat_private_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 655 | build_variant: "user", |
| 656 | installable: false, |
| 657 | } |
| 658 | |
| 659 | se_policy_cil { |
| 660 | name: "base_plat_sepolicy.cil", |
| 661 | src: ":base_plat_sepolicy.conf", |
| 662 | additional_cil_files: ["private/technical_debt.cil"], |
| 663 | installable: false, |
| 664 | secilc_check: false, // done by se_policy_binary |
| 665 | } |
| 666 | |
| 667 | se_policy_binary { |
| 668 | name: "base_plat_sepolicy", |
| 669 | srcs: [":base_plat_sepolicy.cil"], |
| 670 | installable: false, |
Inseob Kim | eec3919 | 2022-01-21 11:47:54 +0900 | [diff] [blame] | 671 | dist: { |
| 672 | targets: ["base-sepolicy-files-for-mapping"], |
| 673 | }, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 674 | } |
| 675 | |
| 676 | se_policy_conf { |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 677 | name: "base_product_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 678 | srcs: plat_public_policy + |
| 679 | plat_private_policy + |
| 680 | system_ext_public_policy + |
| 681 | system_ext_private_policy + |
| 682 | product_public_policy + |
| 683 | product_private_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 684 | build_variant: "user", |
| 685 | installable: false, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 686 | product_specific: true, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 687 | } |
| 688 | |
| 689 | se_policy_cil { |
| 690 | name: "base_product_sepolicy.cil", |
| 691 | src: ":base_product_sepolicy.conf", |
| 692 | additional_cil_files: ["private/technical_debt.cil"], |
| 693 | product_specific: true, |
| 694 | installable: false, |
| 695 | secilc_check: false, // done by se_policy_binary |
| 696 | } |
| 697 | |
| 698 | se_policy_binary { |
| 699 | name: "base_product_sepolicy", |
| 700 | srcs: [":base_product_sepolicy.cil"], |
| 701 | product_specific: true, |
| 702 | installable: false, |
| 703 | } |
| 704 | |
| 705 | se_policy_conf { |
| 706 | name: "base_plat_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 707 | srcs: plat_public_policy + |
| 708 | reqd_mask_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 709 | build_variant: "user", |
| 710 | installable: false, |
| 711 | } |
| 712 | |
| 713 | se_policy_cil { |
| 714 | name: "base_plat_pub_policy.cil", |
| 715 | src: ":base_plat_pub_policy.conf", |
| 716 | filter_out: [":reqd_policy_mask.cil"], |
| 717 | secilc_check: false, |
| 718 | installable: false, |
Inseob Kim | eec3919 | 2022-01-21 11:47:54 +0900 | [diff] [blame] | 719 | dist: { |
| 720 | targets: ["base-sepolicy-files-for-mapping"], |
| 721 | }, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | se_policy_conf { |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 725 | name: "base_product_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 726 | srcs: plat_public_policy + |
| 727 | system_ext_public_policy + |
| 728 | product_public_policy + |
| 729 | reqd_mask_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 730 | build_variant: "user", |
| 731 | installable: false, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 732 | product_specific: true, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 733 | } |
| 734 | |
| 735 | se_policy_cil { |
| 736 | name: "base_product_pub_policy.cil", |
| 737 | src: ":base_product_pub_policy.conf", |
| 738 | filter_out: [":reqd_policy_mask.cil"], |
| 739 | secilc_check: false, |
| 740 | installable: false, |
Inseob Kim | 6c6f53b | 2023-04-26 11:03:35 +0900 | [diff] [blame] | 741 | product_specific: true, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 742 | } |
| 743 | |
Yi-Yo Chiang | 2c18965 | 2021-11-08 19:30:04 +0800 | [diff] [blame] | 744 | // bug_map - Bug tracking information for selinux denials loaded by auditd. |
Inseob Kim | 4196403 | 2022-04-22 07:50:22 +0900 | [diff] [blame] | 745 | se_build_files { |
Yi-Yo Chiang | 2c18965 | 2021-11-08 19:30:04 +0800 | [diff] [blame] | 746 | name: "bug_map_files", |
| 747 | srcs: ["bug_map"], |
| 748 | } |
| 749 | |
| 750 | se_bug_map { |
| 751 | name: "plat_bug_map", |
Inseob Kim | 4196403 | 2022-04-22 07:50:22 +0900 | [diff] [blame] | 752 | srcs: [":bug_map_files{.plat_private}"], |
Yi-Yo Chiang | 2c18965 | 2021-11-08 19:30:04 +0800 | [diff] [blame] | 753 | stem: "bug_map", |
| 754 | } |
| 755 | |
| 756 | se_bug_map { |
| 757 | name: "system_ext_bug_map", |
Inseob Kim | 4196403 | 2022-04-22 07:50:22 +0900 | [diff] [blame] | 758 | srcs: [":bug_map_files{.system_ext_private}"], |
Yi-Yo Chiang | 2c18965 | 2021-11-08 19:30:04 +0800 | [diff] [blame] | 759 | stem: "bug_map", |
| 760 | system_ext_specific: true, |
| 761 | } |
| 762 | |
| 763 | se_bug_map { |
| 764 | name: "vendor_bug_map", |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 765 | srcs: [":bug_map_files{.vendor}", ":bug_map_files{.plat_vendor}"], |
Yi-Yo Chiang | 2c18965 | 2021-11-08 19:30:04 +0800 | [diff] [blame] | 766 | // Legacy file name of the vendor partition bug_map. |
| 767 | stem: "selinux_denial_metadata", |
| 768 | vendor: true, |
| 769 | } |
| 770 | |
Inseob Kim | 0de7fcc | 2021-12-22 23:06:53 +0900 | [diff] [blame] | 771 | se_neverallow_test { |
| 772 | name: "sepolicy_neverallows", |
| 773 | srcs: plat_public_policy + |
| 774 | plat_private_policy + |
| 775 | system_ext_public_policy + |
| 776 | system_ext_private_policy + |
| 777 | product_public_policy + |
Inseob Kim | 6c6aa01 | 2023-08-31 16:47:38 +0900 | [diff] [blame] | 778 | product_private_policy + [ |
| 779 | ":se_build_files{.plat_vendor}", |
Inseob Kim | 0de7fcc | 2021-12-22 23:06:53 +0900 | [diff] [blame] | 780 | ":se_build_files{.vendor}", |
| 781 | ":se_build_files{.odm}", |
| 782 | ], |
| 783 | } |
| 784 | |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 785 | ////////////////////////////////// |
Inseob Kim | d581661 | 2021-09-15 03:01:05 +0000 | [diff] [blame] | 786 | // se_freeze_test compares the plat sepolicy with the prebuilt sepolicy |
| 787 | // Additional directories can be specified via Makefile variables: |
| 788 | // SEPOLICY_FREEZE_TEST_EXTRA_DIRS and SEPOLICY_FREEZE_TEST_EXTRA_PREBUILT_DIRS. |
| 789 | ////////////////////////////////// |
| 790 | se_freeze_test { |
Inseob Kim | 36d9d39 | 2023-09-04 17:40:03 +0900 | [diff] [blame] | 791 | name: "se_freeze_test", |
Inseob Kim | d581661 | 2021-09-15 03:01:05 +0000 | [diff] [blame] | 792 | } |
Inseob Kim | 61257ca | 2022-02-25 11:26:16 +0900 | [diff] [blame] | 793 | |
| 794 | ////////////////////////////////// |
| 795 | // sepolicy_test checks various types of violations, which can't be easily done |
| 796 | // by CIL itself. Refer tests/sepolicy_tests.py for more detail. |
| 797 | ////////////////////////////////// |
| 798 | genrule { |
| 799 | name: "sepolicy_test", |
| 800 | srcs: [ |
| 801 | ":plat_file_contexts", |
| 802 | ":vendor_file_contexts", |
| 803 | ":system_ext_file_contexts", |
| 804 | ":product_file_contexts", |
| 805 | ":odm_file_contexts", |
| 806 | ":precompiled_sepolicy", |
| 807 | ], |
| 808 | tools: ["sepolicy_tests"], |
| 809 | out: ["sepolicy_test"], |
| 810 | cmd: "$(location sepolicy_tests) " + |
| 811 | "-f $(location :plat_file_contexts) " + |
| 812 | "-f $(location :vendor_file_contexts) " + |
| 813 | "-f $(location :system_ext_file_contexts) " + |
| 814 | "-f $(location :product_file_contexts) " + |
| 815 | "-f $(location :odm_file_contexts) " + |
| 816 | "-p $(location :precompiled_sepolicy) && " + |
| 817 | "touch $(out)", |
| 818 | } |