Commit graph

33586 commits

Author SHA1 Message Date
Valentin Iftime
e1a4b8c705 Add sepolicy for external lazy camera HALs
Test: atest CtsCameraTestCases

Bug: 191248460

Testt: m
Test: presubmit

Change-Id: Ia3b07247f9929c1898efa86d892ea8ad3c2041dc
2022-01-17 18:48:00 +01:00
Jiyong Park
2832f957e7 Merge "Add policies for diced and hal_dice in microdroid" 2022-01-17 13:29:34 +00:00
Andrew Walbran
a0b12be876 Merge "Allow crosvm to mlock VM memory." 2022-01-17 11:58:08 +00:00
Inseob Kim
9a8ffe8cf1 Merge "Add a skeleton sepolicy compat generator" 2022-01-17 11:27:15 +00:00
Inseob Kim
29e357e898 Add a skeleton sepolicy compat generator
sepolicy_generate_compat will be used to generate compat files for ToT,
based on the mapping file from aosp_arm64-userdebug target of {ver}
source tree. For now, it only supports downloading a mapping file
system/etc/selinux/mapping/{ver}.cil from the Android build server.

Bug: 214336258
Test: sepolicy_generate_compat --branch sc-v2-dev --version 32.0
Change-Id: I48043c71a6866aa385ecd67462f7678561cc5a38
2022-01-17 17:05:46 +09:00
Treehugger Robot
d6a5b604ce Merge "Add sepolicy for logd and logcat services" 2022-01-14 20:44:35 +00:00
Nikita Ioffe
52e44e8022 Merge "Move allow rules from public/app.te to private/app.te" 2022-01-14 17:47:29 +00:00
Andrew Walbran
ed82cc82be Allow crosvm to mlock VM memory.
Bug: 204298056
Change-Id: I5b00273ffa37d4c1ea2f26bb40822abd0d094d90
2022-01-14 13:47:05 +00:00
Lais Andrade
8bd664ba28 Merge "Revert "Migrate contexts tests to Android.bp"" 2022-01-14 12:14:40 +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
9a9994de28 Merge "Migrate contexts tests to Android.bp" 2022-01-14 04:25:03 +00:00
Maciej Żenczykowski
334d21491d Merge "Add clatd to apex/com.android.tethering-file_contexts" 2022-01-14 03:22:34 +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
Nikita Ioffe
269e7cfc51 Move allow rules from public/app.te to private/app.te
Allow rules in public/*.te can only reference types defined in
public/*.te files. This can be quite cumbersome in cases a rule needs to
be updated to reference a type that is only defined in private/*.te.

This change moves all the allow rules from public/app.te to
private/app.te to make it possible to reference private types in the
allow rules.

Bug: 211761016
Test: m
Test: presubmit
Change-Id: I0c4a3f1ef568bbfdfb2176869fcd92ee648617fa
Merged-In: I0c4a3f1ef568bbfdfb2176869fcd92ee648617fa
2022-01-13 22:56:14 +00:00
Wenhao Wang
6a656c0b67 Add sepolicy for logd and logcat services
The logd binder service is on logd side.
The logcat binder service is on system_server side.
These two binder services facilitate the binder RPC
between logd and system_server.

Bug: 197901557
Test: manual
Change-Id: I5f08bbb44a88dc72302331ab11c7d54f94db16ac
2022-01-13 11:38:43 -08: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
Jiyong Park
8948c1ce4b Add policies for diced and hal_dice in microdroid
Bug: 214231981
Test: run microdroid and check diced is up and running
Change-Id: I605d7d6a790b8a14e575e67e1dcf02eaf7a5eafc
2022-01-13 01:37:00 +09: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
Hungming Chen
5934dd8c90 Add clatd to apex/com.android.tethering-file_contexts
clatd binary is starting to be shipped by apex since T+ release
and the shipped clatd is belong to u:object_r:clatd_exec:s0.

Test: manual test
1. Connect to ipv6-only wifi.
2. Make IPv4 traffic.
   $ ping 8.8.8.8

Change-Id: I4f6f0944e94e165983a19a5d3c3a117274f6bbac
2022-01-11 17:04:05 +08: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