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 | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 399 | se_build_files { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 400 | name: "file_contexts_files", |
| 401 | srcs: ["file_contexts"], |
| 402 | } |
| 403 | |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 404 | se_build_files { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 405 | name: "file_contexts_asan_files", |
| 406 | srcs: ["file_contexts_asan"], |
| 407 | } |
| 408 | |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 409 | se_build_files { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 410 | name: "file_contexts_overlayfs_files", |
| 411 | srcs: ["file_contexts_overlayfs"], |
| 412 | } |
| 413 | |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 414 | se_build_files { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 415 | name: "hwservice_contexts_files", |
| 416 | srcs: ["hwservice_contexts"], |
| 417 | } |
| 418 | |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 419 | se_build_files { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 420 | name: "property_contexts_files", |
| 421 | srcs: ["property_contexts"], |
| 422 | } |
| 423 | |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 424 | se_build_files { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 425 | name: "service_contexts_files", |
| 426 | srcs: ["service_contexts"], |
| 427 | } |
| 428 | |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 429 | se_build_files { |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 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", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 436 | srcs: [":file_contexts_files{.plat_private}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 437 | product_variables: { |
| 438 | address_sanitize: { |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 439 | srcs: [":file_contexts_asan_files{.plat_private}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 440 | }, |
| 441 | debuggable: { |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 442 | srcs: [":file_contexts_overlayfs_files{.plat_private}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 443 | }, |
| 444 | }, |
| 445 | |
| 446 | flatten_apex: { |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 447 | srcs: [":apex_file_contexts_files"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 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", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 453 | srcs: [":file_contexts_files{.plat_private}"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 454 | stem: "plat_file_contexts", |
| 455 | product_variables: { |
| 456 | address_sanitize: { |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 457 | srcs: [":file_contexts_asan_files{.plat_private}"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 458 | }, |
| 459 | debuggable: { |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 460 | srcs: [":file_contexts_overlayfs_files{.plat_private}"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 461 | }, |
| 462 | }, |
| 463 | |
| 464 | flatten_apex: { |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 465 | srcs: [":apex_file_contexts_files"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 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", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 473 | srcs: [ |
| 474 | ":file_contexts_files{.plat_vendor_for_vendor}", |
| 475 | ":file_contexts_files{.vendor}", |
| 476 | ], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 477 | soc_specific: true, |
| 478 | recovery_available: true, |
| 479 | } |
| 480 | |
| 481 | file_contexts { |
Bowgo Tsai | 86a048d | 2019-09-09 22:04:06 +0800 | [diff] [blame] | 482 | name: "system_ext_file_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 483 | srcs: [":file_contexts_files{.system_ext_private}"], |
Bowgo Tsai | 86a048d | 2019-09-09 22:04:06 +0800 | [diff] [blame] | 484 | system_ext_specific: true, |
| 485 | recovery_available: true, |
| 486 | } |
| 487 | |
| 488 | file_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 489 | name: "product_file_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 490 | srcs: [":file_contexts_files{.product_private}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 491 | product_specific: true, |
| 492 | recovery_available: true, |
| 493 | } |
| 494 | |
| 495 | file_contexts { |
| 496 | name: "odm_file_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 497 | srcs: [":file_contexts_files{.odm}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 498 | device_specific: true, |
| 499 | recovery_available: true, |
| 500 | } |
| 501 | |
| 502 | hwservice_contexts { |
| 503 | name: "plat_hwservice_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 504 | srcs: [":hwservice_contexts_files{.plat_private}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 505 | } |
| 506 | |
| 507 | hwservice_contexts { |
Bowgo Tsai | 241d36e | 2019-09-09 22:05:10 +0800 | [diff] [blame] | 508 | name: "system_ext_hwservice_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 509 | srcs: [":hwservice_contexts_files{.system_ext_private}"], |
Bowgo Tsai | 241d36e | 2019-09-09 22:05:10 +0800 | [diff] [blame] | 510 | system_ext_specific: true, |
| 511 | } |
| 512 | |
| 513 | hwservice_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 514 | name: "product_hwservice_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 515 | srcs: [":hwservice_contexts_files{.product_private}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 516 | product_specific: true, |
| 517 | } |
| 518 | |
| 519 | hwservice_contexts { |
| 520 | name: "vendor_hwservice_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 521 | srcs: [ |
| 522 | ":hwservice_contexts_files{.plat_vendor_for_vendor}", |
| 523 | ":hwservice_contexts_files{.vendor}", |
| 524 | ":hwservice_contexts_files{.reqd_mask_for_vendor}", |
| 525 | ], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 526 | soc_specific: true, |
| 527 | } |
| 528 | |
| 529 | hwservice_contexts { |
| 530 | name: "odm_hwservice_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 531 | srcs: [":hwservice_contexts_files{.odm}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 532 | device_specific: true, |
| 533 | } |
| 534 | |
| 535 | property_contexts { |
| 536 | name: "plat_property_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 537 | srcs: [":property_contexts_files{.plat_private}"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 538 | } |
| 539 | |
| 540 | property_contexts { |
| 541 | name: "plat_property_contexts.recovery", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 542 | srcs: [":property_contexts_files{.plat_private}"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 543 | stem: "plat_property_contexts", |
| 544 | recovery: true, |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 545 | } |
| 546 | |
| 547 | property_contexts { |
Bowgo Tsai | 1864cd0 | 2019-09-09 18:09:22 +0800 | [diff] [blame] | 548 | name: "system_ext_property_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 549 | srcs: [":property_contexts_files{.system_ext_private}"], |
Bowgo Tsai | 1864cd0 | 2019-09-09 18:09:22 +0800 | [diff] [blame] | 550 | system_ext_specific: true, |
| 551 | recovery_available: true, |
| 552 | } |
| 553 | |
| 554 | property_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 555 | name: "product_property_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 556 | srcs: [":property_contexts_files{.product_private}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 557 | product_specific: true, |
| 558 | recovery_available: true, |
| 559 | } |
| 560 | |
| 561 | property_contexts { |
| 562 | name: "vendor_property_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 563 | srcs: [ |
| 564 | ":property_contexts_files{.plat_vendor_for_vendor}", |
| 565 | ":property_contexts_files{.vendor}", |
| 566 | ":property_contexts_files{.reqd_mask_for_vendor}", |
| 567 | ], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 568 | soc_specific: true, |
| 569 | recovery_available: true, |
| 570 | } |
| 571 | |
| 572 | property_contexts { |
| 573 | name: "odm_property_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 574 | srcs: [":property_contexts_files{.odm}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 575 | device_specific: true, |
| 576 | recovery_available: true, |
| 577 | } |
| 578 | |
| 579 | service_contexts { |
| 580 | name: "plat_service_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 581 | srcs: [":service_contexts_files{.plat_private}"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 582 | } |
| 583 | |
| 584 | service_contexts { |
| 585 | name: "plat_service_contexts.recovery", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 586 | srcs: [":service_contexts_files{.plat_private}"], |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 587 | stem: "plat_service_contexts", |
| 588 | recovery: true, |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 589 | } |
| 590 | |
| 591 | service_contexts { |
Bowgo Tsai | 9823116 | 2019-09-09 22:05:29 +0800 | [diff] [blame] | 592 | name: "system_ext_service_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 593 | srcs: [":service_contexts_files{.system_ext_private}"], |
Bowgo Tsai | 9823116 | 2019-09-09 22:05:29 +0800 | [diff] [blame] | 594 | system_ext_specific: true, |
Yifan Hong | d6b2901 | 2021-11-13 00:22:01 -0800 | [diff] [blame] | 595 | recovery_available: true, |
Bowgo Tsai | 9823116 | 2019-09-09 22:05:29 +0800 | [diff] [blame] | 596 | } |
| 597 | |
| 598 | service_contexts { |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 599 | name: "product_service_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 600 | srcs: [":service_contexts_files{.product_private}"], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 601 | product_specific: true, |
Yifan Hong | d6b2901 | 2021-11-13 00:22:01 -0800 | [diff] [blame] | 602 | recovery_available: true, |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 603 | } |
| 604 | |
| 605 | service_contexts { |
| 606 | name: "vendor_service_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 607 | srcs: [ |
| 608 | ":service_contexts_files{.plat_vendor_for_vendor}", |
| 609 | ":service_contexts_files{.vendor}", |
| 610 | ":service_contexts_files{.reqd_mask_for_vendor}", |
| 611 | ], |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 612 | soc_specific: true, |
Yifan Hong | d6b2901 | 2021-11-13 00:22:01 -0800 | [diff] [blame] | 613 | recovery_available: true, |
Inseob Kim | b554e59 | 2019-04-15 20:10:46 +0900 | [diff] [blame] | 614 | } |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 615 | |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 616 | keystore2_key_contexts { |
| 617 | name: "plat_keystore2_key_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 618 | srcs: [":keystore2_key_contexts_files{.plat_private}"], |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 619 | } |
| 620 | |
| 621 | keystore2_key_contexts { |
| 622 | name: "system_keystore2_key_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 623 | srcs: [":keystore2_key_contexts_files{.system_ext_private}"], |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 624 | system_ext_specific: true, |
| 625 | } |
| 626 | |
| 627 | keystore2_key_contexts { |
| 628 | name: "product_keystore2_key_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 629 | srcs: [":keystore2_key_contexts_files{.product_private}"], |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 630 | product_specific: true, |
| 631 | } |
| 632 | |
| 633 | keystore2_key_contexts { |
| 634 | name: "vendor_keystore2_key_contexts", |
Inseob Kim | 6d3d5a6 | 2021-12-21 20:55:32 +0900 | [diff] [blame^] | 635 | srcs: [ |
| 636 | ":keystore2_key_contexts_files{.plat_vendor_for_vendor}", |
| 637 | ":keystore2_key_contexts_files{.vendor}", |
| 638 | ":keystore2_key_contexts_files{.reqd_mask_for_vendor}", |
| 639 | ], |
Janis Danisevskis | c40681f | 2020-07-25 13:02:29 -0700 | [diff] [blame] | 640 | soc_specific: true, |
| 641 | } |
| 642 | |
yangbill | 3e34537 | 2020-04-15 13:55:47 +0800 | [diff] [blame] | 643 | // For vts_treble_sys_prop_test |
| 644 | filegroup { |
| 645 | name: "private_property_contexts", |
| 646 | srcs: ["private/property_contexts"], |
| 647 | visibility: [ |
| 648 | "//test/vts-testcase/security/system_property", |
| 649 | ], |
| 650 | } |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 651 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 652 | se_build_files { |
| 653 | name: "se_build_files", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 654 | srcs: [ |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 655 | "security_classes", |
| 656 | "initial_sids", |
| 657 | "access_vectors", |
| 658 | "global_macros", |
| 659 | "neverallow_macros", |
| 660 | "mls_macros", |
| 661 | "mls_decl", |
| 662 | "mls", |
| 663 | "policy_capabilities", |
| 664 | "te_macros", |
| 665 | "attributes", |
| 666 | "ioctl_defines", |
| 667 | "ioctl_macros", |
| 668 | "*.te", |
| 669 | "roles_decl", |
| 670 | "roles", |
| 671 | "users", |
| 672 | "initial_sid_contexts", |
| 673 | "fs_use", |
| 674 | "genfs_contexts", |
| 675 | "port_contexts", |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 676 | ], |
| 677 | } |
| 678 | |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 679 | se_build_files { |
| 680 | name: "sepolicy_technical_debt", |
| 681 | srcs: ["technical_debt.cil"], |
| 682 | } |
| 683 | |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 684 | reqd_mask_policy = [":se_build_files{.reqd_mask}"] |
| 685 | plat_public_policy = [":se_build_files{.plat_public}"] |
| 686 | plat_private_policy = [":se_build_files{.plat_private}"] |
| 687 | system_ext_public_policy = [":se_build_files{.system_ext_public}"] |
| 688 | system_ext_private_policy = [":se_build_files{.system_ext_private}"] |
| 689 | product_public_policy = [":se_build_files{.product_public}"] |
| 690 | product_private_policy = [":se_build_files{.product_private}"] |
| 691 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 692 | // reqd_policy_mask - a policy.conf file which contains only the bare minimum |
| 693 | // policy necessary to use checkpolicy. |
| 694 | // |
| 695 | // This bare-minimum policy needs to be present in all policy.conf files, but |
| 696 | // should not necessarily be exported as part of the public policy. |
| 697 | // |
| 698 | // The rules generated by reqd_policy_mask will allow the compilation of public |
| 699 | // policy and subsequent removal of CIL policy that should not be exported. |
| 700 | se_policy_conf { |
| 701 | name: "reqd_policy_mask.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 702 | srcs: reqd_mask_policy, |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 703 | installable: false, |
| 704 | } |
| 705 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 706 | se_policy_cil { |
| 707 | name: "reqd_policy_mask.cil", |
| 708 | src: ":reqd_policy_mask.conf", |
| 709 | secilc_check: false, |
| 710 | installable: false, |
Inseob Kim | e35b49b | 2021-02-18 19:15:41 +0900 | [diff] [blame] | 711 | } |
| 712 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 713 | // pub_policy - policy that will be exported to be a part of non-platform |
| 714 | // policy corresponding to this platform version. |
| 715 | // |
| 716 | // This is a limited subset of policy that would not compile in checkpolicy on |
| 717 | // its own. |
| 718 | // |
| 719 | // To get around this limitation, add only the required files from private |
| 720 | // policy, which will generate CIL policy that will then be filtered out by the |
| 721 | // reqd_policy_mask. |
| 722 | // |
| 723 | // There are three pub_policy.cil files below: |
| 724 | // - pub_policy.cil: exported 'product', 'system_ext' and 'system' policy. |
| 725 | // - system_ext_pub_policy.cil: exported 'system_ext' and 'system' policy. |
| 726 | // - plat_pub_policy.cil: exported 'system' policy. |
| 727 | // |
| 728 | // Those above files will in turn be used to generate the following versioned cil files: |
| 729 | // - product_mapping_file: the versioned, exported 'product' policy in product partition. |
| 730 | // - system_ext_mapping_file: the versioned, exported 'system_ext' policy in system_ext partition. |
| 731 | // - plat_mapping_file: the versioned, exported 'system' policy in system partition. |
| 732 | // - plat_pub_versioned.cil: the versioned, exported 'product', 'system_ext' and 'system' policy |
| 733 | // in vendor partition. |
| 734 | // |
| 735 | se_policy_conf { |
| 736 | name: "pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 737 | srcs: plat_public_policy + |
| 738 | system_ext_public_policy + |
| 739 | product_public_policy + |
| 740 | reqd_mask_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 741 | installable: false, |
| 742 | } |
| 743 | |
| 744 | se_policy_cil { |
| 745 | name: "pub_policy.cil", |
| 746 | src: ":pub_policy.conf", |
| 747 | filter_out: [":reqd_policy_mask.cil"], |
| 748 | secilc_check: false, |
| 749 | installable: false, |
| 750 | } |
| 751 | |
| 752 | se_policy_conf { |
| 753 | name: "system_ext_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 754 | srcs: plat_public_policy + |
| 755 | system_ext_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: "system_ext_pub_policy.cil", |
| 762 | src: ":system_ext_pub_policy.conf", |
| 763 | filter_out: [":reqd_policy_mask.cil"], |
| 764 | secilc_check: false, |
| 765 | installable: false, |
| 766 | } |
| 767 | |
| 768 | se_policy_conf { |
| 769 | name: "plat_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 770 | srcs: plat_public_policy + |
| 771 | reqd_mask_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 772 | installable: false, |
| 773 | } |
| 774 | |
| 775 | se_policy_cil { |
| 776 | name: "plat_pub_policy.cil", |
| 777 | src: ":plat_pub_policy.conf", |
| 778 | filter_out: [":reqd_policy_mask.cil"], |
| 779 | secilc_check: false, |
| 780 | installable: false, |
| 781 | } |
| 782 | |
| 783 | // plat_policy.conf - A combination of the private and public platform policy |
| 784 | // which will ship with the device. |
| 785 | // |
| 786 | // The platform will always reflect the most recent platform version and is not |
| 787 | // currently being attributized. |
| 788 | se_policy_conf { |
| 789 | name: "plat_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 790 | srcs: plat_public_policy + |
| 791 | plat_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 792 | installable: false, |
| 793 | } |
| 794 | |
| 795 | se_policy_cil { |
| 796 | name: "plat_sepolicy.cil", |
| 797 | src: ":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 | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 799 | } |
| 800 | |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 801 | // userdebug_plat_policy.conf - the userdebug version plat_sepolicy.cil |
| 802 | se_policy_conf { |
| 803 | name: "userdebug_plat_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 804 | srcs: plat_public_policy + |
| 805 | plat_private_policy, |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 806 | build_variant: "userdebug", |
| 807 | installable: false, |
| 808 | } |
| 809 | |
| 810 | se_policy_cil { |
| 811 | name: "userdebug_plat_sepolicy.cil", |
| 812 | src: ":userdebug_plat_sepolicy.conf", |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 813 | additional_cil_files: [":sepolicy_technical_debt{.plat_private}"], |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 814 | debug_ramdisk: true, |
Yi-Yo Chiang | 68478b1 | 2021-10-16 03:23:05 +0800 | [diff] [blame] | 815 | dist: { |
| 816 | targets: ["droidcore"], |
| 817 | }, |
Inseob Kim | 6cc75f4 | 2021-04-29 13:53:20 +0000 | [diff] [blame] | 818 | } |
| 819 | |
Yi-Yo Chiang | 857ffc4 | 2021-09-23 14:14:16 +0000 | [diff] [blame] | 820 | // A copy of the userdebug_plat_policy in GSI. |
| 821 | soong_config_module_type { |
| 822 | name: "gsi_se_policy_cil", |
| 823 | module_type: "se_policy_cil", |
| 824 | config_namespace: "ANDROID", |
| 825 | bool_variables: [ |
| 826 | "PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT", |
| 827 | ], |
| 828 | properties: [ |
| 829 | "enabled", |
| 830 | "installable", |
| 831 | ], |
| 832 | } |
| 833 | |
| 834 | gsi_se_policy_cil { |
| 835 | name: "system_ext_userdebug_plat_sepolicy.cil", |
| 836 | stem: "userdebug_plat_sepolicy.cil", |
| 837 | src: ":userdebug_plat_sepolicy.conf", |
Inseob Kim | 7cb2081 | 2021-12-16 16:52:14 +0900 | [diff] [blame] | 838 | additional_cil_files: [":sepolicy_technical_debt{.plat_private}"], |
Yi-Yo Chiang | 857ffc4 | 2021-09-23 14:14:16 +0000 | [diff] [blame] | 839 | system_ext_specific: true, |
| 840 | enabled: false, |
| 841 | installable: false, |
| 842 | soong_config_variables: { |
| 843 | PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT: { |
| 844 | enabled: true, |
| 845 | installable: true, |
| 846 | }, |
| 847 | }, |
| 848 | } |
| 849 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 850 | // system_ext_policy.conf - A combination of the private and public system_ext |
| 851 | // policy which will ship with the device. System_ext policy is not attributized |
| 852 | se_policy_conf { |
| 853 | name: "system_ext_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 854 | srcs: plat_public_policy + |
| 855 | plat_private_policy + |
| 856 | system_ext_public_policy + |
| 857 | system_ext_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 858 | installable: false, |
| 859 | } |
| 860 | |
| 861 | se_policy_cil { |
| 862 | name: "system_ext_sepolicy.cil", |
| 863 | src: ":system_ext_sepolicy.conf", |
| 864 | system_ext_specific: true, |
| 865 | filter_out: [":plat_sepolicy.cil"], |
| 866 | remove_line_marker: true, |
| 867 | } |
| 868 | |
| 869 | // product_policy.conf - A combination of the private and public product policy |
| 870 | // which will ship with the device. Product policy is not attributized |
| 871 | se_policy_conf { |
| 872 | name: "product_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 873 | srcs: plat_public_policy + |
| 874 | plat_private_policy + |
| 875 | system_ext_public_policy + |
| 876 | system_ext_private_policy + |
| 877 | product_public_policy + |
| 878 | product_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 879 | installable: false, |
| 880 | } |
| 881 | |
| 882 | se_policy_cil { |
| 883 | name: "product_sepolicy.cil", |
| 884 | src: ":product_sepolicy.conf", |
| 885 | product_specific: true, |
| 886 | filter_out: [":plat_sepolicy.cil", ":system_ext_sepolicy.cil"], |
| 887 | remove_line_marker: true, |
| 888 | } |
| 889 | |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 890 | // policy mapping files |
| 891 | // auto-generate the mapping file for current platform policy, since it needs to |
| 892 | // track platform policy development |
| 893 | se_versioned_policy { |
| 894 | name: "plat_mapping_file", |
| 895 | base: ":plat_pub_policy.cil", |
| 896 | mapping: true, |
| 897 | version: "current", |
| 898 | relative_install_path: "mapping", // install to /system/etc/selinux/mapping |
| 899 | } |
| 900 | |
| 901 | se_versioned_policy { |
| 902 | name: "system_ext_mapping_file", |
| 903 | base: ":system_ext_pub_policy.cil", |
| 904 | mapping: true, |
| 905 | version: "current", |
| 906 | filter_out: [":plat_mapping_file"], |
| 907 | relative_install_path: "mapping", // install to /system_ext/etc/selinux/mapping |
| 908 | system_ext_specific: true, |
| 909 | } |
| 910 | |
| 911 | se_versioned_policy { |
| 912 | name: "product_mapping_file", |
| 913 | base: ":pub_policy.cil", |
| 914 | mapping: true, |
| 915 | version: "current", |
| 916 | filter_out: [":plat_mapping_file", ":system_ext_mapping_file"], |
| 917 | relative_install_path: "mapping", // install to /product/etc/selinux/mapping |
| 918 | product_specific: true, |
| 919 | } |
| 920 | |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 921 | // vendor/odm sepolicy |
| 922 | // |
| 923 | // If BOARD_SEPOLICY_VERS is set to a value other than PLATFORM_SEPOLICY_VERSION, |
| 924 | // policy files of platform (system, system_ext, product) can't be mixed with |
| 925 | // policy files of vendor (vendor, odm). If it's the case, platform policies and |
| 926 | // vendor policies are separately built. More specifically, |
| 927 | // |
| 928 | // - Platform policy files needed to build vendor policies, such as plat_policy, |
| 929 | // plat_mapping_cil, plat_pub_policy, reqd_policy_mask, are built from the |
| 930 | // prebuilts (copy of platform policy files of version BOARD_SEPOLICY_VERS). |
| 931 | // |
| 932 | // - sepolicy_neverallows only checks platform policies, and a new module |
| 933 | // sepolicy_neverallows_vendor checks vendor policies. |
| 934 | // |
| 935 | // - neverallow checks are turned off while compiling precompiled_sepolicy |
| 936 | // module and sepolicy module. |
| 937 | // |
| 938 | // - Vendor policies are not checked on the compat test (compat.mk). |
| 939 | // |
| 940 | // In such scenario, we can grab platform policy files from the prebuilts/api |
| 941 | // directory. But we need more than that: prebuilts of system_ext, product, |
| 942 | // system/sepolicy/reqd_mask, and system/sepolicy/vendor. The following |
| 943 | // variables are introduced to specify such prebuilts. |
| 944 | // |
| 945 | // - BOARD_REQD_MASK_POLICY (prebuilt of system/sepolicy/reqd_mask) |
| 946 | // - BOARD_PLAT_VENDOR_POLICY (prebuilt of system/sepolicy/vendor) |
| 947 | // - BOARD_SYSTEM_EXT_PUBLIC_PREBUILT_DIRS (prebuilt of system_ext public) |
| 948 | // - BOARD_SYSTEM_EXT_PRIVATE_PREBUILT_DIRS (prebuilt of system_ext private) |
| 949 | // - BOARD_PRODUCT_PUBLIC_PREBUILT_DIRS (prebuilt of product public) |
| 950 | // - BOARD_PRODUCT_PRIVATE_PREBUILT_DIRS (prebuilt of product private) |
| 951 | // |
| 952 | // Vendors are responsible for copying policy files from the old version of the |
| 953 | // source tree as prebuilts, and for setting BOARD_*_POLICY variables so they |
| 954 | // can be used to build vendor policies. |
| 955 | // |
| 956 | // To support both mixed build and normal build, platform policy files are |
| 957 | // indirectly referred as {.(partition)_(scope)_for_vendor}. They will be equal |
| 958 | // to {.(partition)_scope)} if BOARD_SEPOLICY_VERS == PLATFORM_SEPOLICY_VERSION. |
| 959 | // Otherwise, they will be equal to the Makefile variables above. |
| 960 | |
| 961 | plat_public_policies_for_vendor = [ |
| 962 | ":se_build_files{.plat_public_for_vendor}", |
| 963 | ":se_build_files{.system_ext_public_for_vendor}", |
| 964 | ":se_build_files{.product_public_for_vendor}", |
| 965 | ":se_build_files{.reqd_mask_for_vendor}", |
| 966 | ] |
| 967 | |
| 968 | plat_policies_for_vendor = [ |
| 969 | ":se_build_files{.plat_public_for_vendor}", |
| 970 | ":se_build_files{.plat_private_for_vendor}", |
| 971 | ":se_build_files{.system_ext_public_for_vendor}", |
| 972 | ":se_build_files{.system_ext_private_for_vendor}", |
| 973 | ":se_build_files{.product_public_for_vendor}", |
| 974 | ":se_build_files{.product_private_for_vendor}", |
| 975 | ] |
| 976 | |
| 977 | se_policy_conf { |
| 978 | name: "plat_policy_for_vendor.conf", |
| 979 | srcs: plat_policies_for_vendor, |
| 980 | installable: false, |
| 981 | } |
| 982 | |
| 983 | se_policy_cil { |
| 984 | name: "plat_policy_for_vendor.cil", |
| 985 | src: ":plat_policy_for_vendor.conf", |
| 986 | additional_cil_files: [":sepolicy_technical_debt{.plat_private_for_vendor}"], |
| 987 | installable: false, |
| 988 | } |
| 989 | |
| 990 | se_policy_conf { |
| 991 | name: "reqd_policy_mask_for_vendor.conf", |
| 992 | srcs: [":se_build_files{.reqd_mask_for_vendor}"], |
| 993 | installable: false, |
| 994 | } |
| 995 | |
| 996 | se_policy_cil { |
| 997 | name: "reqd_policy_mask_for_vendor.cil", |
| 998 | src: ":reqd_policy_mask_for_vendor.conf", |
| 999 | secilc_check: false, |
| 1000 | installable: false, |
| 1001 | } |
| 1002 | |
| 1003 | se_policy_conf { |
| 1004 | name: "pub_policy_for_vendor.conf", |
| 1005 | srcs: plat_public_policies_for_vendor, |
| 1006 | installable: false, |
| 1007 | } |
| 1008 | |
| 1009 | se_policy_cil { |
| 1010 | name: "pub_policy_for_vendor.cil", |
| 1011 | src: ":pub_policy_for_vendor.conf", |
| 1012 | filter_out: [":reqd_policy_mask_for_vendor.cil"], |
| 1013 | secilc_check: false, |
| 1014 | installable: false, |
| 1015 | } |
| 1016 | |
| 1017 | se_versioned_policy { |
| 1018 | name: "plat_mapping_file_for_vendor", |
| 1019 | base: ":pub_policy_for_vendor.cil", |
| 1020 | mapping: true, |
| 1021 | version: "vendor", |
| 1022 | installable: false, |
| 1023 | } |
| 1024 | |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 1025 | // plat_pub_versioned.cil - the exported platform policy associated with the version |
| 1026 | // that non-platform policy targets. |
| 1027 | se_versioned_policy { |
| 1028 | name: "plat_pub_versioned.cil", |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 1029 | base: ":pub_policy_for_vendor.cil", |
| 1030 | target_policy: ":pub_policy_for_vendor.cil", |
| 1031 | version: "vendor", |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 1032 | vendor: true, |
| 1033 | } |
| 1034 | |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 1035 | // vendor_policy.cil - the vendor sepolicy. This needs attributization and to be combined |
| 1036 | // with the platform-provided policy. It makes use of the reqd_policy_mask files from private |
| 1037 | // policy and the platform public policy files in order to use checkpolicy. |
| 1038 | se_policy_conf { |
| 1039 | name: "vendor_sepolicy.conf", |
| 1040 | srcs: plat_public_policies_for_vendor + [ |
| 1041 | ":se_build_files{.plat_vendor_for_vendor}", |
| 1042 | ":se_build_files{.vendor}", |
| 1043 | ], |
| 1044 | installable: false, |
| 1045 | } |
| 1046 | |
| 1047 | se_policy_cil { |
| 1048 | name: "vendor_sepolicy.cil.raw", |
| 1049 | src: ":vendor_sepolicy.conf", |
| 1050 | filter_out: [":reqd_policy_mask_for_vendor.cil"], |
| 1051 | secilc_check: false, // will be done in se_versioned_policy module |
| 1052 | installable: false, |
| 1053 | } |
| 1054 | |
| 1055 | se_versioned_policy { |
| 1056 | name: "vendor_sepolicy.cil", |
| 1057 | base: ":pub_policy_for_vendor.cil", |
| 1058 | target_policy: ":vendor_sepolicy.cil.raw", |
| 1059 | version: "vendor", |
| 1060 | dependent_cils: [ |
| 1061 | ":plat_policy_for_vendor.cil", |
| 1062 | ":plat_pub_versioned.cil", |
| 1063 | ":plat_mapping_file_for_vendor", |
| 1064 | ], |
| 1065 | filter_out: [":plat_pub_versioned.cil"], |
| 1066 | vendor: true, |
| 1067 | } |
| 1068 | |
| 1069 | // odm_policy.cil - the odl sepolicy. This needs attributization and to be combined |
| 1070 | // with the platform-provided policy. It makes use of the reqd_policy_mask files from private |
| 1071 | // policy and the platform public policy files in order to use checkpolicy. |
| 1072 | se_policy_conf { |
| 1073 | name: "odm_sepolicy.conf", |
| 1074 | srcs: plat_public_policies_for_vendor + [ |
| 1075 | ":se_build_files{.plat_vendor_for_vendor}", |
| 1076 | ":se_build_files{.vendor}", |
| 1077 | ":se_build_files{.odm}", |
| 1078 | ], |
| 1079 | installable: false, |
| 1080 | } |
| 1081 | |
| 1082 | se_policy_cil { |
| 1083 | name: "odm_sepolicy.cil.raw", |
| 1084 | src: ":odm_sepolicy.conf", |
| 1085 | filter_out: [ |
| 1086 | ":reqd_policy_mask_for_vendor.cil", |
| 1087 | ":vendor_sepolicy.cil", |
| 1088 | ], |
| 1089 | secilc_check: false, // will be done in se_versioned_policy module |
| 1090 | installable: false, |
| 1091 | } |
| 1092 | |
| 1093 | se_versioned_policy { |
| 1094 | name: "odm_sepolicy.cil", |
| 1095 | base: ":pub_policy_for_vendor.cil", |
| 1096 | target_policy: ":odm_sepolicy.cil.raw", |
| 1097 | version: "vendor", |
| 1098 | dependent_cils: [ |
| 1099 | ":plat_policy_for_vendor.cil", |
| 1100 | ":plat_pub_versioned.cil", |
| 1101 | ":plat_mapping_file_for_vendor", |
| 1102 | ":vendor_sepolicy.cil", |
| 1103 | ], |
| 1104 | filter_out: [":plat_pub_versioned.cil", ":vendor_sepolicy.cil"], |
| 1105 | device_specific: true, |
| 1106 | } |
| 1107 | |
Inseob Kim | 039175b | 2021-03-25 15:37:34 +0900 | [diff] [blame] | 1108 | ////////////////////////////////// |
| 1109 | // Precompiled sepolicy is loaded if and only if: |
| 1110 | // - plat_sepolicy_and_mapping.sha256 equals |
| 1111 | // precompiled_sepolicy.plat_sepolicy_and_mapping.sha256 |
| 1112 | // AND |
| 1113 | // - system_ext_sepolicy_and_mapping.sha256 equals |
| 1114 | // precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256 |
| 1115 | // AND |
| 1116 | // - product_sepolicy_and_mapping.sha256 equals |
| 1117 | // precompiled_sepolicy.product_sepolicy_and_mapping.sha256 |
| 1118 | // See system/core/init/selinux.cpp for details. |
| 1119 | ////////////////////////////////// |
| 1120 | genrule { |
| 1121 | name: "plat_sepolicy_and_mapping.sha256_gen", |
| 1122 | srcs: [":plat_sepolicy.cil", ":plat_mapping_file"], |
| 1123 | out: ["plat_sepolicy_and_mapping.sha256"], |
| 1124 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 1125 | } |
| 1126 | |
| 1127 | prebuilt_etc { |
| 1128 | name: "plat_sepolicy_and_mapping.sha256", |
| 1129 | filename: "plat_sepolicy_and_mapping.sha256", |
| 1130 | src: ":plat_sepolicy_and_mapping.sha256_gen", |
| 1131 | relative_install_path: "selinux", |
| 1132 | } |
| 1133 | |
| 1134 | genrule { |
| 1135 | name: "system_ext_sepolicy_and_mapping.sha256_gen", |
| 1136 | srcs: [":system_ext_sepolicy.cil", ":system_ext_mapping_file"], |
| 1137 | out: ["system_ext_sepolicy_and_mapping.sha256"], |
| 1138 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 1139 | } |
| 1140 | |
| 1141 | prebuilt_etc { |
| 1142 | name: "system_ext_sepolicy_and_mapping.sha256", |
| 1143 | filename: "system_ext_sepolicy_and_mapping.sha256", |
| 1144 | src: ":system_ext_sepolicy_and_mapping.sha256_gen", |
| 1145 | relative_install_path: "selinux", |
| 1146 | system_ext_specific: true, |
| 1147 | } |
| 1148 | |
| 1149 | genrule { |
| 1150 | name: "product_sepolicy_and_mapping.sha256_gen", |
| 1151 | srcs: [":product_sepolicy.cil", ":product_mapping_file"], |
| 1152 | out: ["product_sepolicy_and_mapping.sha256"], |
| 1153 | cmd: "cat $(in) | sha256sum | cut -d' ' -f1 > $(out)", |
| 1154 | } |
| 1155 | |
| 1156 | prebuilt_etc { |
| 1157 | name: "product_sepolicy_and_mapping.sha256", |
| 1158 | filename: "product_sepolicy_and_mapping.sha256", |
| 1159 | src: ":product_sepolicy_and_mapping.sha256_gen", |
| 1160 | relative_install_path: "selinux", |
| 1161 | product_specific: true, |
| 1162 | } |
| 1163 | |
Inseob Kim | 1c056b1 | 2021-04-30 00:11:43 +0900 | [diff] [blame] | 1164 | sepolicy_vers { |
| 1165 | name: "plat_sepolicy_vers.txt", |
| 1166 | version: "vendor", |
| 1167 | vendor: true, |
| 1168 | } |
| 1169 | |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 1170 | soong_config_module_type { |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 1171 | name: "precompiled_sepolicy_prebuilts_defaults", |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 1172 | module_type: "prebuilt_defaults", |
| 1173 | config_namespace: "ANDROID", |
| 1174 | bool_variables: ["BOARD_USES_ODMIMAGE"], |
| 1175 | properties: ["vendor", "device_specific"], |
| 1176 | } |
| 1177 | |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 1178 | precompiled_sepolicy_prebuilts_defaults { |
| 1179 | name: "precompiled_sepolicy_prebuilts", |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 1180 | soong_config_variables: { |
| 1181 | BOARD_USES_ODMIMAGE: { |
| 1182 | device_specific: true, |
| 1183 | conditions_default: { |
| 1184 | vendor: true, |
| 1185 | }, |
| 1186 | }, |
| 1187 | }, |
| 1188 | } |
| 1189 | |
| 1190 | ////////////////////////////////// |
| 1191 | // SHA-256 digest of the plat_sepolicy.cil and plat_mapping_file against |
| 1192 | // which precompiled_policy was built. |
| 1193 | ////////////////////////////////// |
| 1194 | prebuilt_etc { |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 1195 | defaults: ["precompiled_sepolicy_prebuilts"], |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 1196 | name: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256", |
| 1197 | filename: "precompiled_sepolicy.plat_sepolicy_and_mapping.sha256", |
| 1198 | src: ":plat_sepolicy_and_mapping.sha256_gen", |
| 1199 | relative_install_path: "selinux", |
| 1200 | } |
| 1201 | |
| 1202 | ////////////////////////////////// |
| 1203 | // SHA-256 digest of the system_ext_sepolicy.cil and system_ext_mapping_file against |
| 1204 | // which precompiled_policy was built. |
| 1205 | ////////////////////////////////// |
| 1206 | prebuilt_etc { |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 1207 | defaults: ["precompiled_sepolicy_prebuilts"], |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 1208 | name: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256", |
| 1209 | filename: "precompiled_sepolicy.system_ext_sepolicy_and_mapping.sha256", |
| 1210 | src: ":system_ext_sepolicy_and_mapping.sha256_gen", |
| 1211 | relative_install_path: "selinux", |
| 1212 | } |
| 1213 | |
| 1214 | ////////////////////////////////// |
| 1215 | // SHA-256 digest of the product_sepolicy.cil and product_mapping_file against |
| 1216 | // which precompiled_policy was built. |
| 1217 | ////////////////////////////////// |
| 1218 | prebuilt_etc { |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 1219 | defaults: ["precompiled_sepolicy_prebuilts"], |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 1220 | name: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256", |
| 1221 | filename: "precompiled_sepolicy.product_sepolicy_and_mapping.sha256", |
| 1222 | src: ":product_sepolicy_and_mapping.sha256_gen", |
| 1223 | relative_install_path: "selinux", |
| 1224 | } |
| 1225 | |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 1226 | soong_config_module_type { |
| 1227 | name: "precompiled_se_policy_binary", |
| 1228 | module_type: "se_policy_binary", |
| 1229 | config_namespace: "ANDROID", |
| 1230 | bool_variables: ["BOARD_USES_ODMIMAGE", "IS_TARGET_MIXED_SEPOLICY"], |
| 1231 | value_variables: ["MIXED_SEPOLICY_VERSION"], |
| 1232 | properties: ["vendor", "device_specific", "srcs", "ignore_neverallow"], |
| 1233 | } |
| 1234 | |
| 1235 | precompiled_se_policy_binary { |
| 1236 | name: "precompiled_sepolicy", |
| 1237 | srcs: [ |
| 1238 | ":plat_sepolicy.cil", |
| 1239 | ":plat_pub_versioned.cil", |
| 1240 | ":system_ext_sepolicy.cil", |
| 1241 | ":product_sepolicy.cil", |
| 1242 | ":vendor_sepolicy.cil", |
| 1243 | ":odm_sepolicy.cil", |
| 1244 | ], |
| 1245 | soong_config_variables: { |
| 1246 | BOARD_USES_ODMIMAGE: { |
| 1247 | device_specific: true, |
| 1248 | conditions_default: { |
| 1249 | vendor: true, |
| 1250 | }, |
| 1251 | }, |
| 1252 | IS_TARGET_MIXED_SEPOLICY: { |
| 1253 | ignore_neverallow: true, |
Inseob Kim | 3ac62fe | 2021-12-16 19:00:03 +0900 | [diff] [blame] | 1254 | }, |
| 1255 | MIXED_SEPOLICY_VERSION: { |
| 1256 | srcs: [ |
| 1257 | ":plat_%s.cil", |
| 1258 | ":system_ext_%s.cil", |
| 1259 | ":product_%s.cil", |
| 1260 | ], |
| 1261 | conditions_default: { |
| 1262 | srcs: [ |
| 1263 | ":plat_mapping_file", |
| 1264 | ":system_ext_mapping_file", |
| 1265 | ":product_mapping_file", |
| 1266 | ], |
| 1267 | }, |
| 1268 | }, |
| 1269 | }, |
| 1270 | } |
Inseob Kim | 731182a | 2021-05-06 11:44:37 +0000 | [diff] [blame] | 1271 | |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 1272 | ////////////////////////////////// |
| 1273 | // SELinux policy embedded into CTS. |
| 1274 | // CTS checks neverallow rules of this policy against the policy of the device under test. |
| 1275 | ////////////////////////////////// |
| 1276 | se_policy_conf { |
| 1277 | name: "general_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1278 | srcs: plat_public_policy + |
| 1279 | plat_private_policy, |
Inseob Kim | a49e724 | 2021-03-22 10:26:13 +0900 | [diff] [blame] | 1280 | build_variant: "user", |
| 1281 | cts: true, |
| 1282 | exclude_build_test: true, |
| 1283 | } |
Inseob Kim | d581661 | 2021-09-15 03:01:05 +0000 | [diff] [blame] | 1284 | |
| 1285 | ////////////////////////////////// |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1286 | // Base system policy for treble sepolicy tests. |
| 1287 | // If system sepolicy is extended (e.g. by SoC vendors), their plat_pub_versioned.cil may differ |
| 1288 | // with system/sepolicy/prebuilts/api/{version}/plat_pub_versioned.cil. In that case, |
| 1289 | // BOARD_PLAT_PUB_VERSIONED_POLICY can be used to specify extended plat_pub_versioned.cil. |
| 1290 | // See treble_sepolicy_tests_for_release.mk for more details. |
| 1291 | ////////////////////////////////// |
| 1292 | se_policy_conf { |
| 1293 | name: "base_plat_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1294 | srcs: plat_public_policy + |
| 1295 | plat_private_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1296 | build_variant: "user", |
| 1297 | installable: false, |
| 1298 | } |
| 1299 | |
| 1300 | se_policy_cil { |
| 1301 | name: "base_plat_sepolicy.cil", |
| 1302 | src: ":base_plat_sepolicy.conf", |
| 1303 | additional_cil_files: ["private/technical_debt.cil"], |
| 1304 | installable: false, |
| 1305 | secilc_check: false, // done by se_policy_binary |
| 1306 | } |
| 1307 | |
| 1308 | se_policy_binary { |
| 1309 | name: "base_plat_sepolicy", |
| 1310 | srcs: [":base_plat_sepolicy.cil"], |
| 1311 | installable: false, |
| 1312 | } |
| 1313 | |
| 1314 | se_policy_conf { |
| 1315 | name: "base_system_ext_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1316 | srcs: plat_public_policy + |
| 1317 | plat_private_policy + |
| 1318 | system_ext_public_policy + |
| 1319 | system_ext_private_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1320 | build_variant: "user", |
| 1321 | installable: false, |
| 1322 | } |
| 1323 | |
| 1324 | se_policy_cil { |
| 1325 | name: "base_system_ext_sepolicy.cil", |
| 1326 | src: ":base_system_ext_sepolicy.conf", |
| 1327 | additional_cil_files: ["private/technical_debt.cil"], |
| 1328 | system_ext_specific: true, |
| 1329 | installable: false, |
| 1330 | secilc_check: false, // done by se_policy_binary |
| 1331 | } |
| 1332 | |
| 1333 | se_policy_binary { |
| 1334 | name: "base_system_ext_sepolicy", |
| 1335 | srcs: [":base_system_ext_sepolicy.cil"], |
| 1336 | system_ext_specific: true, |
| 1337 | installable: false, |
| 1338 | } |
| 1339 | |
| 1340 | se_policy_conf { |
| 1341 | name: "base_product_sepolicy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1342 | srcs: plat_public_policy + |
| 1343 | plat_private_policy + |
| 1344 | system_ext_public_policy + |
| 1345 | system_ext_private_policy + |
| 1346 | product_public_policy + |
| 1347 | product_private_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1348 | build_variant: "user", |
| 1349 | installable: false, |
| 1350 | } |
| 1351 | |
| 1352 | se_policy_cil { |
| 1353 | name: "base_product_sepolicy.cil", |
| 1354 | src: ":base_product_sepolicy.conf", |
| 1355 | additional_cil_files: ["private/technical_debt.cil"], |
| 1356 | product_specific: true, |
| 1357 | installable: false, |
| 1358 | secilc_check: false, // done by se_policy_binary |
| 1359 | } |
| 1360 | |
| 1361 | se_policy_binary { |
| 1362 | name: "base_product_sepolicy", |
| 1363 | srcs: [":base_product_sepolicy.cil"], |
| 1364 | product_specific: true, |
| 1365 | installable: false, |
| 1366 | } |
| 1367 | |
| 1368 | se_policy_conf { |
| 1369 | name: "base_plat_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1370 | srcs: plat_public_policy + |
| 1371 | reqd_mask_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1372 | build_variant: "user", |
| 1373 | installable: false, |
| 1374 | } |
| 1375 | |
| 1376 | se_policy_cil { |
| 1377 | name: "base_plat_pub_policy.cil", |
| 1378 | src: ":base_plat_pub_policy.conf", |
| 1379 | filter_out: [":reqd_policy_mask.cil"], |
| 1380 | secilc_check: false, |
| 1381 | installable: false, |
| 1382 | } |
| 1383 | |
| 1384 | se_policy_conf { |
| 1385 | name: "base_system_ext_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1386 | srcs: plat_public_policy + |
| 1387 | system_ext_public_policy + |
| 1388 | reqd_mask_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1389 | build_variant: "user", |
| 1390 | installable: false, |
| 1391 | } |
| 1392 | |
| 1393 | se_policy_cil { |
| 1394 | name: "base_system_ext_pub_policy.cil", |
| 1395 | src: ":base_system_ext_pub_policy.conf", |
| 1396 | filter_out: [":reqd_policy_mask.cil"], |
| 1397 | secilc_check: false, |
| 1398 | installable: false, |
| 1399 | } |
| 1400 | |
| 1401 | se_policy_conf { |
| 1402 | name: "base_product_pub_policy.conf", |
Inseob Kim | 0a707fa | 2021-12-09 23:35:11 +0900 | [diff] [blame] | 1403 | srcs: plat_public_policy + |
| 1404 | system_ext_public_policy + |
| 1405 | product_public_policy + |
| 1406 | reqd_mask_policy, |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1407 | build_variant: "user", |
| 1408 | installable: false, |
| 1409 | } |
| 1410 | |
| 1411 | se_policy_cil { |
| 1412 | name: "base_product_pub_policy.cil", |
| 1413 | src: ":base_product_pub_policy.conf", |
| 1414 | filter_out: [":reqd_policy_mask.cil"], |
| 1415 | secilc_check: false, |
| 1416 | installable: false, |
| 1417 | } |
| 1418 | |
Yi-Yo Chiang | 2c18965 | 2021-11-08 19:30:04 +0800 | [diff] [blame] | 1419 | // bug_map - Bug tracking information for selinux denials loaded by auditd. |
| 1420 | se_filegroup { |
| 1421 | name: "bug_map_files", |
| 1422 | srcs: ["bug_map"], |
| 1423 | } |
| 1424 | |
| 1425 | se_bug_map { |
| 1426 | name: "plat_bug_map", |
| 1427 | srcs: [":bug_map_files"], |
| 1428 | stem: "bug_map", |
| 1429 | } |
| 1430 | |
| 1431 | se_bug_map { |
| 1432 | name: "system_ext_bug_map", |
| 1433 | srcs: [":bug_map_files"], |
| 1434 | stem: "bug_map", |
| 1435 | system_ext_specific: true, |
| 1436 | } |
| 1437 | |
| 1438 | se_bug_map { |
| 1439 | name: "vendor_bug_map", |
| 1440 | srcs: [":bug_map_files"], |
| 1441 | // Legacy file name of the vendor partition bug_map. |
| 1442 | stem: "selinux_denial_metadata", |
| 1443 | vendor: true, |
| 1444 | } |
| 1445 | |
Inseob Kim | 4d90b7e | 2021-09-27 13:43:01 +0000 | [diff] [blame] | 1446 | ////////////////////////////////// |
Inseob Kim | d581661 | 2021-09-15 03:01:05 +0000 | [diff] [blame] | 1447 | // se_freeze_test compares the plat sepolicy with the prebuilt sepolicy |
| 1448 | // Additional directories can be specified via Makefile variables: |
| 1449 | // SEPOLICY_FREEZE_TEST_EXTRA_DIRS and SEPOLICY_FREEZE_TEST_EXTRA_PREBUILT_DIRS. |
| 1450 | ////////////////////////////////// |
| 1451 | se_freeze_test { |
| 1452 | name: "sepolicy_freeze_test", |
| 1453 | } |
Yuntao Xu | 42e732c | 2021-11-18 22:33:02 +0000 | [diff] [blame] | 1454 | |
| 1455 | ////////////////////////////////// |
| 1456 | // Makefile rules temporary imported to Soong |
| 1457 | // TODO(b/33691272): remove these after migrating seapp to Soong |
| 1458 | ////////////////////////////////// |
| 1459 | makefile_goal { |
| 1460 | name: "plat_seapp_contexts_rule", |
| 1461 | product_out_path: "obj/ETC/plat_seapp_contexts_intermediates/plat_seapp_contexts", |
| 1462 | } |
| 1463 | |
| 1464 | makefile_goal { |
| 1465 | name: "plat_seapp_neverallows_rule", |
| 1466 | product_out_path: "obj/ETC/plat_seapp_neverallows_intermediates/plat_seapp_neverallows", |
| 1467 | } |