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 | |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 297 | se_compat_cil { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 298 | name: "26.0.compat.cil", |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 299 | srcs: [":26.0.board.compat.cil"], |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 300 | } |
| 301 | |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 302 | se_compat_cil { |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 303 | name: "27.0.compat.cil", |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 304 | srcs: [":27.0.board.compat.cil"], |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 305 | } |
| 306 | |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 307 | se_compat_cil { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 308 | name: "28.0.compat.cil", |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 309 | srcs: [":28.0.board.compat.cil"], |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 310 | } |
| 311 | |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 312 | se_compat_cil { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 313 | name: "29.0.compat.cil", |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 314 | srcs: [":29.0.board.compat.cil"], |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 315 | } |
| 316 | |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 317 | se_compat_cil { |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 318 | name: "30.0.compat.cil", |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 319 | srcs: [":30.0.board.compat.cil"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 320 | } |
| 321 | |
Yi-Yo Chiang | 8be93c0 | 2021-04-13 02:49:29 +0800 | [diff] [blame] | 322 | se_compat_cil { |
| 323 | name: "system_ext_26.0.compat.cil", |
| 324 | srcs: [":26.0.board.compat.cil"], |
| 325 | stem: "26.0.compat.cil", |
| 326 | system_ext_specific: true, |
| 327 | } |
| 328 | |
| 329 | se_compat_cil { |
| 330 | name: "system_ext_27.0.compat.cil", |
| 331 | srcs: [":27.0.board.compat.cil"], |
| 332 | stem: "27.0.compat.cil", |
| 333 | system_ext_specific: true, |
| 334 | } |
| 335 | |
| 336 | se_compat_cil { |
| 337 | name: "system_ext_28.0.compat.cil", |
| 338 | srcs: [":28.0.board.compat.cil"], |
| 339 | stem: "28.0.compat.cil", |
| 340 | system_ext_specific: true, |
| 341 | } |
| 342 | |
| 343 | se_compat_cil { |
| 344 | name: "system_ext_29.0.compat.cil", |
| 345 | srcs: [":29.0.board.compat.cil"], |
| 346 | stem: "29.0.compat.cil", |
| 347 | system_ext_specific: true, |
| 348 | } |
| 349 | |
| 350 | se_compat_cil { |
| 351 | name: "system_ext_30.0.compat.cil", |
| 352 | srcs: [":30.0.board.compat.cil"], |
| 353 | stem: "30.0.compat.cil", |
| 354 | system_ext_specific: true, |
| 355 | } |
| 356 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 357 | se_filegroup { |
| 358 | name: "file_contexts_files", |
| 359 | srcs: ["file_contexts"], |
| 360 | } |
| 361 | |
| 362 | se_filegroup { |
| 363 | name: "file_contexts_asan_files", |
| 364 | srcs: ["file_contexts_asan"], |
| 365 | } |
| 366 | |
| 367 | se_filegroup { |
| 368 | name: "file_contexts_overlayfs_files", |
| 369 | srcs: ["file_contexts_overlayfs"], |
| 370 | } |
| 371 | |
| 372 | se_filegroup { |
| 373 | name: "hwservice_contexts_files", |
| 374 | srcs: ["hwservice_contexts"], |
| 375 | } |
| 376 | |
| 377 | se_filegroup { |
| 378 | name: "property_contexts_files", |
| 379 | srcs: ["property_contexts"], |
| 380 | } |
| 381 | |
| 382 | se_filegroup { |
| 383 | name: "service_contexts_files", |
| 384 | srcs: ["service_contexts"], |
| 385 | } |
| 386 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 387 | se_filegroup { |
| 388 | name: "keystore2_key_contexts_files", |
| 389 | srcs: ["keystore2_key_contexts"], |
| 390 | } |
| 391 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 392 | file_contexts { |
| 393 | name: "plat_file_contexts", |
| 394 | srcs: [":file_contexts_files"], |
| 395 | product_variables: { |
| 396 | address_sanitize: { |
| 397 | srcs: [":file_contexts_asan_files"], |
| 398 | }, |
| 399 | debuggable: { |
| 400 | srcs: [":file_contexts_overlayfs_files"], |
| 401 | }, |
| 402 | }, |
| 403 | |
| 404 | flatten_apex: { |
| 405 | srcs: ["apex/*-file_contexts"], |
| 406 | }, |
| 407 | |
| 408 | recovery_available: true, |
| 409 | } |
| 410 | |
| 411 | file_contexts { |
| 412 | name: "vendor_file_contexts", |
| 413 | srcs: [":file_contexts_files"], |
| 414 | soc_specific: true, |
| 415 | recovery_available: true, |
| 416 | } |
| 417 | |
| 418 | file_contexts { |
Bowgo Tsai | 86a048d | 2019-09-09 22:04:06 +0800 | [diff] [blame] | 419 | name: "system_ext_file_contexts", |
| 420 | srcs: [":file_contexts_files"], |
| 421 | system_ext_specific: true, |
| 422 | recovery_available: true, |
| 423 | } |
| 424 | |
| 425 | file_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 426 | name: "product_file_contexts", |
| 427 | srcs: [":file_contexts_files"], |
| 428 | product_specific: true, |
| 429 | recovery_available: true, |
| 430 | } |
| 431 | |
| 432 | file_contexts { |
| 433 | name: "odm_file_contexts", |
| 434 | srcs: [":file_contexts_files"], |
| 435 | device_specific: true, |
| 436 | recovery_available: true, |
| 437 | } |
| 438 | |
| 439 | hwservice_contexts { |
| 440 | name: "plat_hwservice_contexts", |
| 441 | srcs: [":hwservice_contexts_files"], |
| 442 | } |
| 443 | |
| 444 | hwservice_contexts { |
Bowgo Tsai | 241d36e | 2019-09-09 22:05:10 +0800 | [diff] [blame] | 445 | name: "system_ext_hwservice_contexts", |
| 446 | srcs: [":hwservice_contexts_files"], |
| 447 | system_ext_specific: true, |
| 448 | } |
| 449 | |
| 450 | hwservice_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 451 | name: "product_hwservice_contexts", |
| 452 | srcs: [":hwservice_contexts_files"], |
| 453 | product_specific: true, |
| 454 | } |
| 455 | |
| 456 | hwservice_contexts { |
| 457 | name: "vendor_hwservice_contexts", |
| 458 | srcs: [":hwservice_contexts_files"], |
| 459 | reqd_mask: true, |
| 460 | soc_specific: true, |
| 461 | } |
| 462 | |
| 463 | hwservice_contexts { |
| 464 | name: "odm_hwservice_contexts", |
| 465 | srcs: [":hwservice_contexts_files"], |
| 466 | device_specific: true, |
| 467 | } |
| 468 | |
| 469 | property_contexts { |
| 470 | name: "plat_property_contexts", |
| 471 | srcs: [":property_contexts_files"], |
| 472 | recovery_available: true, |
| 473 | } |
| 474 | |
| 475 | property_contexts { |
Bowgo Tsai | 1864cd0 | 2019-09-09 18:09:22 +0800 | [diff] [blame] | 476 | name: "system_ext_property_contexts", |
| 477 | srcs: [":property_contexts_files"], |
| 478 | system_ext_specific: true, |
| 479 | recovery_available: true, |
| 480 | } |
| 481 | |
| 482 | property_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 483 | name: "product_property_contexts", |
| 484 | srcs: [":property_contexts_files"], |
| 485 | product_specific: true, |
| 486 | recovery_available: true, |
| 487 | } |
| 488 | |
| 489 | property_contexts { |
| 490 | name: "vendor_property_contexts", |
| 491 | srcs: [":property_contexts_files"], |
| 492 | reqd_mask: true, |
| 493 | soc_specific: true, |
| 494 | recovery_available: true, |
| 495 | } |
| 496 | |
| 497 | property_contexts { |
| 498 | name: "odm_property_contexts", |
| 499 | srcs: [":property_contexts_files"], |
| 500 | device_specific: true, |
| 501 | recovery_available: true, |
| 502 | } |
| 503 | |
| 504 | service_contexts { |
| 505 | name: "plat_service_contexts", |
| 506 | srcs: [":service_contexts_files"], |
| 507 | } |
| 508 | |
| 509 | service_contexts { |
Bowgo Tsai | 9823116 | 2019-09-09 22:05:29 +0800 | [diff] [blame] | 510 | name: "system_ext_service_contexts", |
| 511 | srcs: [":service_contexts_files"], |
| 512 | system_ext_specific: true, |
| 513 | } |
| 514 | |
| 515 | service_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 516 | name: "product_service_contexts", |
| 517 | srcs: [":service_contexts_files"], |
| 518 | product_specific: true, |
| 519 | } |
| 520 | |
| 521 | service_contexts { |
| 522 | name: "vendor_service_contexts", |
| 523 | srcs: [":service_contexts_files"], |
| 524 | reqd_mask: true, |
| 525 | soc_specific: true, |
| 526 | } |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 527 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 528 | keystore2_key_contexts { |
| 529 | name: "plat_keystore2_key_contexts", |
| 530 | srcs: [":keystore2_key_contexts_files"], |
| 531 | } |
| 532 | |
| 533 | keystore2_key_contexts { |
| 534 | name: "system_keystore2_key_contexts", |
| 535 | srcs: [":keystore2_key_contexts_files"], |
| 536 | system_ext_specific: true, |
| 537 | } |
| 538 | |
| 539 | keystore2_key_contexts { |
| 540 | name: "product_keystore2_key_contexts", |
| 541 | srcs: [":keystore2_key_contexts_files"], |
| 542 | product_specific: true, |
| 543 | } |
| 544 | |
| 545 | keystore2_key_contexts { |
| 546 | name: "vendor_keystore2_key_contexts", |
| 547 | srcs: [":keystore2_key_contexts_files"], |
| 548 | reqd_mask: true, |
| 549 | soc_specific: true, |
| 550 | } |
| 551 | |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 552 | // For vts_treble_sys_prop_test |
| 553 | filegroup { |
| 554 | name: "private_property_contexts", |
| 555 | srcs: ["private/property_contexts"], |
| 556 | visibility: [ |
| 557 | "//test/vts-testcase/security/system_property", |
| 558 | ], |
| 559 | } |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 560 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 561 | se_build_files { |
| 562 | name: "se_build_files", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 563 | srcs: [ |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 564 | "security_classes", |
| 565 | "initial_sids", |
| 566 | "access_vectors", |
| 567 | "global_macros", |
| 568 | "neverallow_macros", |
| 569 | "mls_macros", |
| 570 | "mls_decl", |
| 571 | "mls", |
| 572 | "policy_capabilities", |
| 573 | "te_macros", |
| 574 | "attributes", |
| 575 | "ioctl_defines", |
| 576 | "ioctl_macros", |
| 577 | "*.te", |
| 578 | "roles_decl", |
| 579 | "roles", |
| 580 | "users", |
| 581 | "initial_sid_contexts", |
| 582 | "fs_use", |
| 583 | "genfs_contexts", |
| 584 | "port_contexts", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 585 | ], |
| 586 | } |
| 587 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 588 | // reqd_policy_mask - a policy.conf file which contains only the bare minimum |
| 589 | // policy necessary to use checkpolicy. |
| 590 | // |
| 591 | // This bare-minimum policy needs to be present in all policy.conf files, but |
| 592 | // should not necessarily be exported as part of the public policy. |
| 593 | // |
| 594 | // The rules generated by reqd_policy_mask will allow the compilation of public |
| 595 | // policy and subsequent removal of CIL policy that should not be exported. |
| 596 | se_policy_conf { |
| 597 | name: "reqd_policy_mask.conf", |
| 598 | srcs: [":se_build_files{.reqd_mask}"], |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 599 | installable: false, |
| 600 | } |
| 601 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 602 | se_policy_cil { |
| 603 | name: "reqd_policy_mask.cil", |
| 604 | src: ":reqd_policy_mask.conf", |
| 605 | secilc_check: false, |
| 606 | installable: false, |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 607 | } |
| 608 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 609 | // pub_policy - policy that will be exported to be a part of non-platform |
| 610 | // policy corresponding to this platform version. |
| 611 | // |
| 612 | // This is a limited subset of policy that would not compile in checkpolicy on |
| 613 | // its own. |
| 614 | // |
| 615 | // To get around this limitation, add only the required files from private |
| 616 | // policy, which will generate CIL policy that will then be filtered out by the |
| 617 | // reqd_policy_mask. |
| 618 | // |
| 619 | // There are three pub_policy.cil files below: |
| 620 | // - pub_policy.cil: exported 'product', 'system_ext' and 'system' policy. |
| 621 | // - system_ext_pub_policy.cil: exported 'system_ext' and 'system' policy. |
| 622 | // - plat_pub_policy.cil: exported 'system' policy. |
| 623 | // |
| 624 | // Those above files will in turn be used to generate the following versioned cil files: |
| 625 | // - product_mapping_file: the versioned, exported 'product' policy in product partition. |
| 626 | // - system_ext_mapping_file: the versioned, exported 'system_ext' policy in system_ext partition. |
| 627 | // - plat_mapping_file: the versioned, exported 'system' policy in system partition. |
| 628 | // - plat_pub_versioned.cil: the versioned, exported 'product', 'system_ext' and 'system' policy |
| 629 | // in vendor partition. |
| 630 | // |
| 631 | se_policy_conf { |
| 632 | name: "pub_policy.conf", |
| 633 | srcs: [":se_build_files{.product_public}"], // product_ includes system and system_ext |
| 634 | installable: false, |
| 635 | } |
| 636 | |
| 637 | se_policy_cil { |
| 638 | name: "pub_policy.cil", |
| 639 | src: ":pub_policy.conf", |
| 640 | filter_out: [":reqd_policy_mask.cil"], |
| 641 | secilc_check: false, |
| 642 | installable: false, |
| 643 | } |
| 644 | |
| 645 | se_policy_conf { |
| 646 | name: "system_ext_pub_policy.conf", |
| 647 | srcs: [":se_build_files{.system_ext_public}"], // system_ext_public includes system |
| 648 | installable: false, |
| 649 | } |
| 650 | |
| 651 | se_policy_cil { |
| 652 | name: "system_ext_pub_policy.cil", |
| 653 | src: ":system_ext_pub_policy.conf", |
| 654 | filter_out: [":reqd_policy_mask.cil"], |
| 655 | secilc_check: false, |
| 656 | installable: false, |
| 657 | } |
| 658 | |
| 659 | se_policy_conf { |
| 660 | name: "plat_pub_policy.conf", |
| 661 | srcs: [":se_build_files{.plat_public}"], |
| 662 | installable: false, |
| 663 | } |
| 664 | |
| 665 | se_policy_cil { |
| 666 | name: "plat_pub_policy.cil", |
| 667 | src: ":plat_pub_policy.conf", |
| 668 | filter_out: [":reqd_policy_mask.cil"], |
| 669 | secilc_check: false, |
| 670 | installable: false, |
| 671 | } |
| 672 | |
| 673 | // plat_policy.conf - A combination of the private and public platform policy |
| 674 | // which will ship with the device. |
| 675 | // |
| 676 | // The platform will always reflect the most recent platform version and is not |
| 677 | // currently being attributized. |
| 678 | se_policy_conf { |
| 679 | name: "plat_sepolicy.conf", |
| 680 | srcs: [":se_build_files{.plat}"], |
| 681 | installable: false, |
| 682 | } |
| 683 | |
| 684 | se_policy_cil { |
| 685 | name: "plat_sepolicy.cil", |
| 686 | src: ":plat_sepolicy.conf", |
| 687 | additional_cil_files: ["private/technical_debt.cil"], |
| 688 | } |
| 689 | |
Florian Mayer | e10ceab | 2021-04-22 16:38:47 +0000 | [diff] [blame^] | 690 | // userdebug_plat_policy.conf - the userdebug version plat_sepolicy.cil |
| 691 | se_policy_conf { |
| 692 | name: "userdebug_plat_sepolicy.conf", |
| 693 | srcs: [":se_build_files{.plat}"], |
| 694 | build_variant: "userdebug", |
| 695 | installable: false, |
| 696 | } |
| 697 | |
| 698 | se_policy_cil { |
| 699 | name: "userdebug_plat_sepolicy.cil", |
| 700 | src: ":userdebug_plat_sepolicy.conf", |
| 701 | additional_cil_files: ["private/technical_debt.cil"], |
| 702 | debug_ramdisk: true, |
| 703 | } |
| 704 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 705 | // system_ext_policy.conf - A combination of the private and public system_ext |
| 706 | // policy which will ship with the device. System_ext policy is not attributized |
| 707 | se_policy_conf { |
| 708 | name: "system_ext_sepolicy.conf", |
| 709 | srcs: [":se_build_files{.system_ext}"], |
| 710 | installable: false, |
| 711 | } |
| 712 | |
| 713 | se_policy_cil { |
| 714 | name: "system_ext_sepolicy.cil", |
| 715 | src: ":system_ext_sepolicy.conf", |
| 716 | system_ext_specific: true, |
| 717 | filter_out: [":plat_sepolicy.cil"], |
| 718 | remove_line_marker: true, |
| 719 | } |
| 720 | |
| 721 | // product_policy.conf - A combination of the private and public product policy |
| 722 | // which will ship with the device. Product policy is not attributized |
| 723 | se_policy_conf { |
| 724 | name: "product_sepolicy.conf", |
| 725 | srcs: [":se_build_files{.product}"], |
| 726 | installable: false, |
| 727 | } |
| 728 | |
| 729 | se_policy_cil { |
| 730 | name: "product_sepolicy.cil", |
| 731 | src: ":product_sepolicy.conf", |
| 732 | product_specific: true, |
| 733 | filter_out: [":plat_sepolicy.cil", ":system_ext_sepolicy.cil"], |
| 734 | remove_line_marker: true, |
| 735 | } |
| 736 | |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 737 | // policy mapping files |
| 738 | // auto-generate the mapping file for current platform policy, since it needs to |
| 739 | // track platform policy development |
| 740 | se_versioned_policy { |
| 741 | name: "plat_mapping_file", |
| 742 | base: ":plat_pub_policy.cil", |
| 743 | mapping: true, |
| 744 | version: "current", |
| 745 | relative_install_path: "mapping", // install to /system/etc/selinux/mapping |
| 746 | } |
| 747 | |
| 748 | se_versioned_policy { |
| 749 | name: "system_ext_mapping_file", |
| 750 | base: ":system_ext_pub_policy.cil", |
| 751 | mapping: true, |
| 752 | version: "current", |
| 753 | filter_out: [":plat_mapping_file"], |
| 754 | relative_install_path: "mapping", // install to /system_ext/etc/selinux/mapping |
| 755 | system_ext_specific: true, |
| 756 | } |
| 757 | |
| 758 | se_versioned_policy { |
| 759 | name: "product_mapping_file", |
| 760 | base: ":pub_policy.cil", |
| 761 | mapping: true, |
| 762 | version: "current", |
| 763 | filter_out: [":plat_mapping_file", ":system_ext_mapping_file"], |
| 764 | relative_install_path: "mapping", // install to /product/etc/selinux/mapping |
| 765 | product_specific: true, |
| 766 | } |
| 767 | |
| 768 | // plat_pub_versioned.cil - the exported platform policy associated with the version |
| 769 | // that non-platform policy targets. |
| 770 | se_versioned_policy { |
| 771 | name: "plat_pub_versioned.cil", |
| 772 | base: ":pub_policy.cil", |
| 773 | target_policy: ":pub_policy.cil", |
| 774 | version: "current", |
| 775 | dependent_cils: [ |
| 776 | ":plat_sepolicy.cil", |
| 777 | ":system_ext_sepolicy.cil", |
| 778 | ":product_sepolicy.cil", |
| 779 | ":plat_mapping_file", |
| 780 | ":system_ext_mapping_file", |
| 781 | ":product_mapping_file", |
| 782 | ], |
| 783 | vendor: true, |
| 784 | } |
| 785 | |
| 786 | ////////////////////////////////// |
| 787 | // Precompiled sepolicy is loaded if and only if: |
| 788 | // - plat_sepolicy_and_mapping.sha256 equals |
| 789 | // precompiled_sepolicy.plat_sepolicy_and_mapping.sha256 |
| 790 | // AND |
| 791 | // - system_ext_sepolicy_and_mapping.sha256 equals |
| 792 | // precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256 |
| 793 | // AND |
| 794 | // - product_sepolicy_and_mapping.sha256 equals |
| 795 | // precompiled_sepolicy.product_sepolicy_and_mapping.sha256 |
| 796 | // See system/core/init/selinux.cpp for details. |
| 797 | ////////////////////////////////// |
| 798 | genrule { |
| 799 | name: "plat_sepolicy_and_mapping.sha256_gen", |
| 800 | srcs: [":plat_sepolicy.cil", ":plat_mapping_file"], |
| 801 | out: ["plat_sepolicy_and_mapping.sha256"], |
| 802 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 803 | } |
| 804 | |
| 805 | prebuilt_etc { |
| 806 | name: "plat_sepolicy_and_mapping.sha256", |
| 807 | filename: "plat_sepolicy_and_mapping.sha256", |
| 808 | src: ":plat_sepolicy_and_mapping.sha256_gen", |
| 809 | relative_install_path: "selinux", |
| 810 | } |
| 811 | |
| 812 | genrule { |
| 813 | name: "system_ext_sepolicy_and_mapping.sha256_gen", |
| 814 | srcs: [":system_ext_sepolicy.cil", ":system_ext_mapping_file"], |
| 815 | out: ["system_ext_sepolicy_and_mapping.sha256"], |
| 816 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 817 | } |
| 818 | |
| 819 | prebuilt_etc { |
| 820 | name: "system_ext_sepolicy_and_mapping.sha256", |
| 821 | filename: "system_ext_sepolicy_and_mapping.sha256", |
| 822 | src: ":system_ext_sepolicy_and_mapping.sha256_gen", |
| 823 | relative_install_path: "selinux", |
| 824 | system_ext_specific: true, |
| 825 | } |
| 826 | |
| 827 | genrule { |
| 828 | name: "product_sepolicy_and_mapping.sha256_gen", |
| 829 | srcs: [":product_sepolicy.cil", ":product_mapping_file"], |
| 830 | out: ["product_sepolicy_and_mapping.sha256"], |
| 831 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 832 | } |
| 833 | |
| 834 | prebuilt_etc { |
| 835 | name: "product_sepolicy_and_mapping.sha256", |
| 836 | filename: "product_sepolicy_and_mapping.sha256", |
| 837 | src: ":product_sepolicy_and_mapping.sha256_gen", |
| 838 | relative_install_path: "selinux", |
| 839 | product_specific: true, |
| 840 | } |
| 841 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 842 | ////////////////////////////////// |
| 843 | // SELinux policy embedded into CTS. |
| 844 | // CTS checks neverallow rules of this policy against the policy of the device under test. |
| 845 | ////////////////////////////////// |
| 846 | se_policy_conf { |
| 847 | name: "general_sepolicy.conf", |
| 848 | srcs: [":se_build_files{.plat}"], |
| 849 | build_variant: "user", |
| 850 | cts: true, |
| 851 | exclude_build_test: true, |
| 852 | } |
| 853 | |
| 854 | ////////////////////////////////// |
| 855 | // modules for microdroid |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 856 | ////////////////////////////////// |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 857 | |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 858 | // microdroid's system sepolicy is almost identical to host's system sepolicy, except that |
| 859 | // microdroid doesn't have system_ext and product. So microdroid's plat_pub_versioned.cil is |
| 860 | // generated with plat_pub_policy.cil (exported system), not pub_policy.cil (exported system + |
| 861 | // system_ext + product). Other two files, plat_sepolicy.cil and plat_mapping_file, are copied from |
| 862 | // host's files. |
| 863 | se_versioned_policy { |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 864 | name: "microdroid_plat_pub_versioned.cil", |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 865 | stem: "plat_pub_versioned.cil", |
| 866 | base: ":plat_pub_policy.cil", |
| 867 | target_policy: ":plat_pub_policy.cil", |
| 868 | version: "current", |
| 869 | dependent_cils: [ |
| 870 | ":plat_sepolicy.cil", |
| 871 | ":plat_mapping_file", |
| 872 | ], |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 873 | installable: false, |
| 874 | } |
| 875 | |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 876 | // microdroid's vendor sepolicy is a minimalized sepolicy needed for microdroid to boot. It just |
| 877 | // contains system/sepolicy/public and system/sepolicy/vendor. |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 878 | se_policy_conf { |
| 879 | name: "microdroid_vendor_sepolicy.conf", |
Inseob Kim | 39fbcf7 | 2021-04-05 17:52:51 +0900 | [diff] [blame] | 880 | srcs: [":se_build_files{.plat_vendor}"], |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 881 | installable: false, |
| 882 | } |
| 883 | |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 884 | se_policy_cil { |
| 885 | name: "microdroid_vendor_sepolicy.cil.raw", |
| 886 | src: ":microdroid_vendor_sepolicy.conf", |
| 887 | filter_out: [":reqd_policy_mask.cil"], |
| 888 | secilc_check: false, // will be done in se_versioned_policy module |
| 889 | installable: false, |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 890 | } |
| 891 | |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 892 | se_versioned_policy { |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 893 | name: "microdroid_vendor_sepolicy.cil", |
Inseob Kim | 50375ce | 2021-03-25 15:41:06 +0900 | [diff] [blame] | 894 | stem: "vendor_sepolicy.cil", |
| 895 | base: ":plat_pub_policy.cil", |
| 896 | target_policy: ":microdroid_vendor_sepolicy.cil.raw", |
| 897 | version: "current", // microdroid is bundled to system |
| 898 | dependent_cils: [ |
| 899 | ":plat_sepolicy.cil", |
| 900 | ":microdroid_plat_pub_versioned.cil", |
| 901 | ":plat_mapping_file", |
| 902 | ], |
| 903 | filter_out: [":microdroid_plat_pub_versioned.cil"], |
Jiyong Park | d89564e | 2021-03-03 14:56:43 +0000 | [diff] [blame] | 904 | installable: false, |
| 905 | } |