Commit graph

30037 commits

Author SHA1 Message Date
Thiébaud Weksteen
9ec532752d Add fusefs_type for FUSE filesystems
Any FUSE filesystem will receive the 'fuse' type when mounted. It is
possible to change this behaviour by specifying the "context=" or
"fscontext=" option in mount().

Because 'fuse' has historically been used only for the emulated storage,
it also received the 'sdcard_type' attribute. Replace the 'sdcard_type'
attribute from 'fuse' with the new 'fusefs_type'. This attribute can be
attached on derived types (such as app_fusefs).

This change:
- Remove the neverallow restriction on this new type. This means any
  custom FUSE implementation can be mounted/unmounted (if the correct
  allow rule is added). See domain.te.
- Change the attribute of 'fuse' from 'sdcard_type' to 'fusefs_type'.
  See file.te.
- Modify all references to 'sdcard_type' to explicitly include 'fuse'
  for compatibility reason.

Bug: 177481425
Bug: 190804537
Test: Build and boot aosp_cf_x86_64_phone-userdebug
Change-Id: Id4e410a049f72647accd4c3cf43eaa55e94c318f
2021-06-28 13:18:46 +02:00
Treehugger Robot
2dd76a76f3 Merge "Update automotive_display_service selinux policy" 2021-06-22 11:20:06 +00:00
Nicolas Geoffray
635853a710 Merge "Allow dexoptanalyzer to read /apex/apex-info-list.xml" 2021-06-21 14:59:56 +00:00
Treehugger Robot
79f1fc195c Merge "sepolicy: Allow to receive FDs from app_zygote" 2021-06-21 10:58:13 +00:00
Nicolas Geoffray
5441f77848 Allow dexoptanalyzer to read /apex/apex-info-list.xml
This is needed to know the state of a .oat file.

Test: m
Bug: 190817237
Change-Id: I76f4212bf4d4273d72bdd0485c2203499ae3c6bb
2021-06-21 10:24:38 +01:00
Xin Li
003ffe2340 Merge "DO NOT MERGE - Merge RQ3A.210605.005" 2021-06-21 05:49:07 +00:00
Changyeon Jo
c951045f2e Update automotive_display_service selinux policy
Add a permission to use the graphics allocator.

Bug: 191094033
Test: m -j selinux_policy
Change-Id: Ic64cecd89b1dd1ce4c7fedf94b9638bcb3dca5fd
2021-06-19 03:00:25 +00:00
Diego Wilson
1c1525198a Merge "Add camera2 extension property policies" 2021-06-19 01:30:00 +00:00
Diego Wilson
5908c353e3 Add camera2 extension property policies
These properties allow to vendors to provide their
own camera2 extensions service. The properties
must be accesible to any android app that wishes
to use camera2 extensions.

Change-Id: I94c7ac336b3103355124830320787472f0d2a8b6
2021-06-18 23:59:41 +00:00
Nikita Ioffe
c96305f62b Allow apexd to call f2fs-compression related ioctls on staging_data_file
apexd needs to call the following two ioctls:

* FS_COMPR_FL - to check if fs supports compression.
* F2FS_IOC_RELEASE_COMPRESS_BLOCKS - to release compressed blocks.

Bug: 188859167
Test: m
Change-Id: Ia105d3dbcd64286cc33d1e996b2d2b85c09eae7a
Merged-In: Ia105d3dbcd64286cc33d1e996b2d2b85c09eae7a
(cherry picked from commit a12ba8a439)
2021-06-18 21:54:39 +01:00
Xin Li
c17bd06c13 DO NOT MERGE - Merge RQ3A.210605.005
Bug: 190855093
Merged-In: I59edf3d07b3a12dd3c56b8e64ed86e25e2aa357a
Change-Id: I6b663b10987b9d7d4923b0fca562e0ddc96b57e5
2021-06-18 12:24:34 -07:00
Treehugger Robot
a3d254164c Merge changes from topic "31.0_compat_mapping" am: 111c57970f
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1736247

Change-Id: I59edf3d07b3a12dd3c56b8e64ed86e25e2aa357a
2021-06-18 11:25:30 +00:00
Inseob Kim
5d82981173 Add fake 31.0 prebuilt am: 08d4c8fa6e
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1736246

Change-Id: I563089471424c37a63da2326349e21c8681bde41
2021-06-18 11:25:03 +00:00
Treehugger Robot
111c57970f Merge changes from topic "31.0_compat_mapping"
* changes:
  Add 31.0 mapping files
  Add fake 31.0 prebuilt
2021-06-18 11:15:42 +00:00
Joanne Chung
c08798a368 Merge "[Sepolicy] Change sepolicy name back to formal name." am: a079c3a9a8
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1733492

Change-Id: Iad17c1c869debfaf773b6ec3a2eb61dafbf4703c
2021-06-18 07:06:07 +00:00
Joanne Chung
a079c3a9a8 Merge "[Sepolicy] Change sepolicy name back to formal name." 2021-06-18 06:56:05 +00:00
Xin Li
6944cfcd6b DO NOT MERGE - Mark RQ3A.210410.001 as merged
Bug: 190855093
Merged-In: Ia84dd30529a037ac745d8bae9e402b3c70dccbb4
Change-Id: I35da4a962ddc5eff711b36f8ec382d0045a0a8b1
2021-06-17 22:43:31 -07:00
Michael Ayoubi
4958ba6d47 Merge "Add support for hal_uwb" am: 26c35067d5
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1732953

Change-Id: Ia84dd30529a037ac745d8bae9e402b3c70dccbb4
2021-06-18 05:02:38 +00:00
Michael Ayoubi
26c35067d5 Merge "Add support for hal_uwb" 2021-06-18 04:53:19 +00:00
TreeHugger Robot
47a7040bb0 Merge "DO NOT MERGE - Merge ab/7272582" into stage-aosp-master 2021-06-18 00:30:29 +00:00
Paul Crowley
777503c288 Merge "Remove wait_for_keymaster and references" am: a258cb3fd4
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1737775

Change-Id: I2870d2b8e70c7b28454a8832c16557d7d9b251d7
2021-06-17 18:40:41 +00:00
Paul Crowley
a258cb3fd4 Merge "Remove wait_for_keymaster and references" 2021-06-17 18:18:28 +00:00
Paul Crowley
4a7945290d Remove wait_for_keymaster and references
No longer needed now init listens for property changes on a
separate thread.

Some references to wait_for_keymaster survive: in order to avoid
trouble downstream, we keep the definition of the `wait_for_keymaster`
and `wait_for_keymaster_exec` types, but remove all their permissions,
and of course prebuilds and compat cil files are unchanged.

Bug: 186580823
Test: Cuttlefish boots successfully
Change-Id: Id97fc2668743fb58dfd10c75a4f4c4d0348284ce
2021-06-17 11:12:16 -07:00
Egor Pasko
c45bcd3cab sepolicy: Allow to receive FDs from app_zygote
The primary goal is to have an ashmem region shared between the main app
process in Chrome (=Browser Process) and the app zygote. It can only be
passed from the App Zygote, since there is no communication in the other
direction. Passing of the file descriptor should happen by:
(A) inheriting via fork(2)
(B) using binder IPC

Currently ashmem FDs are sufficiently allowed to be mmap(2)-ed in all
Chrome processes. The mode of mapping (read-only, read-write etc.) is
controlled by the settings of the region itself, not by sepolicy.

This change additionally allows an FD created in the app zygote to be
passed to the 'untrusted_app' domain.

Note: This change allows *any* FD, not just an ashmem one to be passed.
This is on purpose: in the future we will likely want to return to the
memfd story.  Other usecases (pipes, sockets) might appear.

The app zygote preload takes the responsibility not to share
capabilities in the form of FDs unintentionally with other app
processes.

Historical note: we tried to enable this for memfd (using additional
rules), but it required a 'write' permission when sending an FD. Reasons
for that are still puzzling, and there seems to be no easy workaround
for it. Decision: use ashmem.

Bug: 184808875
Test: Manual: Build and install Chrome (trichrome_chrome_google_bundle)
      from [1]. Make sure FileDescriptorAllowlist allows the FD, like
      [2]. Reach a NewTabPage, click on a suggested page, observe no
      errors related to binder transactions and selinux violations.

[1] A change in Chrome to create an ashmem region during app zygote
    preload and pass it to the browser process:
    https://crrev.com/c/2752872/29

[2] Allowlist change in review:
     https://android-review.googlesource.com/c/platform/frameworks/base/+/1739393
    (Alternatively: Remove gOpenFdTable checks in ForkCommon() in
    com_android_internal_os_Zygote.cpp)

Change-Id: Ide085f472c8fb6ae76ab0b094319d6924552fc02
2021-06-17 17:20:41 +02:00
Adam Shih
5c90c86b4f Merge "make system_app_data_file shareable over binder" am: 7216b3aa00
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1736243

Change-Id: Ic055764f86525b82d85a5d6524a2c4e2ba558361
2021-06-16 01:49:31 +00:00
Adam Shih
7216b3aa00 Merge "make system_app_data_file shareable over binder" 2021-06-16 01:26:50 +00:00
Adam Shih
ff7ba7e301 make system_app_data_file shareable over binder
Apps should be able to share their private files over binder,
including system_app.

Bug: 188869889
Test: go to setting ==> system ==> multi-users ==> tap icon to change
profile photo with camera

Change-Id: I3dc732f727b9b697c9a73f6089392690109ae035
2021-06-16 00:49:53 +00:00
Hongguang
b264eae769 Allow priv_app to run the renderscript compiler. am: 737b098a71
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1732952

Change-Id: I926aa35dcae148ab38629077a9725a6e9263a4be
2021-06-15 19:02:15 +00:00
Hongguang
737b098a71 Allow priv_app to run the renderscript compiler.
Bug: 157478854
Test: manual test and check selinux log in logcat.
Change-Id: I0bebcc6b8e4ad7dfeeb0d1c20b3d093fd48891de
2021-06-15 09:51:05 -07:00
Xin Li
f1c9e77b0f DO NOT MERGE - Merge ab/7272582
Bug: 190855093
Merged-In: I2e0b346379271fadc20e720722f7c9a687335ee2
Change-Id: I9ef4adf3d407b633ed2375d2929bbfbbf9eb3afb
2021-06-15 16:21:30 +00:00
Inseob Kim
4f20ff73ee Add 31.0 mapping files
Steps taken to produce the mapping files:

1. Add prebuilts/api/31.0/plat_pub_versioned.cil from the
/vendor/etc/selinux/plat_pub_versioned.cil file built on sc-dev with
lunch target aosp_arm64-eng. Add prebuilts/api/31.0/vendor_sepolicy.cil
as an empty file.

2. Add new file private/compat/31.0/31.0.cil by doing the following:
- copy /system/etc/selinux/mapping/31.0.cil from sc-dev aosp_arm64-eng
device to private/compat/31.0/31.0.cil
- remove all attribute declaration statement (typeattribute ...) and
sort lines alphabetically
- some selinux types were added/renamed/deleted w.r.t 31 sepolicy.
Find all such types using treble_sepolicy_tests_31.0 test.
- for all these types figure out where to map them by looking at
30.0.[ignore.]cil files and add approprite entries to 31.0.[ignore.]cil.

This change also enables treble_sepolicy_tests_31.0 and installs
31.0.cil mapping file onto the device.

Bug: 189161483
Test: m treble_sepolicy_tests_31.0
Test: m 31.0_compat_test
Test: m selinux_policy
Change-Id: I6264b9cf77b80543dfea93157b45b864157e2b14
2021-06-15 12:08:22 +00:00
Inseob Kim
08d4c8fa6e Add fake 31.0 prebuilt
This commit adds fake 31.0 prebuilt. The prebuilt is based on AOSP
policy, but slightly modified so the set of types and attributes is a
subset of real 31.0 prebuilt (sc-dev policy).

Steps taken to make the fake prebuilt:

1) build plat_sepolicy.cil both on AOSP and sc-dev, with lunch target
aosp_arm64-eng.
2) diff both outputs to find out which types and attributes don't exist.
3) remove all relevant files and statements.

As a result, the following types are removed.

artd
artd_exec
artd_service
power_stats_service
transformer_service
virtualizationservice
virtualizationservice_data_file
virtualizationservice_exec

Bug: 189161483
Test: N/A, will do after adding 31.0 mapping files.
Change-Id: Ia957fc32b1838dae730d9dd7bd917d684d4a24cf
Merged-In: Ia4ea2999f4bc8ae80f13e51d99fba3e98e293447
2021-06-15 12:08:00 +00:00
Treehugger Robot
7fc02141ae Merge "Isolate app profile ref data" am: ab8d2f0178
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1729396

Change-Id: I49a9f6f73fa63e8f9cfa6054c32148737009d3cd
2021-06-15 11:37:02 +00:00
Treehugger Robot
ab8d2f0178 Merge "Isolate app profile ref data" 2021-06-15 11:03:40 +00:00
Aaron Huang
7b1ee34d57 Merge "Add app_api_service to pac_proxy_service" am: 0f69ba0cfe
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1705195

Change-Id: Ieab290dec7b509ec1237a4666de7d8a52118a873
2021-06-15 05:15:04 +00:00
Aaron Huang
0f69ba0cfe Merge "Add app_api_service to pac_proxy_service" 2021-06-15 05:00:05 +00:00
Suren Baghdasaryan
a862426b5a Merge "sepolicy: Allow lmkd to access bpf map to read GPU allocation statistics" am: b7e70b2b68
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1721871

Change-Id: I42c90c0253927f12c18ea007352b1158a2f3f1d7
2021-06-15 01:49:40 +00:00
Suren Baghdasaryan
b7e70b2b68 Merge "sepolicy: Allow lmkd to access bpf map to read GPU allocation statistics" 2021-06-15 01:33:14 +00:00
Treehugger Robot
c72ac915a5 Merge "Add ro.vendor.build.dont_use_vabc to property_contexts" am: 49de475b86
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1734833

Change-Id: Ib6c34eb8219f5a0c0dbba5e0d6d0ca2a52daf769
2021-06-14 18:58:47 +00:00
Treehugger Robot
49de475b86 Merge "Add ro.vendor.build.dont_use_vabc to property_contexts" 2021-06-14 18:37:30 +00:00
Treehugger Robot
9caa97b1f4 Merge "Allow shell to read /vendor/apex/*" am: 05b6365178
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1736393

Change-Id: I174846e9ead4300bc4b4563d393184587c671e01
2021-06-14 13:35:39 +00:00
Treehugger Robot
05b6365178 Merge "Allow shell to read /vendor/apex/*" 2021-06-14 13:20:30 +00:00
Lalit Maganti
a0dc959c9b Merge "sepolicy: add perfetto_producer for platform_app and system_app" am: ebdc2c2ea8
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1733275

Change-Id: Iff63c6af0e02b8a116932334f6d236263eaba3d9
2021-06-14 11:58:37 +00:00
Lalit Maganti
ebdc2c2ea8 Merge "sepolicy: add perfetto_producer for platform_app and system_app" 2021-06-14 11:46:20 +00:00
Treehugger Robot
d8c269b321 Merge "Allow cameraserver to access permission checker" am: 0e1f6a5ddf
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1734253

Change-Id: I89ae9ab6e067e6997e88858dd26f990b5045c371
2021-06-14 06:00:37 +00:00
Treehugger Robot
0e1f6a5ddf Merge "Allow cameraserver to access permission checker" 2021-06-14 05:47:01 +00:00
Jiyong Park
abdc9739fc Allow shell to read /vendor/apex/*
It is used for future xTS tests to read the raw files.

Bug: 190858091
Test: m
Change-Id: If1c7fd92772ff84d92a95fbee74f6c1f8d1cd365
2021-06-14 08:30:43 +09:00
Nikita Ioffe
78e5b7a6b3 Merge "Give adbd and shell read access to /apex/apex-info-list.xml" am: 8f6d68c504
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1734153

Change-Id: Iac2b56b709ace48f381987c56d7783a1e9debc48
2021-06-13 22:06:41 +00:00
Nikita Ioffe
8f6d68c504 Merge "Give adbd and shell read access to /apex/apex-info-list.xml" 2021-06-13 21:41:45 +00:00
Songchun Fan
87b1f6ad2b [sepolicy] allow installd to query apps installed on Incremental File System am: f1a60ca2fe
Original change: https://android-review.googlesource.com/c/platform/system/sepolicy/+/1734272

Change-Id: I10d5f61ba54877b462c9261653dc2a7f0c49741b
2021-06-12 10:16:34 +00:00