Commit graph

28263 commits

Author SHA1 Message Date
Florian Mayer
a8a3d8b1bf Allow heapprofd central mode on user builds.
This simplifies operation by removing a special case for user builds.

Test: atest CtsPerfettoTestCases on user
Test: atest CtsPerfettoTestCases on userdebug
Test: atest perfetto_integrationtests on userdebug
Bug: 153139002
Change-Id: Ibbf3dd5e4f75c2a02d931f73b96fabb8157e0ebf
2021-01-11 17:19:02 +00:00
Chiachang Wang
bd15e9ac63 Merge "Add new selinux type for radio process" 2020-12-29 00:24:12 +00:00
Chiachang Wang
813c25fc91 Add new selinux type for radio process
ConnectivityService is going to become mainline and can not
access hidden APIs. Telephony and Settings were both accessing
the hidden API ConnectivityManager#getMobileProvisioningUrl.
Moving #getMobileProvisioningUrl method into telephony means
that there is one less access to a hidden API within the overall
framework since the Connectivity stack never needed this value.
Thus, move getMobileProvisioningUrl parsing to telephony surface
and provide the corresponding sepolicy permission for its access.

The exsting radio_data_file is an app data type and may allow
more permission than necessary. Thus create a new type and give
the necessary read access only.

Bug: 175177794
Test: verify that the radio process could read
      /data/misc/radio/provisioning_urls.xml successfully
Change-Id: I191261a57667dc7936c22786d75da971f94710ef
2020-12-24 15:11:15 +08:00
Steven Moreland
7042d472a7 Merge "hal_power_stats: use hal_attribute_service" 2020-12-23 20:18:03 +00:00
Treehugger Robot
9afb3747fe Merge "sepolicy: set expandattribute false for dmabuf_heap_device_type" 2020-12-23 09:16:42 +00:00
Hridya Valsaraju
eab2858649 sepolicy: set expandattribute false for dmabuf_heap_device_type
This is needed to avoid build failure in target bertha_arm64.

Test: make
Bug: 176124106
Change-Id: Id24eaa00dc5d601deb7533ac1d484a76535c8df0
2020-12-23 05:14:31 +00:00
Steven Moreland
bc2624a041 hal_power_stats: use hal_attribute_service
This macro creates the necessary neverallow to assert the
hal_power_stats_{client,server} attribute has exclusive ownership of
the service.

Bug: 176180039
Test: build/TH
Change-Id: I710eadc4c4f4642937aa16a25fe559e1cd3c9224
2020-12-23 01:38:03 +00:00
Kalesh Singh
24ada7dbee Reland: Memtrack HAL stable aidl sepolicy
Bug: 175021432
Test: Check logcat for denials
Change-Id: Id92fc543791072d8682e3a89cbf08370007108bf
2020-12-22 16:08:53 -05:00
Treehugger Robot
831fddd794 Merge "Allow coredomain access to only approved categories of vendor heaps" 2020-12-21 20:34:06 +00:00
Treehugger Robot
0afbe0eb98 Merge "Clean up keymint service policy." 2020-12-17 20:40:08 +00:00
Alan Stokes
c18e79e90c Add shared_relro dontaudit.
Use of StrictMode in framework code running in the app process can
generate a denial:

avc:  denied  { find } for pid=4050 uid=1037 name=network_management
 scontext=u:r:shared_relro:s0:c13,c260,c512,c768
 tcontext=u:object_r:network_management_service:s0
 tclass=service_manager permissive=0

But the code handles the failure properly so we suppress this.

Bug: 174750397
Test: Manual
Change-Id: I7b334db0dde4365ff19a7cf42a5139f35b5e6512
2020-12-17 14:10:07 +00:00
Hridya Valsaraju
8c9cf62edb Allow coredomain access to only approved categories of vendor heaps
One of the advantages of the DMA-BUF heaps framework over
ION is that each heap is a separate char device and hence
it is possible to create separate sepolicy permissions to restrict
access to each heap.
In the case of ION, allocation in every heap had to be done through
/dev/ion which meant that there was no away to restrict allocations in
a specific heap.

This patch intends to restrict coredomain access to only approved
categories of vendor heaps. Currently, the only identified category
as per partner feedback is the system-secure heap which is defined
as a heap that allocates from protected memory.

Test: Build, video playback works on CF with ION disabled and
without sepolicy denials
Bug: 175697666

Change-Id: I923d2931c631d05d569e97f6e49145ef71324f3b
2020-12-16 10:08:54 -08:00
Joel Galenson
1c7eb3c3bd Clean up keymint service policy.
Test: VtsAidlKeyMintTargetTest
Change-Id: Id6e83d63ffb1de7c48dbdf435fd9988e9174cfe2
2020-12-16 08:59:09 -08:00
Florian Mayer
ed3ad1d253 Allow heapprofd to read packages.list.
This is so it can check profileability.

Bug: 153139002
Change-Id: I3d3c23f8f8bc564bc1c2b3f7cdeab2d32f084917
2020-12-16 14:35:32 +00:00
Janis Danisevskis
de98dd9726 Merge changes Icb1f60b3,I935f2383
* changes:
  Allow keystore to talk to keymint
  Add policy for the security compatibility hal service.
2020-12-16 01:24:33 +00:00
Kalesh Singh
3619437561 Merge "Revert "Memtrack HAL stable aidl sepolicy"" 2020-12-16 00:48:06 +00:00
Kalesh Singh
5db6857fe1 Revert "Memtrack HAL stable aidl sepolicy"
Revert "Add android.hardware.memtrack-unstable-ndk_platform"

Revert submission 1518702-memtrack-aidl

Reason for revert: Broken tests and boot time regressions
Reverted Changes:
Ic4dd70e2c:Add android.hardware.memtrack-unstable-ndk_platfor...
Iaf99d0ca4:Add stable aidl memtrack HAL to product packages
Iac54ae2ba:Add stable aidl memtrack hal to vndk list
If310210a3:libmemtrack: Add support for AIDL memtrack HAL
Ib6c634def:Memtrack HAL: Add stable AIDL implementation
I5e1d0e006:Memtrack HAL stable aidl sepolicy

Change-Id: I0c55ee100c7fd8d09a5b188a39b17c95c8a43c39
2020-12-16 00:19:38 +00:00
Janis Danisevskis
bd464a9543 Allow keystore to talk to keymint
Test: None
Change-Id: Icb1f60b3c2971488a6a890c063d4e4babab2b2f2
2020-12-15 08:25:42 -08:00
Janis Danisevskis
191940036b Add policy for the security compatibility hal service.
This service manager is registered by Keystore 2.0 to lookup legacy
wrapper services.

Keystore 2.0 is now written in rust. We have AIDL binding for rust but
no HIDL binding. Keystore 2.0 has to support legacy HIDL based
interfaces. So we implement the AIDL KeyMint interface in terms of the
legacy HIDL Keymaster <=  V4.1 devices in C++. This wrapper is linked
into the Keystore 2.0 process but it cannot be called directly but must
be treated like a remote binder instead. However, we cannot register
these wrappers directly, because a) we are not a vendor component, and
b) it would conflict with genuine KeyMint devices on newer devices. So
Instead we register Keystore 2.0 itself as a legacy service provider.
Which it can query itself for the legacy wrappers if it does not find
a genuine KeyMint implementation to connect to.

Bug: 171351607
Test: Keystore 2.0 can register this Service and lookup legacy wrapper
      services.
Change-Id: I935f23837721ce126531236f4920dba469a47be4
2020-12-15 08:23:52 -08:00
Alan Stokes
63d875612f Merge "Split user_profile_data_file label." 2020-12-15 14:25:51 +00:00
Treehugger Robot
14a15d900b Merge "sepolicy: Add the dmabuf system-uncached heap" 2020-12-15 06:16:50 +00:00
Treehugger Robot
772d6b425a Merge "Add policy for the android protected confirmation service." 2020-12-15 05:26:17 +00:00
Treehugger Robot
8b20383b12 Merge "Fix malformed property_contexts entry" 2020-12-15 01:28:33 +00:00
Treehugger Robot
6d560dee90 Merge "Memtrack HAL stable aidl sepolicy" 2020-12-14 18:36:10 +00:00
Hyunyoung Song
9f198f1c68 Merge "New system service: search_ui_service" 2020-12-14 16:36:02 +00:00
Inseob Kim
d3dbcc1b82 Fix malformed property_contexts entry
Prefix entries should not have the suffix '*'.

Test: set property and invoke getprop -Z
Change-Id: I33dc7c6ac1bc05ecc1e3a7b331bc827717afa252
2020-12-14 13:24:14 +00:00
Treehugger Robot
ba862cdeb6 Merge "Add com.android.virt" 2020-12-13 23:42:59 +00:00
Shawn Willden
b41f4985a9 Revert^2 "Move keymint to android.hardware.security."
16d61d0383


Bug: 175345910
Bug: 171429297
Exempt-From-Owner-Approval: re-landing topic with no changes in this CL.
Change-Id: I1352c6b46b007dba3448b3c9cbdf454d7862a176
2020-12-11 20:36:53 +00:00
Mohammad Islam
7a3be4d80e Merge "Allow priv_app read access to /data/app-staging directory" 2020-12-11 20:01:02 +00:00
Treehugger Robot
b4e7838a0b Merge "Untrusted_app: audit NETLINK_ROUTE bind and RTM_GETLINK" 2020-12-11 19:20:09 +00:00
Alan Stokes
7aa40413ae Split user_profile_data_file label.
user_profile_data_file is mlstrustedobject. And it needs to be,
because we want untrusted apps to be able to write to their profile
files, but they do not have levels.

But now we want to apply levels in the parent directories that have
the same label, and we want them to work so they need to not be
MLS-exempt. To resolve that we introduce a new label,
user_profile_root_file, which is applied to those directories (but no
files). We grant mostly the same access to the new label as
directories with the existing label.

Apart from appdomain, almost every domain which accesses
user_profile_data_file, and now user_profile_root_file, is already
mlstrustedsubject and so can't be affected by this change. The
exception is postinstall_dexopt which we now make mlstrustedobject.

Bug: 141677108
Bug: 175311045
Test: Manual: flash with wipe
Test: Manual: flash on top of older version
Test: Manual: install & uninstall apps
Test: Manual: create & remove user
Test: Presubmits.
Change-Id: I4e0def3d513b129d6c292f7edb076db341b4a2b3
2020-12-11 17:35:06 +00:00
Jeff Vander Stoep
2eaa33d95e Untrusted_app: audit NETLINK_ROUTE bind and RTM_GETLINK
Test: build
Bug: 170188668
Bug: 170214442
Change-Id: I79384318ad4031b4bf14ae243e41f01469288e55
2020-12-11 14:10:19 +01:00
Orion Hodson
c06806771d Merge "Revert "Move keymint to android.hardware.security."" 2020-12-11 12:29:46 +00:00
Gavin Corkery
700b58be6c Merge "Add file contexts for com.android.scheduling" 2020-12-11 11:04:18 +00:00
Orion Hodson
16d61d0383 Revert "Move keymint to android.hardware.security."
Revert submission 1522123-move_keymint

Reason for revert: Build breakage
Bug: 175345910
Bug: 171429297
Reverted Changes:
Ief0e9884a:Keystore 2.0: Move keymint spec to security namesp...
Idb54e8846:Keystore 2.0: Move keymint spec to security namesp...
I9f70db0e4:Remove references to keymint1
I2b4ce3349:Keystore 2.0 SPI: Move keymint spec to security na...
I2498073aa:Move keymint to android.hardware.security.
I098711e7d:Move keymint to android.hardware.security.
I3ec8d70fe:Configure CF to start KeyMint service by default.
Icbb373c50:Move keymint to android.hardware.security.
I86bccf40e:Move keymint to android.hardware.security.

Change-Id: Ib5591c2379bbd2fd6dde0558ba0e68f39d27fbaf
2020-12-11 10:45:43 +00:00
Jiyong Park
c99eb585c9 Add com.android.virt
com.android.virt is an APEX for virtual machine monitors like crosvm.
The APEX currently empty and isn't updatable.

Bug: 174633082
Test: m com.android.virt

Change-Id: I8acc8e147aadb1701dc65f6950b61701131f89d2
2020-12-11 16:22:25 +09:00
John Stultz
f30cc10961 sepolicy: Add the dmabuf system-uncached heap
This should match policy for the system heap as they both map to
the ION system heap with the ION_FLAG_CACHED flag on or off.

Change-Id: Ib2929b84a2f8092adcf2f874ad6ccdfe068fe6dc
Signed-off-by: John Stultz <john.stultz@linaro.org>
2020-12-11 07:07:51 +00:00
Mohammad Samiul Islam
a45cddae5e Allow priv_app read access to /data/app-staging directory
During staged installation, we no longer create duplicate sessions for
verification purpose. Instead, we send the original files in
/data/app-staging folder to package verifiers for verification. That
means, Phonesky needs access to /data/app-staging folder to be able to
verify the apks inside it.

Bug: 175163376
Test: atest StagedInstallTest#testPlayStoreCanReadAppStagingDir
Test: atest StagedInstallTest#testAppStagingFolderCannotBeReadByNonPrivApps
Change-Id: I5cbb4c8b7dceb63954c747180b39b4a21d2463af
2020-12-10 23:46:15 +00:00
Shawn Willden
feaa06f90e Merge "Move keymint to android.hardware.security." 2020-12-10 22:49:14 +00:00
Selene Huang
2c3bdb28de Move keymint to android.hardware.security.
Test: VtsAidlKeyMintTargetTest
Change-Id: I098711e7ddbcac0fc761801a1bf582a71a8f9baa
2020-12-10 19:12:29 +00:00
Songchun Fan
a3c0b3f447 system_app: remove unnecessary changes to neverallow
Follow-up for aosp/1520729. These are no longer needed.

Test: build
BUG: 175121264
Change-Id: I7f01d4d4cee18751f4321ef8efa68f9faae06d4f
2020-12-10 19:03:25 +00:00
Janis Danisevskis
d5ad76b0c4 Add policy for the android protected confirmation service.
This is the service offered by Keystore 2.0 to provide APC service to
application. It was formerly part of the IKeystoreService interface.
Not it is an interface in ints own right.

Test: Keystore 2.0 can register the apc service interface.
      Apps can lookup and call this interface.
Bug: 159341464
Change-Id: I058adf0021d9b89f4eac7534e366c29071f0f98b
2020-12-10 10:58:11 -08:00
Gavin Corkery
a1bd4fc620 Add file contexts for com.android.scheduling
Test: Build and flash
Bug: 161353402
Change-Id: I0e897dae34650022dc36cd95bc8519339d615bf8
2020-12-10 14:55:22 +00:00
Treehugger Robot
c0d1040d58 Merge "Export ro.vendor.product.cpu.abilist*" 2020-12-10 09:01:40 +00:00
Xin Li
0777adef5e DO NOT MERGE - Merge Android R QPR1
Bug: 172690556
Merged-In: Ibc15a90266d1f30174d6590a157571507e8ee31a
Change-Id: I279c3cc3cfcf8e6c28b3cddf98fee6e47f4b46a5
2020-12-09 17:44:05 -08:00
Chong Zhang
2cbfd01949 add mediatranscoding to apex file context am: 9aed64920f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1522099

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibc15a90266d1f30174d6590a157571507e8ee31a
2020-12-10 01:01:17 +00:00
Chong Zhang
9aed64920f add mediatranscoding to apex file context
bug: 159172726
Change-Id: I8fbedab2605167af637108d5f564abf6c78c32bd
2020-12-09 14:26:14 -08:00
Treehugger Robot
66ed360b5e Merge "Update 30.0 prebuilts to latest rvc-dev policy" am: 34d974838e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1521437

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I49504f4d757ff4449cf7940f743687d2b2a86e84
2020-12-09 16:45:03 +00:00
Treehugger Robot
34d974838e Merge "Update 30.0 prebuilts to latest rvc-dev policy" 2020-12-09 16:09:12 +00:00
Treehugger Robot
60e32df155 Merge "Allow PermissonController to find app_api_service and system_api_service." am: a56c9eb016
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1519814

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I45dad0c44cdcf3d0cdd7e41bf5414d98db651610
2020-12-09 15:55:28 +00:00