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 { |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 48 | name: "28.0.board.compat.map", |
| 49 | srcs: [ |
| 50 | "compat/28.0/28.0.cil", |
| 51 | ], |
| 52 | } |
| 53 | |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 54 | se_filegroup { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 55 | name: "29.0.board.compat.map", |
| 56 | srcs: [ |
| 57 | "compat/29.0/29.0.cil", |
| 58 | ], |
| 59 | } |
| 60 | |
| 61 | se_filegroup { |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 62 | name: "30.0.board.compat.map", |
| 63 | srcs: [ |
| 64 | "compat/30.0/30.0.cil", |
| 65 | ], |
| 66 | } |
| 67 | |
| 68 | se_filegroup { |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 69 | name: "31.0.board.compat.map", |
| 70 | srcs: [ |
| 71 | "compat/31.0/31.0.cil", |
| 72 | ], |
| 73 | } |
| 74 | |
| 75 | se_filegroup { |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 76 | name: "32.0.board.compat.map", |
| 77 | srcs: [ |
| 78 | "compat/32.0/32.0.cil", |
| 79 | ], |
| 80 | } |
| 81 | |
| 82 | se_filegroup { |
Yi-Yo Chiang | 8be93c0 | 2021-04-13 02:49:29 +0800 | [diff] [blame] | 83 | name: "28.0.board.compat.cil", |
| 84 | srcs: [ |
| 85 | "compat/28.0/28.0.compat.cil", |
| 86 | ], |
| 87 | } |
| 88 | |
| 89 | se_filegroup { |
| 90 | name: "29.0.board.compat.cil", |
| 91 | srcs: [ |
| 92 | "compat/29.0/29.0.compat.cil", |
| 93 | ], |
| 94 | } |
| 95 | |
| 96 | se_filegroup { |
| 97 | name: "30.0.board.compat.cil", |
| 98 | srcs: [ |
| 99 | "compat/30.0/30.0.compat.cil", |
| 100 | ], |
| 101 | } |
| 102 | |
| 103 | se_filegroup { |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 104 | name: "31.0.board.compat.cil", |
| 105 | srcs: [ |
| 106 | "compat/31.0/31.0.compat.cil", |
| 107 | ], |
| 108 | } |
| 109 | |
| 110 | se_filegroup { |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 111 | name: "32.0.board.compat.cil", |
| 112 | srcs: [ |
| 113 | "compat/32.0/32.0.compat.cil", |
| 114 | ], |
| 115 | } |
| 116 | |
| 117 | se_filegroup { |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 118 | name: "28.0.board.ignore.map", |
| 119 | srcs: [ |
| 120 | "compat/28.0/28.0.ignore.cil", |
| 121 | ], |
| 122 | } |
| 123 | |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 124 | se_filegroup { |
| 125 | name: "29.0.board.ignore.map", |
| 126 | srcs: [ |
| 127 | "compat/29.0/29.0.ignore.cil", |
| 128 | ], |
| 129 | } |
| 130 | |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 131 | se_filegroup { |
| 132 | name: "30.0.board.ignore.map", |
| 133 | srcs: [ |
| 134 | "compat/30.0/30.0.ignore.cil", |
| 135 | ], |
| 136 | } |
| 137 | |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 138 | se_filegroup { |
| 139 | name: "31.0.board.ignore.map", |
| 140 | srcs: [ |
| 141 | "compat/31.0/31.0.ignore.cil", |
| 142 | ], |
| 143 | } |
| 144 | |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 145 | se_filegroup { |
| 146 | name: "32.0.board.ignore.map", |
| 147 | srcs: [ |
| 148 | "compat/32.0/32.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_28.0.cil", |
| 154 | stem: "28.0.cil", |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 155 | bottom_half: [":28.0.board.compat.map"], |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 156 | top_half: "plat_29.0.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -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_29.0.cil", |
| 161 | stem: "29.0.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 162 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 163 | top_half: "plat_30.0.cil", |
| 164 | } |
| 165 | |
| 166 | se_cil_compat_map { |
| 167 | name: "plat_30.0.cil", |
| 168 | stem: "30.0.cil", |
| 169 | bottom_half: [":30.0.board.compat.map"], |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 170 | top_half: "plat_31.0.cil", |
| 171 | } |
| 172 | |
| 173 | se_cil_compat_map { |
| 174 | name: "plat_31.0.cil", |
| 175 | stem: "31.0.cil", |
| 176 | bottom_half: [":31.0.board.compat.map"], |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 177 | top_half: "plat_32.0.cil", |
| 178 | } |
| 179 | |
| 180 | se_cil_compat_map { |
| 181 | name: "plat_32.0.cil", |
| 182 | stem: "32.0.cil", |
| 183 | bottom_half: [":32.0.board.compat.map"], |
| 184 | // top_half: "plat_33.0.cil", |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 185 | } |
| 186 | |
| 187 | se_cil_compat_map { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 188 | name: "system_ext_28.0.cil", |
| 189 | stem: "28.0.cil", |
| 190 | bottom_half: [":28.0.board.compat.map"], |
| 191 | top_half: "system_ext_29.0.cil", |
| 192 | system_ext_specific: true, |
| 193 | } |
| 194 | |
| 195 | se_cil_compat_map { |
| 196 | name: "system_ext_29.0.cil", |
| 197 | stem: "29.0.cil", |
| 198 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 199 | top_half: "system_ext_30.0.cil", |
| 200 | system_ext_specific: true, |
| 201 | } |
| 202 | |
| 203 | se_cil_compat_map { |
| 204 | name: "system_ext_30.0.cil", |
| 205 | stem: "30.0.cil", |
| 206 | bottom_half: [":30.0.board.compat.map"], |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 207 | top_half: "system_ext_31.0.cil", |
| 208 | system_ext_specific: true, |
| 209 | } |
| 210 | |
| 211 | se_cil_compat_map { |
| 212 | name: "system_ext_31.0.cil", |
| 213 | stem: "31.0.cil", |
| 214 | bottom_half: [":31.0.board.compat.map"], |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 215 | top_half: "system_ext_32.0.cil", |
| 216 | system_ext_specific: true, |
| 217 | } |
| 218 | |
| 219 | se_cil_compat_map { |
| 220 | name: "system_ext_32.0.cil", |
| 221 | stem: "32.0.cil", |
| 222 | bottom_half: [":32.0.board.compat.map"], |
| 223 | // top_half: "system_ext_33.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 { |
Tri Vo | 6117855 | 2019-10-10 16:29:40 -0700 | [diff] [blame] | 228 | name: "product_28.0.cil", |
| 229 | stem: "28.0.cil", |
| 230 | bottom_half: [":28.0.board.compat.map"], |
| 231 | top_half: "product_29.0.cil", |
| 232 | product_specific: true, |
| 233 | } |
| 234 | |
| 235 | se_cil_compat_map { |
| 236 | name: "product_29.0.cil", |
| 237 | stem: "29.0.cil", |
| 238 | bottom_half: [":29.0.board.compat.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 239 | top_half: "product_30.0.cil", |
| 240 | product_specific: true, |
| 241 | } |
| 242 | |
| 243 | se_cil_compat_map { |
| 244 | name: "product_30.0.cil", |
| 245 | stem: "30.0.cil", |
| 246 | bottom_half: [":30.0.board.compat.map"], |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 247 | top_half: "product_31.0.cil", |
| 248 | product_specific: true, |
| 249 | } |
| 250 | |
| 251 | se_cil_compat_map { |
| 252 | name: "product_31.0.cil", |
| 253 | stem: "31.0.cil", |
| 254 | bottom_half: [":31.0.board.compat.map"], |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 255 | top_half: "product_32.0.cil", |
| 256 | product_specific: true, |
| 257 | } |
| 258 | |
| 259 | se_cil_compat_map { |
| 260 | name: "product_32.0.cil", |
| 261 | stem: "32.0.cil", |
| 262 | bottom_half: [":32.0.board.compat.map"], |
| 263 | // top_half: "product_33.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 { |
Tri Vo | 438684b | 2018-09-29 17:47:10 -0700 | [diff] [blame] | 268 | name: "28.0.ignore.cil", |
Jinguang Dong | e012569 | 2019-03-05 17:20:54 +0800 | [diff] [blame] | 269 | bottom_half: [":28.0.board.ignore.map"], |
Tri Vo | e381deb | 2019-06-12 15:52:30 -0700 | [diff] [blame] | 270 | top_half: "29.0.ignore.cil", |
Jae Shin | 1fa9634 | 2018-07-11 18:30:44 +0900 | [diff] [blame] | 271 | } |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 272 | |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 273 | se_cil_compat_map { |
| 274 | name: "29.0.ignore.cil", |
| 275 | bottom_half: [":29.0.board.ignore.map"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 276 | top_half: "30.0.ignore.cil", |
| 277 | } |
| 278 | |
| 279 | se_cil_compat_map { |
| 280 | name: "30.0.ignore.cil", |
| 281 | bottom_half: [":30.0.board.ignore.map"], |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 282 | top_half: "31.0.ignore.cil", |
| 283 | } |
| 284 | |
| 285 | se_cil_compat_map { |
| 286 | name: "31.0.ignore.cil", |
| 287 | bottom_half: [":31.0.board.ignore.map"], |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 288 | top_half: "32.0.ignore.cil", |
| 289 | } |
| 290 | |
| 291 | se_cil_compat_map { |
| 292 | name: "32.0.ignore.cil", |
| 293 | bottom_half: [":32.0.board.ignore.map"], |
| 294 | // top_half: "33.0.ignore.cil", |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 295 | } |
| 296 | |
P.Adarsh Reddy | 07dd59f | 2021-03-22 15:55:09 +0530 | [diff] [blame] | 297 | se_cil_compat_map { |
| 298 | name: "system_ext_30.0.ignore.cil", |
| 299 | bottom_half: [":30.0.board.ignore.map"], |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 300 | top_half: "system_ext_31.0.ignore.cil", |
| 301 | system_ext_specific: true, |
| 302 | } |
| 303 | |
| 304 | se_cil_compat_map { |
| 305 | name: "system_ext_31.0.ignore.cil", |
| 306 | bottom_half: [":31.0.board.ignore.map"], |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 307 | top_half: "system_ext_32.0.ignore.cil", |
| 308 | system_ext_specific: true, |
| 309 | } |
| 310 | |
| 311 | se_cil_compat_map { |
| 312 | name: "system_ext_32.0.ignore.cil", |
| 313 | bottom_half: [":32.0.board.ignore.map"], |
| 314 | // top_half: "system_ext_33.0.ignore.cil", |
P.Adarsh Reddy | 07dd59f | 2021-03-22 15:55:09 +0530 | [diff] [blame] | 315 | system_ext_specific: true, |
| 316 | } |
| 317 | |
| 318 | se_cil_compat_map { |
| 319 | name: "product_30.0.ignore.cil", |
| 320 | bottom_half: [":30.0.board.ignore.map"], |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 321 | top_half: "product_31.0.ignore.cil", |
| 322 | product_specific: true, |
| 323 | } |
| 324 | |
| 325 | se_cil_compat_map { |
| 326 | name: "product_31.0.ignore.cil", |
| 327 | bottom_half: [":31.0.board.ignore.map"], |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 328 | top_half: "product_32.0.ignore.cil", |
| 329 | product_specific: true, |
| 330 | } |
| 331 | |
| 332 | se_cil_compat_map { |
| 333 | name: "product_32.0.ignore.cil", |
| 334 | bottom_half: [":32.0.board.ignore.map"], |
| 335 | // top_half: "product_33.0.ignore.cil", |
P.Adarsh Reddy | 07dd59f | 2021-03-22 15:55:09 +0530 | [diff] [blame] | 336 | product_specific: true, |
| 337 | } |
| 338 | |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 339 | se_compat_cil { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 340 | name: "28.0.compat.cil", |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 341 | srcs: [":28.0.board.compat.cil"], |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 342 | } |
| 343 | |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 344 | se_compat_cil { |
Tri Vo | 50aa029 | 2019-06-01 17:04:13 -0700 | [diff] [blame] | 345 | name: "29.0.compat.cil", |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 346 | srcs: [":29.0.board.compat.cil"], |
Jeff Vander Stoep | 564e292 | 2019-05-02 13:48:44 -0700 | [diff] [blame] | 347 | } |
| 348 | |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 349 | se_compat_cil { |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 350 | name: "30.0.compat.cil", |
Yi-Yo Chiang | a225112 | 2021-04-13 02:51:48 +0800 | [diff] [blame] | 351 | srcs: [":30.0.board.compat.cil"], |
Inseob Kim | ace36ab | 2020-05-07 20:19:05 +0900 | [diff] [blame] | 352 | } |
| 353 | |
Yi-Yo Chiang | 8be93c0 | 2021-04-13 02:49:29 +0800 | [diff] [blame] | 354 | se_compat_cil { |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 355 | name: "31.0.compat.cil", |
| 356 | srcs: [":31.0.board.compat.cil"], |
| 357 | } |
| 358 | |
| 359 | se_compat_cil { |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 360 | name: "32.0.compat.cil", |
| 361 | srcs: [":32.0.board.compat.cil"], |
| 362 | } |
| 363 | |
| 364 | se_compat_cil { |
Yi-Yo Chiang | 8be93c0 | 2021-04-13 02:49:29 +0800 | [diff] [blame] | 365 | name: "system_ext_28.0.compat.cil", |
| 366 | srcs: [":28.0.board.compat.cil"], |
| 367 | stem: "28.0.compat.cil", |
| 368 | system_ext_specific: true, |
| 369 | } |
| 370 | |
| 371 | se_compat_cil { |
| 372 | name: "system_ext_29.0.compat.cil", |
| 373 | srcs: [":29.0.board.compat.cil"], |
| 374 | stem: "29.0.compat.cil", |
| 375 | system_ext_specific: true, |
| 376 | } |
| 377 | |
| 378 | se_compat_cil { |
| 379 | name: "system_ext_30.0.compat.cil", |
| 380 | srcs: [":30.0.board.compat.cil"], |
| 381 | stem: "30.0.compat.cil", |
| 382 | system_ext_specific: true, |
| 383 | } |
| 384 | |
Inseob Kim | 4f20ff7 | 2021-06-15 21:05:39 +0900 | [diff] [blame] | 385 | se_compat_cil { |
| 386 | name: "system_ext_31.0.compat.cil", |
| 387 | srcs: [":31.0.board.compat.cil"], |
| 388 | stem: "31.0.compat.cil", |
| 389 | system_ext_specific: true, |
| 390 | } |
| 391 | |
Inseob Kim | bee558e | 2021-11-30 14:58:10 +0900 | [diff] [blame] | 392 | se_compat_cil { |
| 393 | name: "system_ext_32.0.compat.cil", |
| 394 | srcs: [":32.0.board.compat.cil"], |
| 395 | stem: "32.0.compat.cil", |
| 396 | system_ext_specific: true, |
| 397 | } |
| 398 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 399 | se_filegroup { |
| 400 | name: "file_contexts_files", |
| 401 | srcs: ["file_contexts"], |
| 402 | } |
| 403 | |
| 404 | se_filegroup { |
| 405 | name: "file_contexts_asan_files", |
| 406 | srcs: ["file_contexts_asan"], |
| 407 | } |
| 408 | |
| 409 | se_filegroup { |
| 410 | name: "file_contexts_overlayfs_files", |
| 411 | srcs: ["file_contexts_overlayfs"], |
| 412 | } |
| 413 | |
| 414 | se_filegroup { |
| 415 | name: "hwservice_contexts_files", |
| 416 | srcs: ["hwservice_contexts"], |
| 417 | } |
| 418 | |
| 419 | se_filegroup { |
| 420 | name: "property_contexts_files", |
| 421 | srcs: ["property_contexts"], |
| 422 | } |
| 423 | |
| 424 | se_filegroup { |
| 425 | name: "service_contexts_files", |
| 426 | srcs: ["service_contexts"], |
| 427 | } |
| 428 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 429 | se_filegroup { |
| 430 | name: "keystore2_key_contexts_files", |
| 431 | srcs: ["keystore2_key_contexts"], |
| 432 | } |
| 433 | |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 434 | file_contexts { |
| 435 | name: "plat_file_contexts", |
| 436 | srcs: [":file_contexts_files"], |
| 437 | product_variables: { |
| 438 | address_sanitize: { |
| 439 | srcs: [":file_contexts_asan_files"], |
| 440 | }, |
| 441 | debuggable: { |
| 442 | srcs: [":file_contexts_overlayfs_files"], |
| 443 | }, |
| 444 | }, |
| 445 | |
| 446 | flatten_apex: { |
| 447 | srcs: ["apex/*-file_contexts"], |
| 448 | }, |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 449 | } |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 450 | |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 451 | file_contexts { |
| 452 | name: "plat_file_contexts.recovery", |
| 453 | srcs: [":file_contexts_files"], |
| 454 | stem: "plat_file_contexts", |
| 455 | product_variables: { |
| 456 | address_sanitize: { |
| 457 | srcs: [":file_contexts_asan_files"], |
| 458 | }, |
| 459 | debuggable: { |
| 460 | srcs: [":file_contexts_overlayfs_files"], |
| 461 | }, |
| 462 | }, |
| 463 | |
| 464 | flatten_apex: { |
| 465 | srcs: ["apex/*-file_contexts"], |
| 466 | }, |
| 467 | |
| 468 | recovery: true, |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 469 | } |
| 470 | |
| 471 | file_contexts { |
| 472 | name: "vendor_file_contexts", |
| 473 | srcs: [":file_contexts_files"], |
| 474 | soc_specific: true, |
| 475 | recovery_available: true, |
| 476 | } |
| 477 | |
| 478 | file_contexts { |
Bowgo Tsai | 86a048d | 2019-09-09 22:04:06 +0800 | [diff] [blame] | 479 | name: "system_ext_file_contexts", |
| 480 | srcs: [":file_contexts_files"], |
| 481 | system_ext_specific: true, |
| 482 | recovery_available: true, |
| 483 | } |
| 484 | |
| 485 | file_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 486 | name: "product_file_contexts", |
| 487 | srcs: [":file_contexts_files"], |
| 488 | product_specific: true, |
| 489 | recovery_available: true, |
| 490 | } |
| 491 | |
| 492 | file_contexts { |
| 493 | name: "odm_file_contexts", |
| 494 | srcs: [":file_contexts_files"], |
| 495 | device_specific: true, |
| 496 | recovery_available: true, |
| 497 | } |
| 498 | |
| 499 | hwservice_contexts { |
| 500 | name: "plat_hwservice_contexts", |
| 501 | srcs: [":hwservice_contexts_files"], |
| 502 | } |
| 503 | |
| 504 | hwservice_contexts { |
Bowgo Tsai | 241d36e | 2019-09-09 22:05:10 +0800 | [diff] [blame] | 505 | name: "system_ext_hwservice_contexts", |
| 506 | srcs: [":hwservice_contexts_files"], |
| 507 | system_ext_specific: true, |
| 508 | } |
| 509 | |
| 510 | hwservice_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 511 | name: "product_hwservice_contexts", |
| 512 | srcs: [":hwservice_contexts_files"], |
| 513 | product_specific: true, |
| 514 | } |
| 515 | |
| 516 | hwservice_contexts { |
| 517 | name: "vendor_hwservice_contexts", |
| 518 | srcs: [":hwservice_contexts_files"], |
| 519 | reqd_mask: true, |
| 520 | soc_specific: true, |
| 521 | } |
| 522 | |
| 523 | hwservice_contexts { |
| 524 | name: "odm_hwservice_contexts", |
| 525 | srcs: [":hwservice_contexts_files"], |
| 526 | device_specific: true, |
| 527 | } |
| 528 | |
| 529 | property_contexts { |
| 530 | name: "plat_property_contexts", |
| 531 | srcs: [":property_contexts_files"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 532 | } |
| 533 | |
| 534 | property_contexts { |
| 535 | name: "plat_property_contexts.recovery", |
| 536 | srcs: [":property_contexts_files"], |
| 537 | stem: "plat_property_contexts", |
| 538 | recovery: true, |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 539 | } |
| 540 | |
| 541 | property_contexts { |
Bowgo Tsai | 1864cd0 | 2019-09-09 18:09:22 +0800 | [diff] [blame] | 542 | name: "system_ext_property_contexts", |
| 543 | srcs: [":property_contexts_files"], |
| 544 | system_ext_specific: true, |
| 545 | recovery_available: true, |
| 546 | } |
| 547 | |
| 548 | property_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 549 | name: "product_property_contexts", |
| 550 | srcs: [":property_contexts_files"], |
| 551 | product_specific: true, |
| 552 | recovery_available: true, |
| 553 | } |
| 554 | |
| 555 | property_contexts { |
| 556 | name: "vendor_property_contexts", |
| 557 | srcs: [":property_contexts_files"], |
| 558 | reqd_mask: true, |
| 559 | soc_specific: true, |
| 560 | recovery_available: true, |
| 561 | } |
| 562 | |
| 563 | property_contexts { |
| 564 | name: "odm_property_contexts", |
| 565 | srcs: [":property_contexts_files"], |
| 566 | device_specific: true, |
| 567 | recovery_available: true, |
| 568 | } |
| 569 | |
| 570 | service_contexts { |
| 571 | name: "plat_service_contexts", |
| 572 | srcs: [":service_contexts_files"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 573 | } |
| 574 | |
| 575 | service_contexts { |
| 576 | name: "plat_service_contexts.recovery", |
| 577 | srcs: [":service_contexts_files"], |
| 578 | stem: "plat_service_contexts", |
| 579 | recovery: true, |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 580 | } |
| 581 | |
| 582 | service_contexts { |
Bowgo Tsai | 9823116 | 2019-09-09 22:05:29 +0800 | [diff] [blame] | 583 | name: "system_ext_service_contexts", |
| 584 | srcs: [":service_contexts_files"], |
| 585 | system_ext_specific: true, |
Yifan Hong | d6b2901 | 2021-11-13 00:22:01 -0800 | [diff] [blame] | 586 | recovery_available: true, |
Bowgo Tsai | 9823116 | 2019-09-09 22:05:29 +0800 | [diff] [blame] | 587 | } |
| 588 | |
| 589 | service_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 590 | name: "product_service_contexts", |
| 591 | srcs: [":service_contexts_files"], |
| 592 | product_specific: true, |
Yifan Hong | d6b2901 | 2021-11-13 00:22:01 -0800 | [diff] [blame] | 593 | recovery_available: true, |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 594 | } |
| 595 | |
| 596 | service_contexts { |
| 597 | name: "vendor_service_contexts", |
| 598 | srcs: [":service_contexts_files"], |
| 599 | reqd_mask: true, |
| 600 | soc_specific: true, |
Yifan Hong | d6b2901 | 2021-11-13 00:22:01 -0800 | [diff] [blame] | 601 | recovery_available: true, |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 602 | } |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 603 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 604 | keystore2_key_contexts { |
| 605 | name: "plat_keystore2_key_contexts", |
| 606 | srcs: [":keystore2_key_contexts_files"], |
| 607 | } |
| 608 | |
| 609 | keystore2_key_contexts { |
| 610 | name: "system_keystore2_key_contexts", |
| 611 | srcs: [":keystore2_key_contexts_files"], |
| 612 | system_ext_specific: true, |
| 613 | } |
| 614 | |
| 615 | keystore2_key_contexts { |
| 616 | name: "product_keystore2_key_contexts", |
| 617 | srcs: [":keystore2_key_contexts_files"], |
| 618 | product_specific: true, |
| 619 | } |
| 620 | |
| 621 | keystore2_key_contexts { |
| 622 | name: "vendor_keystore2_key_contexts", |
| 623 | srcs: [":keystore2_key_contexts_files"], |
| 624 | reqd_mask: true, |
| 625 | soc_specific: true, |
| 626 | } |
| 627 | |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 628 | // For vts_treble_sys_prop_test |
| 629 | filegroup { |
| 630 | name: "private_property_contexts", |
| 631 | srcs: ["private/property_contexts"], |
| 632 | visibility: [ |
| 633 | "//test/vts-testcase/security/system_property", |
| 634 | ], |
| 635 | } |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 636 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 637 | se_build_files { |
| 638 | name: "se_build_files", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 639 | srcs: [ |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 640 | "security_classes", |
| 641 | "initial_sids", |
| 642 | "access_vectors", |
| 643 | "global_macros", |
| 644 | "neverallow_macros", |
| 645 | "mls_macros", |
| 646 | "mls_decl", |
| 647 | "mls", |
| 648 | "policy_capabilities", |
| 649 | "te_macros", |
| 650 | "attributes", |
| 651 | "ioctl_defines", |
| 652 | "ioctl_macros", |
| 653 | "*.te", |
| 654 | "roles_decl", |
| 655 | "roles", |
| 656 | "users", |
| 657 | "initial_sid_contexts", |
| 658 | "fs_use", |
| 659 | "genfs_contexts", |
| 660 | "port_contexts", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 661 | ], |
| 662 | } |
| 663 | |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 664 | se_build_files { |
| 665 | name: "sepolicy_technical_debt", |
| 666 | srcs: ["technical_debt.cil"], |
| 667 | } |
| 668 | |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 669 | reqd_mask_policy = [":se_build_files{.reqd_mask}"] |
| 670 | plat_public_policy = [":se_build_files{.plat_public}"] |
| 671 | plat_private_policy = [":se_build_files{.plat_private}"] |
| 672 | system_ext_public_policy = [":se_build_files{.system_ext_public}"] |
| 673 | system_ext_private_policy = [":se_build_files{.system_ext_private}"] |
| 674 | product_public_policy = [":se_build_files{.product_public}"] |
| 675 | product_private_policy = [":se_build_files{.product_private}"] |
| 676 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 677 | // reqd_policy_mask - a policy.conf file which contains only the bare minimum |
| 678 | // policy necessary to use checkpolicy. |
| 679 | // |
| 680 | // This bare-minimum policy needs to be present in all policy.conf files, but |
| 681 | // should not necessarily be exported as part of the public policy. |
| 682 | // |
| 683 | // The rules generated by reqd_policy_mask will allow the compilation of public |
| 684 | // policy and subsequent removal of CIL policy that should not be exported. |
| 685 | se_policy_conf { |
| 686 | name: "reqd_policy_mask.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 687 | srcs: reqd_mask_policy, |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 688 | installable: false, |
| 689 | } |
| 690 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 691 | se_policy_cil { |
| 692 | name: "reqd_policy_mask.cil", |
| 693 | src: ":reqd_policy_mask.conf", |
| 694 | secilc_check: false, |
| 695 | installable: false, |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 696 | } |
| 697 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 698 | // pub_policy - policy that will be exported to be a part of non-platform |
| 699 | // policy corresponding to this platform version. |
| 700 | // |
| 701 | // This is a limited subset of policy that would not compile in checkpolicy on |
| 702 | // its own. |
| 703 | // |
| 704 | // To get around this limitation, add only the required files from private |
| 705 | // policy, which will generate CIL policy that will then be filtered out by the |
| 706 | // reqd_policy_mask. |
| 707 | // |
| 708 | // There are three pub_policy.cil files below: |
| 709 | // - pub_policy.cil: exported 'product', 'system_ext' and 'system' policy. |
| 710 | // - system_ext_pub_policy.cil: exported 'system_ext' and 'system' policy. |
| 711 | // - plat_pub_policy.cil: exported 'system' policy. |
| 712 | // |
| 713 | // Those above files will in turn be used to generate the following versioned cil files: |
| 714 | // - product_mapping_file: the versioned, exported 'product' policy in product partition. |
| 715 | // - system_ext_mapping_file: the versioned, exported 'system_ext' policy in system_ext partition. |
| 716 | // - plat_mapping_file: the versioned, exported 'system' policy in system partition. |
| 717 | // - plat_pub_versioned.cil: the versioned, exported 'product', 'system_ext' and 'system' policy |
| 718 | // in vendor partition. |
| 719 | // |
| 720 | se_policy_conf { |
| 721 | name: "pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 722 | srcs: plat_public_policy + |
| 723 | system_ext_public_policy + |
| 724 | product_public_policy + |
| 725 | reqd_mask_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 726 | installable: false, |
| 727 | } |
| 728 | |
| 729 | se_policy_cil { |
| 730 | name: "pub_policy.cil", |
| 731 | src: ":pub_policy.conf", |
| 732 | filter_out: [":reqd_policy_mask.cil"], |
| 733 | secilc_check: false, |
| 734 | installable: false, |
| 735 | } |
| 736 | |
| 737 | se_policy_conf { |
| 738 | name: "system_ext_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 739 | srcs: plat_public_policy + |
| 740 | system_ext_public_policy + |
| 741 | reqd_mask_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 742 | installable: false, |
| 743 | } |
| 744 | |
| 745 | se_policy_cil { |
| 746 | name: "system_ext_pub_policy.cil", |
| 747 | src: ":system_ext_pub_policy.conf", |
| 748 | filter_out: [":reqd_policy_mask.cil"], |
| 749 | secilc_check: false, |
| 750 | installable: false, |
| 751 | } |
| 752 | |
| 753 | se_policy_conf { |
| 754 | name: "plat_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 755 | srcs: plat_public_policy + |
| 756 | reqd_mask_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 757 | installable: false, |
| 758 | } |
| 759 | |
| 760 | se_policy_cil { |
| 761 | name: "plat_pub_policy.cil", |
| 762 | src: ":plat_pub_policy.conf", |
| 763 | filter_out: [":reqd_policy_mask.cil"], |
| 764 | secilc_check: false, |
| 765 | installable: false, |
| 766 | } |
| 767 | |
| 768 | // plat_policy.conf - A combination of the private and public platform policy |
| 769 | // which will ship with the device. |
| 770 | // |
| 771 | // The platform will always reflect the most recent platform version and is not |
| 772 | // currently being attributized. |
| 773 | se_policy_conf { |
| 774 | name: "plat_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 775 | srcs: plat_public_policy + |
| 776 | plat_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 777 | installable: false, |
| 778 | } |
| 779 | |
| 780 | se_policy_cil { |
| 781 | name: "plat_sepolicy.cil", |
| 782 | src: ":plat_sepolicy.conf", |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 783 | additional_cil_files: [":sepolicy_technical_debt{.plat_private}"], |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 784 | } |
| 785 | |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 786 | // userdebug_plat_policy.conf - the userdebug version plat_sepolicy.cil |
| 787 | se_policy_conf { |
| 788 | name: "userdebug_plat_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 789 | srcs: plat_public_policy + |
| 790 | plat_private_policy, |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 791 | build_variant: "userdebug", |
| 792 | installable: false, |
| 793 | } |
| 794 | |
| 795 | se_policy_cil { |
| 796 | name: "userdebug_plat_sepolicy.cil", |
| 797 | src: ":userdebug_plat_sepolicy.conf", |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 798 | additional_cil_files: [":sepolicy_technical_debt{.plat_private}"], |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 799 | debug_ramdisk: true, |
Yi-Yo Chiang | 68478b1 | 2021-10-16 03:23:05 +0800 | [diff] [blame] | 800 | dist: { |
| 801 | targets: ["droidcore"], |
| 802 | }, |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 803 | } |
| 804 | |
Yi-Yo Chiang | 857ffc4 | 2021-09-23 14:14:16 +0000 | [diff] [blame] | 805 | // A copy of the userdebug_plat_policy in GSI. |
| 806 | soong_config_module_type { |
| 807 | name: "gsi_se_policy_cil", |
| 808 | module_type: "se_policy_cil", |
| 809 | config_namespace: "ANDROID", |
| 810 | bool_variables: [ |
| 811 | "PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT", |
| 812 | ], |
| 813 | properties: [ |
| 814 | "enabled", |
| 815 | "installable", |
| 816 | ], |
| 817 | } |
| 818 | |
| 819 | gsi_se_policy_cil { |
| 820 | name: "system_ext_userdebug_plat_sepolicy.cil", |
| 821 | stem: "userdebug_plat_sepolicy.cil", |
| 822 | src: ":userdebug_plat_sepolicy.conf", |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 823 | additional_cil_files: [":sepolicy_technical_debt{.plat_private}"], |
Yi-Yo Chiang | 857ffc4 | 2021-09-23 14:14:16 +0000 | [diff] [blame] | 824 | system_ext_specific: true, |
| 825 | enabled: false, |
| 826 | installable: false, |
| 827 | soong_config_variables: { |
| 828 | PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT: { |
| 829 | enabled: true, |
| 830 | installable: true, |
| 831 | }, |
| 832 | }, |
| 833 | } |
| 834 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 835 | // system_ext_policy.conf - A combination of the private and public system_ext |
| 836 | // policy which will ship with the device. System_ext policy is not attributized |
| 837 | se_policy_conf { |
| 838 | name: "system_ext_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 839 | srcs: plat_public_policy + |
| 840 | plat_private_policy + |
| 841 | system_ext_public_policy + |
| 842 | system_ext_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 843 | installable: false, |
| 844 | } |
| 845 | |
| 846 | se_policy_cil { |
| 847 | name: "system_ext_sepolicy.cil", |
| 848 | src: ":system_ext_sepolicy.conf", |
| 849 | system_ext_specific: true, |
| 850 | filter_out: [":plat_sepolicy.cil"], |
| 851 | remove_line_marker: true, |
| 852 | } |
| 853 | |
| 854 | // product_policy.conf - A combination of the private and public product policy |
| 855 | // which will ship with the device. Product policy is not attributized |
| 856 | se_policy_conf { |
| 857 | name: "product_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 858 | srcs: plat_public_policy + |
| 859 | plat_private_policy + |
| 860 | system_ext_public_policy + |
| 861 | system_ext_private_policy + |
| 862 | product_public_policy + |
| 863 | product_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 864 | installable: false, |
| 865 | } |
| 866 | |
| 867 | se_policy_cil { |
| 868 | name: "product_sepolicy.cil", |
| 869 | src: ":product_sepolicy.conf", |
| 870 | product_specific: true, |
| 871 | filter_out: [":plat_sepolicy.cil", ":system_ext_sepolicy.cil"], |
| 872 | remove_line_marker: true, |
| 873 | } |
| 874 | |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 875 | // policy mapping files |
| 876 | // auto-generate the mapping file for current platform policy, since it needs to |
| 877 | // track platform policy development |
| 878 | se_versioned_policy { |
| 879 | name: "plat_mapping_file", |
| 880 | base: ":plat_pub_policy.cil", |
| 881 | mapping: true, |
| 882 | version: "current", |
| 883 | relative_install_path: "mapping", // install to /system/etc/selinux/mapping |
| 884 | } |
| 885 | |
| 886 | se_versioned_policy { |
| 887 | name: "system_ext_mapping_file", |
| 888 | base: ":system_ext_pub_policy.cil", |
| 889 | mapping: true, |
| 890 | version: "current", |
| 891 | filter_out: [":plat_mapping_file"], |
| 892 | relative_install_path: "mapping", // install to /system_ext/etc/selinux/mapping |
| 893 | system_ext_specific: true, |
| 894 | } |
| 895 | |
| 896 | se_versioned_policy { |
| 897 | name: "product_mapping_file", |
| 898 | base: ":pub_policy.cil", |
| 899 | mapping: true, |
| 900 | version: "current", |
| 901 | filter_out: [":plat_mapping_file", ":system_ext_mapping_file"], |
| 902 | relative_install_path: "mapping", // install to /product/etc/selinux/mapping |
| 903 | product_specific: true, |
| 904 | } |
| 905 | |
| 906 | // plat_pub_versioned.cil - the exported platform policy associated with the version |
| 907 | // that non-platform policy targets. |
| 908 | se_versioned_policy { |
| 909 | name: "plat_pub_versioned.cil", |
| 910 | base: ":pub_policy.cil", |
| 911 | target_policy: ":pub_policy.cil", |
| 912 | version: "current", |
| 913 | dependent_cils: [ |
| 914 | ":plat_sepolicy.cil", |
| 915 | ":system_ext_sepolicy.cil", |
| 916 | ":product_sepolicy.cil", |
| 917 | ":plat_mapping_file", |
| 918 | ":system_ext_mapping_file", |
| 919 | ":product_mapping_file", |
| 920 | ], |
| 921 | vendor: true, |
| 922 | } |
| 923 | |
| 924 | ////////////////////////////////// |
| 925 | // Precompiled sepolicy is loaded if and only if: |
| 926 | // - plat_sepolicy_and_mapping.sha256 equals |
| 927 | // precompiled_sepolicy.plat_sepolicy_and_mapping.sha256 |
| 928 | // AND |
| 929 | // - system_ext_sepolicy_and_mapping.sha256 equals |
| 930 | // precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256 |
| 931 | // AND |
| 932 | // - product_sepolicy_and_mapping.sha256 equals |
| 933 | // precompiled_sepolicy.product_sepolicy_and_mapping.sha256 |
| 934 | // See system/core/init/selinux.cpp for details. |
| 935 | ////////////////////////////////// |
| 936 | genrule { |
| 937 | name: "plat_sepolicy_and_mapping.sha256_gen", |
| 938 | srcs: [":plat_sepolicy.cil", ":plat_mapping_file"], |
| 939 | out: ["plat_sepolicy_and_mapping.sha256"], |
| 940 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 941 | } |
| 942 | |
| 943 | prebuilt_etc { |
| 944 | name: "plat_sepolicy_and_mapping.sha256", |
| 945 | filename: "plat_sepolicy_and_mapping.sha256", |
| 946 | src: ":plat_sepolicy_and_mapping.sha256_gen", |
| 947 | relative_install_path: "selinux", |
| 948 | } |
| 949 | |
| 950 | genrule { |
| 951 | name: "system_ext_sepolicy_and_mapping.sha256_gen", |
| 952 | srcs: [":system_ext_sepolicy.cil", ":system_ext_mapping_file"], |
| 953 | out: ["system_ext_sepolicy_and_mapping.sha256"], |
| 954 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 955 | } |
| 956 | |
| 957 | prebuilt_etc { |
| 958 | name: "system_ext_sepolicy_and_mapping.sha256", |
| 959 | filename: "system_ext_sepolicy_and_mapping.sha256", |
| 960 | src: ":system_ext_sepolicy_and_mapping.sha256_gen", |
| 961 | relative_install_path: "selinux", |
| 962 | system_ext_specific: true, |
| 963 | } |
| 964 | |
| 965 | genrule { |
| 966 | name: "product_sepolicy_and_mapping.sha256_gen", |
| 967 | srcs: [":product_sepolicy.cil", ":product_mapping_file"], |
| 968 | out: ["product_sepolicy_and_mapping.sha256"], |
| 969 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 970 | } |
| 971 | |
| 972 | prebuilt_etc { |
| 973 | name: "product_sepolicy_and_mapping.sha256", |
| 974 | filename: "product_sepolicy_and_mapping.sha256", |
| 975 | src: ":product_sepolicy_and_mapping.sha256_gen", |
| 976 | relative_install_path: "selinux", |
| 977 | product_specific: true, |
| 978 | } |
| 979 | |
Inseob Kim | 1c056b1 | 2021-04-30 00:11:43 +0900 | [diff] [blame] | 980 | sepolicy_vers { |
| 981 | name: "plat_sepolicy_vers.txt", |
| 982 | version: "vendor", |
| 983 | vendor: true, |
| 984 | } |
| 985 | |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 986 | soong_config_module_type { |
| 987 | name: "precompiled_sepolicy_defaults", |
| 988 | module_type: "prebuilt_defaults", |
| 989 | config_namespace: "ANDROID", |
| 990 | bool_variables: ["BOARD_USES_ODMIMAGE"], |
| 991 | properties: ["vendor", "device_specific"], |
| 992 | } |
| 993 | |
| 994 | precompiled_sepolicy_defaults { |
| 995 | name: "precompiled_sepolicy", |
| 996 | soong_config_variables: { |
| 997 | BOARD_USES_ODMIMAGE: { |
| 998 | device_specific: true, |
| 999 | conditions_default: { |
| 1000 | vendor: true, |
| 1001 | }, |
| 1002 | }, |
| 1003 | }, |
| 1004 | } |
| 1005 | |
| 1006 | ////////////////////////////////// |
| 1007 | // SHA-256 digest of the plat_sepolicy.cil and plat_mapping_file against |
| 1008 | // which precompiled_policy was built. |
| 1009 | ////////////////////////////////// |
| 1010 | prebuilt_etc { |
| 1011 | defaults: ["precompiled_sepolicy"], |
| 1012 | name: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256", |
| 1013 | filename: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256", |
| 1014 | src: ":plat_sepolicy_and_mapping.sha256_gen", |
| 1015 | relative_install_path: "selinux", |
| 1016 | } |
| 1017 | |
| 1018 | ////////////////////////////////// |
| 1019 | // SHA-256 digest of the system_ext_sepolicy.cil and system_ext_mapping_file against |
| 1020 | // which precompiled_policy was built. |
| 1021 | ////////////////////////////////// |
| 1022 | prebuilt_etc { |
| 1023 | defaults: ["precompiled_sepolicy"], |
| 1024 | name: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256", |
| 1025 | filename: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256", |
| 1026 | src: ":system_ext_sepolicy_and_mapping.sha256_gen", |
| 1027 | relative_install_path: "selinux", |
| 1028 | } |
| 1029 | |
| 1030 | ////////////////////////////////// |
| 1031 | // SHA-256 digest of the product_sepolicy.cil and product_mapping_file against |
| 1032 | // which precompiled_policy was built. |
| 1033 | ////////////////////////////////// |
| 1034 | prebuilt_etc { |
| 1035 | defaults: ["precompiled_sepolicy"], |
| 1036 | name: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256", |
| 1037 | filename: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256", |
| 1038 | src: ":product_sepolicy_and_mapping.sha256_gen", |
| 1039 | relative_install_path: "selinux", |
| 1040 | } |
| 1041 | |
| 1042 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 1043 | ////////////////////////////////// |
| 1044 | // SELinux policy embedded into CTS. |
| 1045 | // CTS checks neverallow rules of this policy against the policy of the device under test. |
| 1046 | ////////////////////////////////// |
| 1047 | se_policy_conf { |
| 1048 | name: "general_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1049 | srcs: plat_public_policy + |
| 1050 | plat_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 1051 | build_variant: "user", |
| 1052 | cts: true, |
| 1053 | exclude_build_test: true, |
| 1054 | } |
Inseob Kim | d581661 | 2021-09-15 03:01:05 +0000 | [diff] [blame] | 1055 | |
| 1056 | ////////////////////////////////// |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1057 | // Base system policy for treble sepolicy tests. |
| 1058 | // If system sepolicy is extended (e.g. by SoC vendors), their plat_pub_versioned.cil may differ |
| 1059 | // with system/sepolicy/prebuilts/api/{version}/plat_pub_versioned.cil. In that case, |
| 1060 | // BOARD_PLAT_PUB_VERSIONED_POLICY can be used to specify extended plat_pub_versioned.cil. |
| 1061 | // See treble_sepolicy_tests_for_release.mk for more details. |
| 1062 | ////////////////////////////////// |
| 1063 | se_policy_conf { |
| 1064 | name: "base_plat_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1065 | srcs: plat_public_policy + |
| 1066 | plat_private_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1067 | build_variant: "user", |
| 1068 | installable: false, |
| 1069 | } |
| 1070 | |
| 1071 | se_policy_cil { |
| 1072 | name: "base_plat_sepolicy.cil", |
| 1073 | src: ":base_plat_sepolicy.conf", |
| 1074 | additional_cil_files: ["private/technical_debt.cil"], |
| 1075 | installable: false, |
| 1076 | secilc_check: false, // done by se_policy_binary |
| 1077 | } |
| 1078 | |
| 1079 | se_policy_binary { |
| 1080 | name: "base_plat_sepolicy", |
| 1081 | srcs: [":base_plat_sepolicy.cil"], |
| 1082 | installable: false, |
| 1083 | } |
| 1084 | |
| 1085 | se_policy_conf { |
| 1086 | name: "base_system_ext_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1087 | srcs: plat_public_policy + |
| 1088 | plat_private_policy + |
| 1089 | system_ext_public_policy + |
| 1090 | system_ext_private_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1091 | build_variant: "user", |
| 1092 | installable: false, |
| 1093 | } |
| 1094 | |
| 1095 | se_policy_cil { |
| 1096 | name: "base_system_ext_sepolicy.cil", |
| 1097 | src: ":base_system_ext_sepolicy.conf", |
| 1098 | additional_cil_files: ["private/technical_debt.cil"], |
| 1099 | system_ext_specific: true, |
| 1100 | installable: false, |
| 1101 | secilc_check: false, // done by se_policy_binary |
| 1102 | } |
| 1103 | |
| 1104 | se_policy_binary { |
| 1105 | name: "base_system_ext_sepolicy", |
| 1106 | srcs: [":base_system_ext_sepolicy.cil"], |
| 1107 | system_ext_specific: true, |
| 1108 | installable: false, |
| 1109 | } |
| 1110 | |
| 1111 | se_policy_conf { |
| 1112 | name: "base_product_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1113 | srcs: plat_public_policy + |
| 1114 | plat_private_policy + |
| 1115 | system_ext_public_policy + |
| 1116 | system_ext_private_policy + |
| 1117 | product_public_policy + |
| 1118 | product_private_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1119 | build_variant: "user", |
| 1120 | installable: false, |
| 1121 | } |
| 1122 | |
| 1123 | se_policy_cil { |
| 1124 | name: "base_product_sepolicy.cil", |
| 1125 | src: ":base_product_sepolicy.conf", |
| 1126 | additional_cil_files: ["private/technical_debt.cil"], |
| 1127 | product_specific: true, |
| 1128 | installable: false, |
| 1129 | secilc_check: false, // done by se_policy_binary |
| 1130 | } |
| 1131 | |
| 1132 | se_policy_binary { |
| 1133 | name: "base_product_sepolicy", |
| 1134 | srcs: [":base_product_sepolicy.cil"], |
| 1135 | product_specific: true, |
| 1136 | installable: false, |
| 1137 | } |
| 1138 | |
| 1139 | se_policy_conf { |
| 1140 | name: "base_plat_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1141 | srcs: plat_public_policy + |
| 1142 | reqd_mask_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1143 | build_variant: "user", |
| 1144 | installable: false, |
| 1145 | } |
| 1146 | |
| 1147 | se_policy_cil { |
| 1148 | name: "base_plat_pub_policy.cil", |
| 1149 | src: ":base_plat_pub_policy.conf", |
| 1150 | filter_out: [":reqd_policy_mask.cil"], |
| 1151 | secilc_check: false, |
| 1152 | installable: false, |
| 1153 | } |
| 1154 | |
| 1155 | se_policy_conf { |
| 1156 | name: "base_system_ext_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1157 | srcs: plat_public_policy + |
| 1158 | system_ext_public_policy + |
| 1159 | reqd_mask_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1160 | build_variant: "user", |
| 1161 | installable: false, |
| 1162 | } |
| 1163 | |
| 1164 | se_policy_cil { |
| 1165 | name: "base_system_ext_pub_policy.cil", |
| 1166 | src: ":base_system_ext_pub_policy.conf", |
| 1167 | filter_out: [":reqd_policy_mask.cil"], |
| 1168 | secilc_check: false, |
| 1169 | installable: false, |
| 1170 | } |
| 1171 | |
| 1172 | se_policy_conf { |
| 1173 | name: "base_product_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1174 | srcs: plat_public_policy + |
| 1175 | system_ext_public_policy + |
| 1176 | product_public_policy + |
| 1177 | reqd_mask_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1178 | build_variant: "user", |
| 1179 | installable: false, |
| 1180 | } |
| 1181 | |
| 1182 | se_policy_cil { |
| 1183 | name: "base_product_pub_policy.cil", |
| 1184 | src: ":base_product_pub_policy.conf", |
| 1185 | filter_out: [":reqd_policy_mask.cil"], |
| 1186 | secilc_check: false, |
| 1187 | installable: false, |
| 1188 | } |
| 1189 | |
Yi-Yo Chiang | 2c18965 | 2021-11-08 19:30:04 +0800 | [diff] [blame] | 1190 | // bug_map - Bug tracking information for selinux denials loaded by auditd. |
| 1191 | se_filegroup { |
| 1192 | name: "bug_map_files", |
| 1193 | srcs: ["bug_map"], |
| 1194 | } |
| 1195 | |
| 1196 | se_bug_map { |
| 1197 | name: "plat_bug_map", |
| 1198 | srcs: [":bug_map_files"], |
| 1199 | stem: "bug_map", |
| 1200 | } |
| 1201 | |
| 1202 | se_bug_map { |
| 1203 | name: "system_ext_bug_map", |
| 1204 | srcs: [":bug_map_files"], |
| 1205 | stem: "bug_map", |
| 1206 | system_ext_specific: true, |
| 1207 | } |
| 1208 | |
| 1209 | se_bug_map { |
| 1210 | name: "vendor_bug_map", |
| 1211 | srcs: [":bug_map_files"], |
| 1212 | // Legacy file name of the vendor partition bug_map. |
| 1213 | stem: "selinux_denial_metadata", |
| 1214 | vendor: true, |
| 1215 | } |
| 1216 | |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1217 | ////////////////////////////////// |
Inseob Kim | d581661 | 2021-09-15 03:01:05 +0000 | [diff] [blame] | 1218 | // se_freeze_test compares the plat sepolicy with the prebuilt sepolicy |
| 1219 | // Additional directories can be specified via Makefile variables: |
| 1220 | // SEPOLICY_FREEZE_TEST_EXTRA_DIRS and SEPOLICY_FREEZE_TEST_EXTRA_PREBUILT_DIRS. |
| 1221 | ////////////////////////////////// |
| 1222 | se_freeze_test { |
| 1223 | name: "sepolicy_freeze_test", |
| 1224 | } |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 1225 | |
| 1226 | ////////////////////////////////// |
| 1227 | // Makefile rules temporary imported to Soong |
| 1228 | // TODO(b/33691272): remove these after migrating seapp to Soong |
| 1229 | ////////////////////////////////// |
| 1230 | makefile_goal { |
| 1231 | name: "plat_seapp_contexts_rule", |
| 1232 | product_out_path: "obj/ETC/plat_seapp_contexts_intermediates/plat_seapp_contexts", |
| 1233 | } |
| 1234 | |
| 1235 | makefile_goal { |
| 1236 | name: "plat_seapp_neverallows_rule", |
| 1237 | product_out_path: "obj/ETC/plat_seapp_neverallows_intermediates/plat_seapp_neverallows", |
| 1238 | } |