Commit graph

500 commits

Author SHA1 Message Date
Inseob Kim
f8079faaa5 Fix BOARD_API_FROZEN conditions
Bug: 330670954
Test: m selinux_policy on frozen release
Change-Id: I494cd5afcd2f6014d19e2cd4061b4cc812a7dbc5
2024-04-22 15:40:29 +09:00
Inseob Kim
021596b37f Run neverallow tests on build time
sepolicy_neverallows hasn't been running on `m droid` because of
LOCAL_UNINSTALLED_MODULE := true.

Test: m selinux_policy
Change-Id: Ia7a79723a0f92e659171f50a0829baf83f311661
2024-04-15 11:08:17 +09:00
Inseob Kim
d88d8959a8 Merge changes from topic "revert-2954994-revert-2952245-vfrc_as_tot_sepolicy-AMFGMLDWQF-IIRWTIICIK" into main
* changes:
  Revert^2 "Add 1000000.0 mapping file temporarily"
  Revert^2 "Fix freeze test condition to board api"
2024-02-13 04:02:36 +00:00
Inseob Kim
e41e95e0ea Revert^2 "Add 1000000.0 mapping file temporarily"
82126e9d77

Change-Id: Ia2ef237d9918532f24cd00688ae2bc15196123e9
2024-02-13 02:19:24 +00:00
Inseob Kim
e28eb52f4e Revert^2 "Fix freeze test condition to board api"
f3fad1a66b

Change-Id: I19b36342de003a32a2c76fb513382f1b34cf5a7e
2024-02-13 02:19:48 +00:00
Ikjoon Jang
1c9aa0cb18 Merge changes from topic "revert-2952245-vfrc_as_tot_sepolicy-AMFGMLDWQF" into main
* changes:
  Revert "Fix freeze test condition to board api"
  Revert "Add 1000000.0 mapping file temporarily"
2024-02-08 04:47:21 +00:00
Ikjoon Jang
f3fad1a66b Revert "Fix freeze test condition to board api"
Revert submission 2952245-vfrc_as_tot_sepolicy

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=git_main&target=mainline_modules_arm64-mainline-userdebug&lkgb=11421838&lkbb=11421957&fkbb=11421841, b/324335916

Reverted changes: /q/submissionid:2952245-vfrc_as_tot_sepolicy

Bug: 324335916
Change-Id: Iada55b1298872ae2f2ff4112726dcbcd089597f1
2024-02-08 04:45:26 +00:00
Ikjoon Jang
82126e9d77 Revert "Add 1000000.0 mapping file temporarily"
Revert submission 2952245-vfrc_as_tot_sepolicy

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.corp.google.com/builds/quarterdeck?branch=git_main&target=mainline_modules_arm64-mainline-userdebug&lkgb=11421838&lkbb=11421957&fkbb=11421841, b/324335916

Reverted changes: /q/submissionid:2952245-vfrc_as_tot_sepolicy

Bug: 324335916
Change-Id: I9375f4d467596bc961527216b3f68c0f21016ca3
2024-02-08 02:54:29 +00:00
Inseob Kim
569241f82f Merge changes from topic "vfrc_as_tot_sepolicy" into main
* changes:
  Add 1000000.0 mapping file temporarily
  Fix freeze test condition to board api
2024-02-08 01:12:47 +00:00
Inseob Kim
76bbf006dc Remove LOCAL_FILE_CONTEXTS
It's not used anymore.

Bug: N/A
Test: TH
Change-Id: I139c4c11bf0cd2255c70ddb67376e186b73c04ce
2024-01-18 12:33:36 +09:00
Inseob Kim
dd3910bbe6 Add 1000000.0 mapping file temporarily
Will be removed once new ToT (202404) propagates.

Bug: 314010177
Test: build and boot
Test: TH
Change-Id: I6913e953aa479eaf0be15ddf9fd8047b00d58fe3
2024-01-17 16:09:35 +09:00
Inseob Kim
7a235a4d9d Fix freeze test condition to board api
Bug: 314010177
Test: build and boot
Change-Id: I5ccd1018a0dadb5259ac23a18635951cee107421
2024-01-17 16:09:23 +09:00
Inseob Kim
6a03f9df6a Remove hack regarding vFRC versioning
Bug: 314010177
Test: TH
Change-Id: Ife9dfcda62ea61b7af6a34d19be2433820237d28
2024-01-05 01:02:18 +00:00
Inseob Kim
3e34b72f9c Change sepolicy version format for vFRC
sepolicy versioning is for system <-> vendor compatibility. This changes
sepolicy version format from sdk version (e.g. 34.0) to vendor api
version (e.g. 202404.0).

Bug: 314010177
Test: build and boot
Change-Id: I2422c416b7fb85af64c8c835497bbecd2e10e2ab
2023-12-19 13:35:38 +09:00
Inseob Kim
3a9d91ce68 Add dev_type test
Files under /dev should have dev_type attribute.

Bug: 303367345
Test: m selinux_policy
Change-Id: Iaa1e39338e2fae32086bd770c6f3ab4b33bb82aa
2023-11-21 16:47:03 +09:00
Inseob Kim
8ecc1b8372 Revert^2 "Use Soong-processed files for file_contexts.bin"
This reverts commit 32a83de069.

Reason for revert: fixed breakage, relanding

Change-Id: I3f9e4258418dd60acca4cda90ad34a2116689a0f
2023-11-03 06:02:30 +00:00
Bob Yang
32a83de069 Revert "Use Soong-processed files for file_contexts.bin"
This reverts commit d1401b7a2f.

Reason for revert: DroidMonitor-triggered revert due to breakage, bug 308055894

Change-Id: Ic22a37a6d32662344da80fb28751e8c34803a82e
2023-10-27 04:17:02 +00:00
Inseob Kim
d1401b7a2f Use Soong-processed files for file_contexts.bin
This should be no-op but will be useful when we implement Trunk Stable
aware contexts. Also this removes complexity from Android.mk.

Bug: 306563735
Test: build
Change-Id: Ie7e2c2c8c1e813af0ea617a2e29589b660c1bdaf
2023-10-25 23:51:44 +09:00
Treehugger Robot
6952d2f612 Merge "Use prebuilts for compat test if prebuilts exist" into main 2023-09-08 04:35:02 +00:00
Inseob Kim
472d7dcada Fix se_freeze_test
The module name is changed but it isn't applied to Android.mk

Bug: 296875906
Test: m selinux_policy and see se_freeze_test run
Change-Id: Ia25845a1aff2c2b5f910f8432a455ee93a157580
2023-09-08 11:54:11 +09:00
Inseob Kim
2aac33597d Use prebuilts for compat test if prebuilts exist
system/sepolicy should support both REL build and ToT build. That means
that system/sepolicy and prebuilts may differ. As the frozen sepolicy is
what vendor sepolicy uses, so we need to use prebuilts to run Treble
compat test.

Bug: 296875906
Test: m selinux_policy on REL
Change-Id: I4b290266ba87e3f011d640bec133fc88359ea52f
2023-09-08 10:44:49 +09:00
Inseob Kim
5d7423ff3d Build prebuilt policy with Soong
... and remove redundant Makefile codes. This also updates commit hook
as we now only use Soong to build sepolicy.

Bug: 296875906
Test: m selinux_policy
Change-Id: I93f0d222a0c10e31c51c9380780a8927c47d62b1
2023-09-07 16:32:30 +09:00
Inseob Kim
6c6aa01ae4 Remove code about mixed sepolicy build
There is no one actively using mixed sepolicy build, and it made
sepolicy codes too complicated. As we are deprecating mixed build,
removing such code for cleanup.

Bug: 298305798
Test: boot cuttlefish
Change-Id: I8beedd5a281fa957532deecb857da4e1bb66992a
2023-08-31 16:54:17 +09:00
Inseob Kim
d7b381caca Revert "Add BUILD_BROKEN_VENDOR_SEAPP_USES_COREDOMAIN"
Revert submission 2715179-BUILD_BROKEN_VENDOR_SEAPP_USES_COREDOMAIN

Reason for revert: not needed

Reverted changes: /q/submissionid:2715179-BUILD_BROKEN_VENDOR_SEAPP_USES_COREDOMAIN

Change-Id: I4595a648691e11b0f3860b0d1414fbc9b9c94791
2023-08-23 02:07:47 +00:00
Inseob Kim
d8de8757ae Add BUILD_BROKEN_VENDOR_SEAPP_USES_COREDOMAIN
Starting from Android V, vendor seapp_contexts files can't assign
coredomain to vendor apps, as it's Treble violation. This build broken
variable is to suppress the enforcement for devices launching with U or
prior.

Bug: 280547417
Test: set BUILD_BROKEN_VENDOR_SEAPP_USES_COREDOMAIN := true and build
Change-Id: I7b91db8183a867aa490e490e56cb872ea830b21f
2023-08-21 15:15:34 +09:00
Steven Moreland
721f5af6a3 sepolicy: take sepolicy split in .mk
This value is always set to true in the core build
system. Removing reads of it so we can mark it as
obsolete.

Bug: 257176017
Test: build
Change-Id: Ie7a72496bd4712583944ed833cd4364c5e3c520b
2023-06-02 16:14:17 +00:00
Jooyung Han
49bd2148a4 Remove unused def
Bug: n/a
Test: m
Change-Id: I7d35c6395b4e956e2d6e34e38749a3bf21af81e1
2023-04-03 15:21:32 +09:00
Inseob Kim
3bb2033eb1 Add odm_service_contexts module
Bug: 240609481
Test: build and boot
Change-Id: I5412b4a190d30490cad1bf2b9de1afd16085eb26
2022-10-24 20:41:45 +09:00
Sandro
692c3ad3b2 Rollback "Move allow rules of sdk_sandbox to apex policy"
Rolling back the changes from aosp/2206999.

Bug: 243923977#comment9
Test: atest SeamendcHostTest
Change-Id: I361811d021523f48f08bab5353ea5e03bc58fbef
2022-09-26 11:49:45 +00:00
Pawan
0ecf99def5 sepolicy : Recommend fuzzers for new services
Adding soong module and tool to check if there is fuzzer present
for every service in private/service_contexts. Whenever a service is
added, its is recommended to update
$ANDROID_BUILD_TOP/system/sepolicy/soong/build/service_fuzzer_bindings.go
with service name and its corresponding fuzzer.

Test: m
Bug: 242104782
Change-Id: Id9bc45f50bebf464de7c91c7469d4bb6ff153ebd
2022-09-13 18:18:46 +00:00
Sandro
084b41748d Move allow rules of sdk_sandbox to apex policy
Third attempt to roll-forward the apex_sepolicy changes from
aosp/2179294 and aosp/2170746.

I was finally able to figure out the likely root cause of the test
breakages in internal b/243971667. The related CL aosp/2199179 is making
the apex_sepolicy files mandatory for all AOSP builds.

Without the apex_sepolicy files, mixed GSI builds in internal using AOSP
as base would not implement the sdk_sandbox rules, causing breakages for
the SdkSandbox components.

Bug: 243923977
Test: atest SeamendcHostTest
Change-Id: I27ee933da6648cca8ff1f37bde388f72b4fe6ad6
2022-09-01 09:11:38 +00:00
Inseob Kim
6d79030d0c Build mac_permissions.xml with Soong
Bug: 33691272
Test: build and compare
Change-Id: Iacbd5bcf77f0b1c0b5e2c6691efb4c62bc78fdf8
2022-08-17 09:49:35 +09:00
Treehugger Robot
7a015c31ed Merge "Obsolete BOARD_PLAT_*_SEPOLICY_DIR" am: 747fc1236e am: e9cd3e95cb
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2120421

Change-Id: Idf614d34ba934688b4d9e7a22be28b5d133c54b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 02:35:02 +00:00
Dan Willemsen
9dd75fe474 Obsolete BOARD_PLAT_*_SEPOLICY_DIR
See If803a33efc38a970247919bf224c12b8c717f955 for more details.

Bug: 235414673
Test: treehugger
Change-Id: Iff939a58e0a8238e085d63f28b5fa8d7982d82a0
2022-06-09 09:36:21 -07:00
satayev
49d1c7ff6d Remove precompiled apex sepolicy from system image.
Include Merged-In tag to avoid reverting in git_master

Bug: 199914227
Test: presubmit and manual verification
Ignore-AOSP-First: tm-dev change
Merged-In: I191c4dbe48df026826ddd22770094be4c1d9aec0
Change-Id: Id4c96cc145eab5758650c68b94b80c79bf614932
2022-04-14 12:27:15 +00:00
Inseob Kim
c7596c4e61 Build vndservice_contexts with Android.bp
Bug: 33691272
Test: boot a device which uses vndservice_contexts
Change-Id: I28c36b74d4176954099f3b7e80a4869b7c44640f
2022-03-02 17:26:44 +09:00
Inseob Kim
61257ca545 Move sepolicy_test to Android.bp
Bug: 33691272
Test: m selinux_policy triggers sepolicy_test
Change-Id: I1618c2a35b3ce9d747db3955788427dc422fd532
2022-03-02 17:25:52 +09:00
Treehugger Robot
8e6b55a13d Merge "Remove compat test from treble sepolicy tests" 2022-02-17 01:26:04 +00:00
Treehugger Robot
8817edcbb4 Merge "Revert^2 "Migrate contexts tests to Android.bp"" 2022-02-16 04:23:47 +00:00
Inseob Kim
73f43ff847 Remove compat test from treble sepolicy tests
Treble sepolicy tests check whether previous versions are compatible to
ToT sepolicy or not. treble_sepolicy_tests_for_release.mk implements it,
but it also includes a compat test whether ToT sepolicy + {ver} mapping
+ {ver} plat_pub_versioned.cil can be built together or not. We
definitely need such tests, but we already have a test called "compat
test" which does exactly that, and testing it again with Treble sepolicy
tests is just redundant. The only difference between those two is that
Treble sepolicy tests can also test system_ext and product compat files,
which was contributed by a partner.

The ultimate goal here is to migrate *.mk to Soong, thus merging these
two tests (compat, Treble) into one. As we've already migrated the
compat test to Soong, this change removes the compat test part from
treble sepolicy tests. Instead, the compat test will be extended so it
can test system_ext and product compat files too.
prebuilts/api/{ver}/plat_pub_versioned.cil and
prebuilts/api/{ver}/vendor_sepolicy.cil are also removed as they aren't
used anymore: vendor_sepolicy.cil is an empty stub, and
plat_pub_versioned.cil can be built from the prebuilt source files.

Bug: 33691272
Test: m selinux_policy
Change-Id: I72f5ad0e8bbe6a7c0bbcc02f0f902b953df6ff1a
2022-02-16 04:09:29 +00:00
Inseob Kim
b5e235346e Revert^2 "Migrate contexts tests to Android.bp"
This reverts commit baa93cc651.

Reason for revert: amlogic build fixed

Change-Id: I8b046dc810d47a2d87012f02a668873889fce705
2022-02-16 02:26:11 +00:00
Treehugger Robot
d0120eb4ac Merge "Build precompiled_sepolicy.apex_sepolicy.sha256" 2022-01-31 09:11:05 +00:00
Jeff Vander Stoep
fd5dd79984 Build precompiled_sepolicy.apex_sepolicy.sha256
This ensures that precompiled policy can be checked against updatable
sepolicy from com.android.sepolicy. This saves ~1s of boot time.

Bug: 199914227
Test: build, verify that precompiled_sepolicy.apex_sepolicy.sha256
exists.

Change-Id: I1ce6b3363d418c073f95f120908107604799fd26
2022-01-28 13:45:39 +01:00
Inseob Kim
baa93cc651 Revert "Migrate contexts tests to Android.bp"
This reverts commit f612656adf.

Reason for revert: breaking amlogic build

Change-Id: I129b5cb74259c9c028483e84c9b2ac3597c24701
2022-01-14 06:13:28 +00:00
Inseob Kim
f612656adf Migrate contexts tests to Android.bp
Now that we have sepolicy module in Android.bp, we can migrate contexts
tests. Also vendor_service_contexts_test will be run, as we now include
vendor_service_contexts unconditionally.

Unfortunately, vendor_service_contexts_test is now broken, due to a
malformed type hal_power_stats_vendor_service. We will temporarily
exempt the type from the test, to speed up migrating to Android.bp.

Bug: 33691272
Test: m selinux_policy and see tests running
Test: add a malformed type other than hal_power_stats_vendor_service and
      run tests
Change-Id: Ic60eb38b9a7c79006f0b5ff4453768e03006604b
2022-01-14 10:59:59 +09:00
Inseob Kim
d93c2f7a45 Merge "Use "data: libsepolwrap" in python binaries" 2022-01-10 12:44:27 +00:00
Inseob Kim
483c0b3a7d Merge "Migrate seapp_contexts to Android.bp" 2022-01-10 11:15:28 +00:00
Inseob Kim
16d3be3dac Migrate sepolicy compat test to Android.bp
compat_test tests whether {ver}.compat.cil is compatible to current
policy or not. This commit migrates all tests into a single module named
"sepolicy_compat_tests".

A minor issue is also resolved with this migration. Suppose that the
vendor's speolicy version is {VER}. Then the following cil files are
compiled in runtime.

- system/etc/selinux/plat_sepolicy.cil
- system/etc/selinux/mapping/{VER}.cil
- system/etc/selinux/mapping/{VER}.compat.cil (optional)
- system_ext/etc/selinux/system_ext_sepolicy.cil (optional)
- system_ext/etc/selinux/mapping/{VER}.cil (optional)
- system_ext/etc/selinux/mapping/{VER}.compat.cil (optional)
- product/etc/selinux/product_sepolicy.cil (optional)
- product/etc/selinux/mapping/{VER}.cil (optional)
- product/etc/selinux/mapping/{VER}.compat.cil (optional)
- vendor/etc/selinux/vendor_sepolicy.cil
- vendor/etc/selinux/plat_pub_versioned.cil
- odm/etc/selinux/odm_sepolicy.cil (optional)

That is, the vendor policy of version {VER} (vendor_sepolicy.cil,
plat_pub_versioned.cil, and odm_sepolicy.cil) is required to be
compatible only to {VER}.compat.cil. So, the vendor policy is included
only to $(BOARD_SEPOLICY_VERS)_compat_test. The other tests will be
built only with platform side policies.

Bug: 33691272
Test: boot
Test: manually edit {ver}.compat.cil files and try build
Change-Id: I16b30a9171f10ee8f08fc03b7bd7c047eec12b19
2022-01-07 18:53:46 +09:00
Inseob Kim
2dac267dae Migrate seapp_contexts to Android.bp
Bug: 33691272
Test: build and boot
Test: atest SELinuxHostTest#testValidSeappContexts
Change-Id: I86f9d010d1628f9756cc152b4ee74dea1b9ff955
2021-12-29 17:54:57 +09:00
Inseob Kim
6fa8efdf4a Use "data: libsepolwrap" in python binaries
To avoid hard-coded paths in Android.mk rules.

Test: m selinux_policy
Change-Id: I7b464fa2953e01ccb6fff8daa3e219ae372313c5
2021-12-29 04:58:30 +00:00