Commit graph

129 commits

Author SHA1 Message Date
Treehugger Robot
de453119e2 Merge "Update SELinux policy for app compilation CUJ." am: 9e2f8aa7a1
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/2160660

Change-Id: I76e3fa493a483a85fec07fd77f8aba15e4136b49
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-29 17:48:30 +00:00
Jiakai Zhang
c871c1cc75 Update SELinux policy for app compilation CUJ.
- Adapt installd rules for app compilation.

- Add profman rules for checking the profile before compilation. This is new behavior compared to installd.

Bug: 229268202
Test: -
  1. adb shell pm art optimize-package -m speed-profile -f \
       com.google.android.youtube
  2. See no SELinux denial.
Change-Id: Idfe1ccdb1b27fd275fdf912bc8d005551f89d4fc
2022-07-29 14:07:52 +00:00
Oriol Prieto Gasco
57f48ae1d2 Include bluetooth cert in mac_permissions.xml
Also, rename the file_contexts file to match the new BT stack apex name
(com.android.bluetooth)

Test: TH
Bug: 236187653
Bug: 236192423
Ignore-AOSP-First: LSC

Change-Id: Ie610775d397d0a81f83e251ed3b5f73006bfd272
2022-06-21 22:00:01 +00:00
Ling Ma
444d77f603 Removed telephony apex
Will not need this in near future.

Fix: 230729916
Test: Build
Change-Id: Iec5049bb2cc16de1d947e07eec0f151182f5a22a
Merged-In: Iec5049bb2cc16de1d947e07eec0f151182f5a22a
Ignore-AOSP-First: cherry-picked from AOSP
2022-05-17 17:50:57 +00:00
Ling Ma
f2a540615b Removed telephony apex
Will not need this in near future.

Fix: 230729916
Test: Build
Change-Id: Iec5049bb2cc16de1d947e07eec0f151182f5a22a
2022-05-05 14:18:14 -07:00
Frank
711fee7dd0 Add file contexts for OnDevicePersonalization.
Test: build
Change-Id: I7fc206f06ca1dad52772211abef50407437a79dc
2022-03-11 08:31:41 +00:00
Frank Wang
62115b2d0a Remove Auxiliary file_contexts file.
Ignore-AOSP-First: Not released yet
Test: TH
Bug: 210728915
Change-Id: Id49b6232b32952846d09d64f47611c16b385f55a
2022-03-08 04:37:14 +00:00
Frank Wang
a5eb97af4b Remove Auxiliary module file context config.
Ignore-AOSP-First: this feature is developed in an internal branch
Test: TH
Bug: 210728915
Change-Id: I92db5c20db20a39af554cbeb8347e7bfb0c823ca
2022-03-05 07:20:59 +00:00
Nikita Ioffe
db8478cc37 Remove supplementalprocess APEX
Ignore-AOSP-First: this code is not available in AOSP
Bug: 220320098
Test: m
Change-Id: I131bb9ed3ea7014a6010977117e6c4e9a83ec277
2022-03-02 18:33:18 +00:00
Anton Kulakov
27e5834677 Add file contexts for AdServices APEX am: dc4332b32b am: 995d44896b am: d4d005f6fd
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1992910

Change-Id: I2b3e9c366ea16d7f7b2f2bdc5b1a6fe0a523b849
2022-02-21 14:33:38 +00:00
Anton Kulakov
dc4332b32b Add file contexts for AdServices APEX
Test: Build
Bug: 220336612
Change-Id: Iab64d228a5edcd3a9f71b59c5adf3a9460cd1947
2022-02-21 09:55:07 +00:00
Treehugger Robot
7128d68656 Merge "Modify sepolicy for compos key changes" am: 5273f3a486 am: 46aba72e48 am: 96bc5e6133
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1988307

Change-Id: Iaba5542e5f84282793985d6e3702e0898559c97b
2022-02-18 10:08:18 +00:00
Alan Stokes
766caba5de Modify sepolicy for compos key changes
Add the compos_key_helper domain for the process which has access to
the signing key, make sure it can't be crashdumped. Also extend that
protection to diced & its HAL.

Rename compos_verify_key to compos_verify, because it doesn't verify
keys any more.

Move exec types used by Microdroid to file.te in the host rather than
their own dedicated files.

Bug: 218494522
Test: atest CompOsSigningHostTest CompOsDenialHostTest
Change-Id: I942667355d8ce29b3a9eb093e0b9c4f6ee0df6c1
2022-02-17 12:14:40 +00:00
Frank Wang
41d3e030ed Add file contexts for OnDevicePersonalization module.
Test: Build
Bug: b/218749359
Ignore-AOSP-First: this feature is still under development.
Change-Id: Ib69e8e7098913e14b9973c65b37c88daa98b4e06
2022-02-10 17:02:21 +00:00
Roopa Sattiraju
d05629be96 Changing sepolicy file to the right apex name am: 89556c69df am: dd862e57ee am: cfe332e6ef am: 794914f434
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1967166

Change-Id: Id256bbb62678e16e3225e18c0df3be780df7875d
2022-02-02 06:14:59 +00:00
Roopa Sattiraju
89556c69df Changing sepolicy file to the right apex name
Bug: 216476895
Test: Compile
Change-Id: I31a5534bad0f5c01ee163f109fa5dd0b54835ea8
2022-02-01 15:59:30 -08:00
Maciej Żenczykowski
4f5a1ea0fb Merge "Add clatd to apex/com.android.tethering-file_contexts" am: 334d21491d am: 36c4a97895 am: 39672aac5c am: cd74c9117e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1926907

Change-Id: I8a67e1117a9b0483ced498cb6ce7101134a164b1
2022-01-14 04:01:49 +00: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
Inseob Kim
696d2d250c Merge "Fix contexts modules to use android:"path"" am: 514d49a3b7 am: 3b059bf014 am: d4e088aefc am: 8824d87d77
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1925691

Change-Id: I487a2848221409e9651b3284c2ad657a8f988818
2021-12-24 08:29:35 +00:00
Inseob Kim
6d3d5a6daf Fix contexts modules to use android:"path"
For now, contexts modules have been using se_filegroup modules, which
makes the build system logic unnecessarily complex. This change
refactors it to se_build_files modules and normal `android:"path"`
logic.

Test: build and boot
Change-Id: I52e557e2dc8300186869a97fddfd3a74183473f7
2021-12-23 21:36:27 +09:00
Frank Wang
e46363f4e2 Add Auxiliary module file context config in sepolicy.
Test: loaded to an AVD
Bug: b/210728915
Ignore-AOSP-First: this feature is developed in an internal branch
Change-Id: I8a3d1ec25938c84cfe35a36e706e891ce2b9659e
2021-12-17 06:43:41 +00:00
Frank Wang
07394c9dc4 Add file contexts for Auxiliary module.
Test: loaded to an AVD
Bug: b/210728915
Ignore-AOSP-First: this feature is developed in an internal branch
Change-Id: I000ec62b5aa8fba1fbf2ac5f65ae5deb3ebe9ff7
2021-12-17 03:36:18 +00:00
Treehugger Robot
1b8168a7dc Merge "Add file_contexts for sepolicy mainline module" am: 8797f5841c am: 2b9f0a62cb am: 6ea8b3b3b3 am: 8fc3c1734f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1890636

Change-Id: Iaffdba595460e0a1d61d49a102bce913c66c227d
2021-11-12 16:31:43 +00:00
Jeff Vander Stoep
07246483ad Add file_contexts for sepolicy mainline module
Test: m com.android.sepolicy
Bug: 202394777
Change-Id: I6d11c693463206632237de1c4042845153fd6415
2021-11-12 14:55:54 +01:00
Nikita Ioffe
3efbc25e2c Add file contexts for SumplementalProcess APEX
Test: flash
Ignore-AOSP-First: feature is developed in internal branch
Change-Id: I586e668a6a77be498965c22af41af63558463a7e
2021-10-16 00:28:34 +01:00
Keun young Park
44025b07eb Add sepolicy for com.android.car.framework module
Bug: 192665266
Test: build
Change-Id: I69036c20a3bae10e34a3c076eb8e1c7c2f1d2517
2021-10-07 00:45:19 +00:00
Nikita Ioffe
8d003bc3c0 Merge "Cleanup sepolicy related to APEX pre/post-install hooks" 2021-09-27 20:16:54 +00:00
Alan Stokes
ec4a90f59c Enable odrefresh to work with composd.
composd spawns odrefresh in its usual domain. odrefresh then spawns
fd_server in a different domain, and makes binder calls back to
composd to perform individual compilation steps.

fd_server is fairly generic, and part of the virt APEX, but this
instance is specific to composd (e.g. it has access to ART files), so
I named the domain composd_fd_server.

Bug: 186126194
Test: Run composd_cmd, artifacts generated
Change-Id: I5a431dd00b5b396a67021c618fc6edcfb25aa21b
2021-09-23 12:03:30 +01:00
Nikita Ioffe
c0cac4114c Cleanup sepolicy related to APEX pre/post-install hooks
The pre/post-install hook functionality has been deprecated and removed.

Bug: 172606645
Test: atest ApexTestCases
Test: atest CtsStagedInstallHostTestCases
Change-Id: I8a5f726a0c8f005654d0430b5a4598e416ff9c28
2021-09-17 17:55:12 +01:00
Alan Stokes
d376e2041f Initial sepolicy for composd
Add what we need to allow composd to run and expose an AIDL service.

Also delete the policy for compsvc; we never access it in the host
now, and the real policy is in microdroid. Retain the compos_exec
type, since it is referenced in the APEX sepolicy.

Bug: 186126194
Test: adb shell cmd -w android.system.composd; no denials.
Change-Id: I5f06b2b01852cdebd2d67009b363ec08b17ce33a
2021-09-13 10:33:53 +01:00
Alan Stokes
39f497013c SEPolicy for compos_verify_key.
Remove some allow rules for odsign, since it no longer directly
modifies CompOs files. Instead allow it to run compos_verify_key in
its own domain.

Grant compos_verify_key what it needs to access the CompOs files and
start up the VM.

Currently we directly connect to the CompOs VM; that will change once
some in-flight CLs have landed.

As part of this I moved the virtualizationservice_use macro to
te_macros so I can use it here. I also expanded it to include
additional grants needed by any VM client that were previously done
for individual domains (and then deleted those rules as now
redundant).

I also removed the grant of VM access to all apps; instead we allow it
for untrusted apps, on userdebug or eng builds only. (Temporarily at
least.)

Bug: 193603140
Test: Manual - odsign successfully runs the VM at boot when needed.
Change-Id: I62f9ad8c7ea2fb9ef2d468331e26822d08e3c828
2021-09-03 16:31:02 +01:00
Victor Hsieh
9ef8696796 Remove obsolete file contexts
Bug: 194474784
Test: can't find "compos_key_main" and "compsvc_worker" in code search
Change-Id: If0959f180f54f798ecd90a12ce71f0570cf14484
2021-08-13 15:03:23 +00:00
Roshan Pius
3b7716c98c sepolicy: Add entry for uwb apex
Bug: 188911079
Test: Compiles
Change-Id: Icc4886d608e75e348ad9de0f249b23602d84694a
2021-07-29 18:44:50 -07:00
Alan Stokes
80bb558584 Remove compos_key_cmd from policy
It's a test tool which is generally run as root, and will be deleted
eventually. It doesn't need its own label; system_file works fine.

We never actually allowed it anything, nor defined a transition into
the domain.

Bug: 194474784
Test: Device boots, no denials
Test: compos_key_cmd run from root works
Change-Id: If118798086dae2faadeda658bc02b6eb6e6bf606
2021-07-28 14:36:50 +01:00
Inseob Kim
7560aed40a Add domain for compos binaries
Bug: 191263171
Test: atest MicrodroidHostTestCases
Test: atest ComposHostTestCases
Change-Id: I1fd35d0efe83d2cecaa41580e6d1d0b8f6242b3f
2021-07-23 06:01:39 +00:00
Andrew Walbran
4b80a3fc3d Rename VirtManager to VirtualizationService.
Bug: 188042280
Test: atest VirtualizationTestCases
Change-Id: Ia46a0dda923cb30382cbcba64aeb569685041d2b
2021-05-21 14:47:30 +00:00
Victor Hsieh
7b68126421 Add sepolicy for com.android.compos
This is to unblock the apex setup.

There is only a system_file in the context, but we might need more
specific ones later.

Bug: 186126404
Test: m

Change-Id: Icf713c9bb92e7f7402c0b45bd0f1b06e9cb35d2b
2021-05-11 14:07:57 -07:00
Chris Wailes
467d8a80ea Add SELinux properties for artd
Test: boot device and check for artd process
Change-Id: I2a161701102ecbde3e293af0346d1db0b11d4aab
2021-04-27 14:49:13 -07:00
Andrew Walbran
a995e84c18 Add crosvm domain and give virtmanager and crosvm necessary permissions.
Bug: 183583115
Test: make TARGET_KERNEL_USE=5.4 TARGET_VIM3L=true
Change-Id: I566436fa2d27597566014f2a63198a88d6d2dbd6
2021-04-13 09:30:20 +00:00
Jeff Vander Stoep
f16527f6cf virtmanager: add selinux domain
Address any denials in the log - currently just adding
the virtualization service.

Bug: 183583115
Test: ps -AZ | grep virtmanager
u: r:virtmanager:s0             virtmanager   2453     1 10930880  4544 0                   0 S virtmanager
Change-Id: Ie034dcc3b1dbee610c591220358065b8508d81cf
2021-03-25 22:22:05 +01:00
satayev
afc9791f21 Revert^2 "Introduce derive_classpath."
5fd85de907

Bug: 180105615
Test: manual boot of cuttlefish and gphone emulator
Change-Id: I9e43268d3b745e65b5ccc0a4896a7e55a253659d
2021-03-19 11:23:00 +00:00
Orion Hodson
5fd85de907 Revert "Introduce derive_classpath."
Revert submission 1602413-derive_classpath

Bug: 180105615
Fix: 183079517
Reason for revert: SELinux failure leading to *CLASSPATH variables not being set in all builds

Reverted Changes:
I6e3c64e7a:Introduce derive_classpath service.
I60c539a8f:Exec_start derive_classpath on post-fs-data.
I4150de69f:Introduce derive_classpath.

Change-Id: I17e2cd062d8fddc40250d00f02e40237ad62bd6a
2021-03-18 17:00:43 +00:00
Artur Satayev
d62193e9df Introduce derive_classpath.
The service generates /data/system/environ/classpath with values for
BOOTCLASSPATH, SYSTEMSERVERCLASSPATH, and DEX2OATCLASSPATH to be
exported by init.

See go/updatable-classpath for more details.

Bug: 180105615
Test: manual
Change-Id: I4150de69f7d39f685a202eb4f86c27b661f808dc
2021-03-11 07:20:25 +00:00
Bob Badour
601ebb43a3 [LSC] Add LOCAL_LICENSE_KINDS to system/sepolicy
Added SPDX-license-identifier-Apache-2.0 to:
  build/Android.bp
  build/soong/Android.bp
  tests/Android.bp
  tools/Android.bp

Added SPDX-license-identifier-Apache-2.0 legacy_unencumbered to:
  Android.bp
  Android.mk
  compat.mk
  contexts_tests.mk
  mac_permissions.mk
  seapp_contexts.mk
  treble_sepolicy_tests_for_release.mk

Added legacy_unencumbered to:
  apex/Android.bp
  tools/sepolicy-analyze/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I1ab286543ef1bdcb494cf74f2b35e35a08225d28
2021-02-05 01:28:24 -08:00
Orion Hodson
8f75f76fbd Permissions for odrefresh and /data/misc/apexdata/com.android.art
odrefresh is the process responsible for checking and creating ART
compilation artifacts that live in the ART APEX data
directory (/data/misc/apexdata/com.android.art).

There are two types of change here:

1) enabling odrefresh to run dex2oat and write updated boot class path
   and system server AOT artifacts into the ART APEX data directory.

2) enabling the zygote and assorted diagnostic tools to use the
   updated AOT artifacts.

odrefresh uses two file contexts: apex_art_data_file and
apex_art_staging_data_file. When odrefresh invokes dex2oat, the
generated files have the apex_art_staging_data_file label (which allows
writing). odrefresh then moves these files from the staging area to
their installation area and gives them the apex_art_data_file label.

Bug: 160683548
Test: adb root && adb shell /apex/com.android.art/bin/odrefresh
Change-Id: I9fa290e0c9c1b7b82be4dacb9f2f8cb8c11e4895
2021-01-13 10:38:22 +00:00
Treehugger Robot
ba862cdeb6 Merge "Add com.android.virt" 2020-12-13 23:42:59 +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
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
Chong Zhang
9aed64920f add mediatranscoding to apex file context
bug: 159172726
Change-Id: I8fbedab2605167af637108d5f564abf6c78c32bd
2020-12-09 14:26:14 -08:00
Kiyoung Kim
357f5c4b1b Support linkerconfig in Runtime APEX
Add additional sepolicy so linkerconfig in Runtime APEX can be executed
from init.

Bug: 165769179
Test: Cuttlefish boot succeeded
Change-Id: Ic08157ce4c6a084db29f427cf9f5ad2cb12e50dd
2020-12-02 11:41:38 +09:00