Commit graph

38919 commits

Author SHA1 Message Date
Treehugger Robot
f974811fd7 Merge "Allow dumpstate to exec derive_sdk" 2022-09-28 23:03:35 +00:00
Andrew Scull
e325a7e554 Merge "Merge logic of DICE HAL and diced in to dice-service" 2022-09-28 18:52:26 +00:00
Mårten Kongstad
098e9094c3 Allow dumpstate to exec derive_sdk
derive_sdk is used to configure installed SDK extensions. It can also
print debug information about these.

Allow dumpstate to execute derive_sdk, to include the debug information
in bugreports.

Bug: 240656777
Test: adb bugreport /tmp/bugreport.zip && unzip -c /tmp/bugreport.zip bugreport*.txt | grep -i 'sdk extensions'
Change-Id: I0f502f9f94a376dff2e7eb821f7bf753de2d5482
2022-09-28 14:26:46 +02:00
Neil Fuller
81d2039656 Merge "Revert "Limit processes that can change settings sysprops"" 2022-09-28 09:01:58 +00:00
Neil Fuller
8fa264d60c Revert "Limit processes that can change settings sysprops"
This reverts commit c5980699a4.

Reason for revert: Vendor code is setting timezone_prop

Change-Id: Ib09e618745924bd95b4b9aa7106eb2e4cc7895eb
2022-09-28 08:52:46 +00:00
Sandro Montanari
7315a5af8c Merge "Rollback "Move allow rules of sdk_sandbox to apex policy"" 2022-09-28 08:47:37 +00:00
Neil Fuller
b9f8aad52c Merge changes I20b40cbe,Iac1bc330,I8d818342
* changes:
  Limit processes that can change settings sysprops
  Add new type for system settings metadata
  Reduce use of exported_system_prop
2022-09-27 23:01:26 +00:00
Andrew Scull
1c6cf7c74a Merge logic of DICE HAL and diced in to dice-service
The DICE HAL and diced are replaced with dice-service which implements
the diced services and also contains the HAL logic directly, without
exposing an implementation of the HAL service.

Bug: 243133253
Test: atest MicrodroidTests
Change-Id: Ia0edeadb04a3fdd37ee1a69a875a7b29586702c5
2022-09-27 22:18:46 +00:00
Treehugger Robot
490eb3cb75 Merge "[MTE] allow mtectrl to sync state to property." 2022-09-27 21:42:45 +00:00
Neil Fuller
c5980699a4 Limit processes that can change settings sysprops
Limit processes that can change global settings system properties.

Only system server and shell (for tests) should be able to set the
affected system properties.

Bug: 248307936
Test: treehugger only
Change-Id: I20b40cbedc9ad5277d08d033fc9d3ff6df7b7919
2022-09-27 16:08:59 +00:00
Neil Fuller
bbb00fa4cf Add new type for system settings metadata
Add a new selinux type for a system property used to hold metadata about
the time zone setting system property. Although system settings are
world readable, the associated metadata only needs to be readable by the
system server (currently).

Bug: 236612872
Test: treehugger
Change-Id: Iac1bc3301a049534ea5f69edf27cd85443e6a92e
2022-09-27 16:06:57 +00:00
Neil Fuller
0c4d8fff64 Reduce use of exported_system_prop
Reduce use of "exported_system_prop" by defining 2 new (currently
identical) "locale_prop" and "timezone_prop" types for the system
properties that are for "global system settings". See the comments in
private/property_contexts for details.

Initially the rights of the new types should be identical to
exported_system_prop but they will be reduced with a follow-up commit to
enable easier rollback / progress to be made on related work.

Bug: 236612872
Test: treehugger
Change-Id: I8d818342023bc462376c091b8a522532ccaf15d3
2022-09-27 16:05:54 +00:00
Florian Mayer
51382a3af0 [MTE] allow mtectrl to sync state to property.
Bug: 245624194
Change-Id: If580f3e64a839ee409b58e80300b927f6898c894
2022-09-27 15:56:33 +00:00
Amos Bianchi
8070ba00a7 Merge "Add sepolicy for new module." 2022-09-26 14:48:39 +00:00
Treehugger Robot
3e068f977f Merge changes I1cb8c3ac,Ib1a914b9
* changes:
  Grant artd read permissions on current profile directories.
  Grant artd write permissions on profile directories.
2022-09-26 12:27:56 +00: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
Jiakai Zhang
28e69a4156 Grant artd read permissions on current profile directories.
The permissions are needed for profile-guided compilation: when ART
Services compiles an app, it uses the information in current profiles as
one factor to determine which classes and methods to compile.

Since there can be multiple current profiles, in practice, it merges
the current profiles into a "reference profile" and passes that to the
compiler. After the compilation is done successfully, it keeps the
reference profile and deletes current profiles.

This is currently done by installd
(http://cs/android-internal/system/sepolicy/public/installd.te;l=125;rcl=0cbe233cdc361b0976874b2df04392d74245aade),
and we'd like artd to do it.

In addition, we want to make artd work in a more atomic way: If a
reference profile already exists, instead of mutating it in place,
artd creates a temp file next to it, works on the temp file, and
replaces the original file after it's done (or deletes the temp file
if it fails).

Therefore, artd needs the permissions to read current profile files.
It also needs to be mlstrustedsubject because current profile files
seem to have MLS restrictions.

Otherwise, it will get SELinux denials like:

```
09-23 20:22:13.931  8097  8097 I binder:8097_2: type=1400 audit(0.0:164): avc: denied { search } for name="cur" dev="dm-53" ino=81 scontext=u:r:artd:s0 tcontext=u:object_r:user_profile_root_file:s0 tclass=dir permissive=1
09-23 20:22:13.931  8097  8097 I binder:8097_2: type=1400 audit(0.0:164): avc: denied { search } for name="0" dev="dm-53" ino=207 scontext=u:r:artd:s0 tcontext=u:object_r:user_profile_root_file:s0:c512,c768 tclass=dir permissive=1
```

Note the MLS restrictions `c512,c768` in the message above.

Bug: 248318911
Test: manual -
  1. adb shell pm art optimize-package -m speed-profile \
       com.google.android.youtube
  2. See no SELinux denials like above.
Change-Id: I1cb8c3ac07d3790a4d74d747707327b1d5d8ecfb
2022-09-26 10:51:41 +00:00
Jiakai Zhang
ff67b849bf Grant artd write permissions on profile directories.
The permissions are needed for profile-guided compilation: when ART
Services compiles an app, it uses the information in current profiles as
one factor to determine which classes and methods to compile.

Since there can be multiple current profiles, in practice, it merges
the current profiles into a "reference profile" and passes that to the
compiler. After the compilation is done successfully, it keeps the
reference profile and deletes current profiles.

This is currently done by installd
(http://cs/android-internal/system/sepolicy/public/installd.te;l=125;rcl=0cbe233cdc361b0976874b2df04392d74245aade),
and we'd like artd to do it.

In addition, we want to make artd work in a more atomic way: If a
reference profile already exists, instead of mutating it in place,
artd creates a temp file next to it, works on the temp file, and
replaces the original file after it's done (or deletes the temp file
if it fails).

Therefore, artd needs the permissions to add/delete/replace profile
files. Otherwise, it will get SELinux denials like:

```
09-23 19:51:37.951  5050  5050 I binder:5050_1: type=1400 audit(0.0:134): avc: denied { write } for name="com.google.android.youtube" dev="dm-52" ino=922 scontext=u:r:artd:s0 tcontext=u:object_r:user_profile_data_file:s0 tclass=dir permissive=1
09-23 19:51:37.951  5050  5050 I binder:5050_1: type=1400 audit(0.0:134): avc: denied { add_name } for name="primary.prof.6mOsV9.tmp" scontext=u:r:artd:s0 tcontext=u:object_r:user_profile_data_file:s0 tclass=dir permissive=1
```

Bug: 248318911
Test: manual -
  1. adb shell pm art optimize-package -m speed-profile \
       com.google.android.youtube
  2. See no SELinux denials like above.
Change-Id: Ib1a914b9a9526a85b69d27970e4b23c4e101c68a
2022-09-26 10:47:34 +00:00
Amos Bianchi
3189fafa2a Add sepolicy for new module.
Bug: b/241442337
Test: TH
Change-Id: Ia58e2d4b205638509545a0a2c356cd68862beb1f
2022-09-23 10:40:47 -07:00
Alan Stokes
d014aa2ca1 Modify authfs related permissions
Allow microdroid_manager to start authfs when needed.

Migrate the authfs-related permissions from compos to
microdroid_payload, so it can be used by any payload.

Move a neverallow to the correct file.

Bug: 245262525
Test: atest MicrodroidTests MicrodroidHostTestCases
Test: atest ComposHostTestCases
Change-Id: I0f5eb9c11bdb427b1f78c9fc721c40de76add484
2022-09-23 15:55:47 +01:00
Vikram Gaur
f4382c5391 Merge "Add SELinux policy changes for rkpd" 2022-09-23 09:33:45 +00:00
Vikram Gaur
d25c80a951 Add SELinux policy changes for rkpd
This is a part of changes to bring up Remote Key Provisioning Daemon
module. See packages/modules/RemoteKeyProvisioning for more info.

Change-Id: Iae4e98176491637acb03e2e09b9d8dbc269be616
Test: atest rkpd_client_test
2022-09-23 05:09:00 +00:00
Pete Bentley
e6da3b80d1 Add SEPolicy for PRNG seeder daemon.
Manual testing protocol:
* Verify prng_seeder daemon is running and has the
  correct label (via ps -Z)
* Verify prng_seeder socket present and has correct
  label (via ls -Z)
* Verify no SELinux denials
* strace a libcrypto process and verify it reads seeding
  data from prng_seeder (e.g. strace bssl rand -hex 1024)
* strace seeder daemon to observe incoming connections
  (e.g. strace -f -p `pgrep prng_seeder`)
* Kill daemon, observe that init restarts it
* strace again and observe clients now seed from new instance

Bug: 243933553
Test: Manual - see above
Change-Id: I0a7e339115a2cf6b819730dcf5f8b189a339c57d
2022-09-22 15:13:20 +00:00
Qiao Li
397e5765e3 Merge "Add file contexts for FederatedCompute." 2022-09-22 02:36:39 +00:00
Yu Shan
e799e9284c Merge "Create selinux policy for remoteaccess HAL." 2022-09-22 01:17:00 +00:00
Weilin Xu
52546635b2 Applying new IBroadcastRadio AIDL
Update Sepolicy for AIDL broadcast radio HAL. Ignore
fuzzer default AIDL implementation for now.

Bug: 170336130
Test: m -j
Change-Id: Ie55c08c6a721de1f8dc40acc81de68565f99f7d7
2022-09-21 23:17:20 +00:00
Steven Moreland
5043c02262 Merge "hidl2aidl: conversion of gatekeeper hidl to aidl" 2022-09-21 21:26:01 +00:00
Reema Bajwa
396d34b7c8 Merge "Add SELinux changes for Credential Manager Service in system server Test: Built & Deployed on device locally." 2022-09-21 17:34:09 +00:00
qiaoli
9de81191c6 Add file contexts for FederatedCompute.
Test: TH
Change-Id: If302dc80a5be0b72e417698a60a92a05bedde8a1
2022-09-21 03:40:13 +00:00
Yu Shan
05a7389aa9 Create selinux policy for remoteaccess HAL.
Will add fuzzer once the service is implemented.

Test: Run remoteaccess HAL on gcar_emu. Verify the service is running.
Bug: 241483300
Change-Id: I01b31a88414536ddd90f9098f422ae43a48cf726
2022-09-20 18:09:49 -07:00
Anna Zhuravleva
2864a66331 Add sepolicy for Health Connect system service.
Add selinux policy so the healthconnect system service
can be accessed by other processes.

Bug: 246961138
Test: build
Change-Id: I37e0e7f1a2b4696b18f8876a107c509d2906e850
2022-09-20 17:14:35 +00:00
Pawan Wagh
f73797f50d Merge "sepolicy : Updating error message with doc link" 2022-09-20 02:06:40 +00:00
Reema Bajwa
5b57bfaf7e Add SELinux changes for Credential Manager Service in system server
Test: Built & Deployed on device locally.

Change-Id: I892107ed528e0ca7435aa29a0fa1e6dbf4f225c5
2022-09-19 17:51:06 +00:00
Subrahmanyaman
1d2a3fedcc hidl2aidl: conversion of gatekeeper hidl to aidl
Conversion of the gatekeeper hidl interface to stable aidl interface.

Bug: 205760843
Test: run vts -m VtsHalGatekeeperTarget
Change-Id: I44f554e711efadcd31de79b543f42c0afb27c23c
2022-09-19 17:43:26 +00:00
Jiyong Park
c4f84bcb37 Don't let ro.log.file_logger.path to be set
ro.log.file_logger.path is a system property that liblog uses to
determine if file_logger should be used (instead of logd) and what file
the logs should be emitted to. It is primarily meant for non-Android
environment like Microdroid, and doesn't need to be set in Android. In
fact, setting it to a wrong value can break the system logging
functionality. This change prevents such a problem by assigning a
dedicated property context (log_file_logger_prop) to the property and
making it non-writable. (Note that it still has to be readable because
liblog reads it and liblog can be loaded in any process)

Bug: 222592894
Test: try to set ro.log.file_logger.path

Change-Id: Ic6b527327f5bd4ca70a58b6e45f7be382e093318
2022-09-18 23:39:41 +09:00
Treehugger Robot
7c4f837e40 Merge "Microdroid: remove logd and logcat" 2022-09-17 13:03:08 +00:00
Sophie Zheng
baf2379288 Merge "Update prebuilts to fix sepolicy_freeze_test" into android12L-tests-dev am: a31ea3eb0c am: c7b828e56c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2208095

Change-Id: I1fd7f830a51d7dd504062dd9db82d8f58fd9dcfe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 23:09:30 +00:00
Florian Mayer
4eb6456501 Update prebuilts to fix sepolicy_freeze_test am: 5de1b2096d am: c84be7da03 am: 96b242efa2
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2199642

Change-Id: I8e2b7d566aaa440d563e0166542a3707d9f619ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 23:08:21 +00:00
Florian Mayer
7c3e25a3fb Update prebuilts to fix sepolicy_freeze_test am: f99eeb6bd9 am: 6f2280dba9
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2201137

Change-Id: I20238a581ac22098c8584bfc10e46e6c8bcbe65c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 23:06:53 +00:00
Sophie Zheng
c7b828e56c Merge "Update prebuilts to fix sepolicy_freeze_test" into android12L-tests-dev am: a31ea3eb0c
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2208095

Change-Id: I25e42e75635e6b5757ae0eba0068827b6e38fe40
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 22:36:57 +00:00
Florian Mayer
96b242efa2 Update prebuilts to fix sepolicy_freeze_test am: 5de1b2096d am: c84be7da03
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2199642

Change-Id: Ie0e54d81155920f8e5a8d98b777c69850066c242
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 22:36:06 +00:00
Florian Mayer
6f2280dba9 Update prebuilts to fix sepolicy_freeze_test am: f99eeb6bd9
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2201137

Change-Id: I2848699e579daefe2ef542c6f01b81c9471c6a88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-15 22:34:03 +00:00
Pawan
588ebd5e74 sepolicy : Updating error message with doc link
Updating error message with aidl fuzzing link.

Test: m
Bug: 242104782
Change-Id: I96ffc8f55319da6d3acb2deffd4717bfd9727346
2022-09-14 23:34:05 +00:00
Treehugger Robot
3ef5831b8d Merge "Add bluetooth LE inquiry scan parameters" 2022-09-14 22:29:10 +00:00
Jiyong Park
75e8c1f461 Microdroid: remove logd and logcat
Previously in Microdroid, processes send log messages to logd over
socket and then logcat ran to hand the message to the host side over the
serial console.

That has changed. Now, the liblog library which processes use to emit
logs directly sends the given message to the serial console. Liblog does
this by reading a new system property ro.log.file_logger.path. When this
is set, liblog doesn't use the logd logger, but opens the file that the
sysprop refers to and writes logs there.

This change implments sepolicy side of the story.

* logd and logcat types are removed since they no longer are needed.
* existing references to those types are removed as well.
* a new property type `log_prop` is introduced and the two system
  properties are labaled as log_prop
* all processes have read access to the system properties
* all processes have append access to /dev/hvc2

Bug: 222592894
Test: run microdroid, see log is still emitted.

Change-Id: I4c4f3f4fd0e7babeab28ddf39471e914445ef4da
2022-09-14 14:27:26 +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
Xin Li
6b09c56a6a Merge android12L-tests-dev@8941410 am: cba09e2963
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2189100

Change-Id: I8a6bb1872cd6e2d15fff0115d43afc9d5272a5a9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-12 18:28:36 +00:00
Katherine Lai
e3398210b8 Add bluetooth LE inquiry scan parameters
Bug: 233119457
Tag: #floss
Test: Manual
Change-Id: I4d0b505b761ad49832ef1d5e5097f6aad7a472e7
2022-09-09 20:48:36 +00:00
Suren Baghdasaryan
2d390e5094 Merge "Add policies for ro.kernel.watermark_scale_factor property" 2022-09-09 16:55:25 +00:00
Treehugger Robot
5384619c62 Merge "Allow reading process info from /proc." 2022-09-09 16:48:05 +00:00