Commit graph

33572 commits

Author SHA1 Message Date
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
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
Akilesh Kailash
9de6ad61ff Merge "New property to control Async I/O for snapuserd" 2022-01-14 00:06:23 +00:00
Akilesh Kailash
5c5fd255d2 New property to control Async I/O for snapuserd
io_uring_setup() system call requires ipc_lock.

(avc: denied { ipc_lock } for comm="snapuserd" capability=14 scontext=u:r:snapuserd:s0 tcontext=u:r:snapuserd:s0 tclass=capability permissive=0)

Add selinux policy.

Bug: 202784286
Test: OTA tests
Signed-off-by: Akilesh Kailash <akailash@google.com>
Change-Id: I806714c7ade0a5d4821b061396c9f064ee5ed8b6
2022-01-13 06:27:46 +00:00
Treehugger Robot
70cd2da646 Merge "Allow authfs to read extra APK mount" 2022-01-13 01:06:01 +00:00
Jeremy Meyer
0f72360b2f Merge "Add resources_manager_service" 2022-01-12 20:41:28 +00:00
Treehugger Robot
b4cc3b36f4 Merge "Make virtual_device_service accessible from CTS" 2022-01-12 18:28:15 +00:00
Yabin Cui
927d7a752b Restrict write access to etm sysfs interface.
Bug: 213519191
Test: boot device
Change-Id: I40d110baea5593a597efa3c14fd0adecee23fc0f
2022-01-11 14:12:52 -08:00
Maurice Lam
2e38cfa2f7 Make virtual_device_service accessible from CTS
This is safe because methods in VirtualDeviceManager are guarded by
the internal|role permission CREATE_VIRTUAL_DEVICE, and all subseuqent
methods can only be called on the returned binder.

Fixes: 209527778
Test: Manual
Change-Id: I60a5cf76eec1e45803cf09ab4924331f7c12ced4
2022-01-11 13:21:14 -08:00
Treehugger Robot
175f50137e Merge "Support for APEX updatable sepolicy" 2022-01-11 13:49:24 +00:00
Jeff Vander Stoep
f9348b5509 Support for APEX updatable sepolicy
Builds:
 - sepolicy_test - file that init mounts in /dev/selinux to demonstrate
   that updatable sepolicy is loaded.
 - apex_sepolicy.cil - Initially includes a rule allowing shell
   to read sepolicy_test.
 - apex_file_contexts - Initially includes mapping of
    /dev/selinux/sepolicy_test.
 - apex_sepolicy.sha256. Used by init to determine of
    precompiled_sepolicy can be used.
 - apex_service_contexts - Currently empty.
 - apex_property_contexts - Currently empty.
 - apex_seapp_contexts - Currently empty.

Bug: 199914227
Test: Build, boot, ls -laZ /dev/selinux/sepolicy_test
Change-Id: I6aa625dda5235c6e7a0cfff777a9e15606084c12
2022-01-11 12:52:09 +01:00
Jeremy Meyer
d8a3c2b156 Add resources_manager_service
Test: manual, calling the service with `adb shell cmd` works
Bug: 206615535
Change-Id: I8d3b945f6abff352991446e5d88e5a535a7f9ccf
2022-01-10 23:03:42 +00:00
Michael Rosenfeld
30aace3ebe Merge "Allow the shell to disable charging." 2022-01-10 22:18:49 +00:00
Florian Mayer
11db93a15b Merge "[MTE] Allow system_app to write memtag property." 2022-01-10 21:12:02 +00:00
Michael Rosenfeld
5425c870f9 Allow the shell to disable charging.
Bug: 204184680
Test: manual and through instrumentation
Change-Id: I1fe9b35d51140eccba9c05c956875c512de447b1
2022-01-10 10:36:01 -08:00
Treehugger Robot
a394cfca86 Merge "Remove obsolete ioctl allow" 2022-01-10 12:45:01 +00: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
Treehugger Robot
e9b0ec455d Merge "Migrate sepolicy compat test to Android.bp" 2022-01-10 02:09:23 +00:00
Joel Galenson
823d1725d4 Merge "Remove self from OWNERS" 2022-01-07 21:59:10 +00:00
Florian Mayer
39f29f758e [MTE] Allow system_app to write memtag property.
Bug: 206895651
Change-Id: I6463965c094b9b3c4f3f70929a09e109ee9c84b9
2022-01-07 11:39:10 -08:00
Alan Stokes
67a8605deb Remove obsolete ioctl allow
No longer used, so remove the allow.

Bug: 199259751
Test: Presubmits
Change-Id: Iea61d29d14b13de86f7fbd6b6e416eea745b615e
2022-01-07 10:42:17 +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
Treehugger Robot
46680d001f Merge "Allow VS to run derive_classpath" 2022-01-07 09:11:08 +00:00
Bob Badour
ada5f690db Merge "[LSC] Add LOCAL_LICENSE_KINDS to system/sepolicy" 2022-01-07 01:49:45 +00:00
Xinyi Zhou
b6a6ff20ef Merge "Allow system app to find NearbyManager" 2022-01-06 19:28:05 +00:00
Joel Galenson
d010966778 Remove self from OWNERS
Test: None
Change-Id: I23e5b3082bdbfcbb2673cfb6e377dc74717bf324
2022-01-06 10:01:26 -08:00
Alan Stokes
3fad86bb8a Allow VS to run derive_classpath
We run it in our domain since it requires fairly minimal access.

Bug: 210472252
Test: atest virtualizationservice_device_test
Test: composd_cmd test-compile
Change-Id: Ia770cd38bda67f79f56549331d3a36d7979a5d5b
2022-01-06 15:58:59 +00:00
Alan Stokes
3b0f637ad0 Merge "Allow compos to run derive_classpath" 2022-01-06 15:57:33 +00:00
Josh Yang
0d721a105f Merge "Label /data/bootanim with bootanim_data_file." 2022-01-06 03:17:58 +00:00
Victor Hsieh
a59b030341 Allow authfs to read extra APK mount
Bug: 206869687
Test: Add debug log to compos.  See correct content from the proto.
Change-Id: I4f2b4096808efc1b15c218a225b451731f37e43d
2022-01-05 15:21:51 -08:00
Treehugger Robot
f650c54ee1 Merge "Allow untrusted apps to access incidentcompanion" 2022-01-05 21:10:55 +00:00
Xinyi Zhou
e9857ab5cf Allow system app to find NearbyManager
Bug: 189954300
Test: -build, flash, boot
Change-Id: Ia21b10213311b0639f320b559e78963d562f30a3
2022-01-05 11:57:44 -08:00
Bob Badour
048e48cbed [LSC] Add LOCAL_LICENSE_KINDS to system/sepolicy
Added SPDX-license-identifier-Apache-2.0 to:
  compat/Android.bp
  contexts/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Ie1f38c4f255b6c0b3d2351638cfa3a43e6cf130c
2022-01-05 11:14:44 -08:00
Alan Stokes
d313282433 Allow compos to run derive_classpath
We run it in the compos domain, since it doesn't require very much
additional access.

Bug: 189164487
Test: composd_cmd test-compile
Change-Id: I9ef26dd60225505086e45185289e3e03d0a8de8e
2022-01-05 18:06:27 +00:00
Treehugger Robot
ee113cf132 Merge "Rename neverallow_test.go to sepolicy_neverallow" 2022-01-05 03:46:50 +00:00
Treehugger Robot
3a7e19c3d4 Merge "Allow composd to delete ART staging files" 2022-01-04 11:13:55 +00:00
Andrew Walbran
d020fc05f3 Merge "Add comment explaining why crosvm shouldn't be allowed to open files." 2022-01-04 10:40:23 +00:00
Alan Stokes
ce6e2987de Allow composd to delete ART staging files
If the directory is non-empty when we start we need to delete
everything in it, but didn't have enough access:

avc: denied { getattr } for
path="/data/misc/apexdata/com.android.art/staging/boot-framework.art"
dev="dm-37" ino=57755 scontext=u:r:composd:s0
tcontext=u:object_r:apex_art_staging_data_file:s0 tclass=file
permissive=0

Bug: 205750213
Test: create files in staging/, composd_cmd test-compile
Change-Id: I3a66db7f5fbff82abcf547cb1c2b24e9c53ab158
2022-01-04 09:14:05 +00:00
Jiyong Park
0878ac4c47 Merge "Allow virtualizationservice to check for PKVM extension" 2022-01-03 09:30:05 +00:00
Jiyong Park
2dd48d0400 Allow virtualizationservice to check for PKVM extension
Bug: 210803811
Test: watch TH for all our tests
Change-Id: Iac4528fa2a0dbebeca4504469624f50832689f43
2022-01-03 14:59:58 +09:00
Maciej Żenczykowski
0f1b55ee24 Merge "[NC#3] clatd: remove raw and packet socket creation privs" 2021-12-30 19:50:00 +00: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
Inseob Kim
24401df041 Rename neverallow_test.go to sepolicy_neverallow
Because Go command line tooling assumes *_test.go files are tests and
not package sources.

Test: build
Change-Id: Ie332b89140b93c4ea448009cafa2556ef888497c
2021-12-29 04:58:17 +00:00
Inseob Kim
893eef25ab Remove redundant lines
Test: build
Change-Id: I809874900835503a41117d3f8971d72718d4a075
2021-12-29 13:53:38 +09:00
Inseob Kim
5bbcd68dcc Build recovery policy with Android.bp
Bug: 33691272
Test: enter recovery mode
Change-Id: Ifc38ed99e6615431d81ade76ec10ea4d34fbbf90
2021-12-28 17:51:51 +09:00
Treehugger Robot
ca043d348f Merge "Migrate neverallow tests to Android.bp" 2021-12-28 03:16:58 +00:00
Inseob Kim
9d7e9a3491 Merge "Allow app to get dck_prop" 2021-12-28 01:55:30 +00:00