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