Commit graph

527 commits

Author SHA1 Message Date
Florian Mayer
36b29c5e6f Merge "Relabel /data/system/packages.list to new type." am: 7145b25226 am: 1d0b6aed97
am: ba385e3116

Change-Id: Ibaa89cd23dcb95d34d333ede5b13de5af205a1e4
2019-03-28 10:56:04 -07:00
Florian Mayer
4ab64c940f Relabel /data/system/packages.list to new type.
Conservatively grant access to packages_list_file to everything that had
access to system_data_file:file even if the comment in the SELinux
policy suggests it was for another use.

Ran a diff on the resulting SEPolicy, the only difference of domains
being granted is those that had system_data_file:dir permissiosn which
is clearly not applicable for packages.list

diff -u0 <(sesearch --allow -t system_data_file ~/sepolicy | sed 's/system_data_file/packages_list_file/') <(sesearch --allow -t packages_list_file ~/sepolicy_new)
--- /proc/self/fd/16	2019-03-19 20:01:44.378409146 +0000
+++ /proc/self/fd/18	2019-03-19 20:01:44.378409146 +0000
@@ -3 +2,0 @@
-allow appdomain packages_list_file:dir getattr;
@@ -6 +4,0 @@
-allow coredomain packages_list_file:dir getattr;
@@ -8 +5,0 @@
-allow domain packages_list_file:dir search;
@@ -35 +31,0 @@
-allow system_server packages_list_file:dir { rename search setattr read lock create reparent getattr write relabelfrom ioctl rmdir remove_name open add_name };
@@ -40 +35,0 @@
-allow tee packages_list_file:dir { search read lock getattr ioctl open };
@@ -43,3 +37,0 @@
-allow traced_probes packages_list_file:dir { read getattr open search };
-allow vendor_init packages_list_file:dir { search setattr read create getattr write relabelfrom ioctl rmdir remove_name open add_name };
-allow vold packages_list_file:dir { search setattr read lock create getattr mounton write ioctl rmdir remove_name open add_name };
@@ -48 +39,0 @@
-allow vold_prepare_subdirs packages_list_file:dir { read write relabelfrom rmdir remove_name open add_name };
@@ -50 +40,0 @@
-allow zygote packages_list_file:dir { search read lock getattr ioctl open };

Bug: 123186697

Change-Id: Ieabf313653deb5314872b63cd47dadd535af7b07
2019-03-28 10:27:43 +00:00
Victor Hsieh
05db7d5400 Merge "Move fs-verity key loading into fsverity_init domain" am: 3337a33609 am: db2334d3aa
am: 0f94ee2784

Change-Id: I1350caf6c1ab61c14b69dbb31cfa132d0c7b7b76
2019-03-27 13:51:36 -07:00
Victor Hsieh
3d4ee1dba5 Move fs-verity key loading into fsverity_init domain
fsverity_init is a new shell script that uses mini-keyctl for the actual
key loading.  Given the plan to implement keyctl in toybox, we label
mini-keyctl as u:object_r:toolbox_exec:s0.

This gives us two benefits:
 - Better compatibility to keyctl(1), which doesn't have "dadd"
 - Pave the way to specify key's security labels, since keyctl(1)
   doesn't support, and we want to avoid adding incompatible option.

Test: Boot without SELinux denial
Test: After boot, see the key in /product loaded
Bug: 128607724
Change-Id: Iebd7c9b3c7aa99ad56f74f557700fd85ec58e9d0
2019-03-27 16:31:01 +00:00
Yifan Hong
b9182b37a5 Merge changes from topic "lpdumpd" am: 40f1682ba6 am: 7f891f414f
am: 75117c19c9

Change-Id: I43b884e08059e242830b56e7ddee62c17e6af422
2019-03-26 16:36:36 -07:00
Yifan Hong
18ade868ff Add rules for lpdump and lpdumpd
- lpdump is a binary on the device that talks to lpdumpd
  via binder.

- lpdumpd is a daemon on the device that actually reads
  dynamic partition metadata. Only lpdump can talk to it.

Bug: 126233777
Test: boots (sanity)
Test: lpdump

Change-Id: I0e21f35ac136bcbb0603940364e8117f2d6ac438
2019-03-25 10:14:20 -07:00
Jiyong Park
1d8e623fe5 No need to bind-mount bionic libraries am: 5a74473d1b am: 1ec1f839e2
am: 8cd372736f

Change-Id: Ie908baad42e9b2faa2b1c1149f7678b0a5607b6c
2019-03-15 02:44:50 -07:00
Jiyong Park
5a74473d1b No need to bind-mount bionic libraries
This is a partial revert of https://android-review.googlesource.com/c/platform/system/sepolicy/+/891474

The mount points at /bionic are gone. Therefore, init and
otapreopt_chroot do not need to bionic-mount bionic libraries.
Corresponding policies are removed.

Bug: 125549215
Bug: 113373927
Bug: 120266448
Test: m; device boots
Change-Id: I9d9d7ec204315fb5b66beec4e6a3c529bd827590
2019-03-15 14:28:27 +09:00
Anders Fridlund
e8b576fe06 Add apex_key context for files on product am: af9d7b15a3 am: 9da55373d0
am: 250507e653

Change-Id: Id86265c04a058ee102b29240434ac7a705c5ff25
2019-03-14 20:29:37 -07:00
Anders Fridlund
af9d7b15a3 Add apex_key context for files on product
Set the apex_key context for files in
/product/etc/security/apex/ and
/system/product/etc/security/apex/.

The apexd code is already looking for public keys in these locations,
but the apex_key context needs to be set to make them accessible from
apexd.

Bug: 127690808
Test: manual - verified that key files had proper SE-Linux label
Change-Id: Ib15728fa97eb438ea97a9743a06fa46e4d54f1cd
2019-03-15 03:10:53 +00:00
Tao Bao
73090c6ff8 Move /sbin/charger to /system/bin/charger. am: ecc7e8cacb am: 18e68c790f
am: b20b005e2e

Change-Id: I4c459ee3e6dc294cac751d844a378cd3ed0c75cc
2019-03-14 10:17:23 -07:00
Tao Bao
ecc7e8cacb Move /sbin/charger to /system/bin/charger.
With the CLs in the same topic, it's being built as a dynamically linked
executable. And this applies to normal boot (including charger mode) and
recovery mode both.

/system/bin/charger under normal boot will be labeled as charger_exec,
which has the attribute of system_file_type.

The file in recovery image will still be labeled as rootfs. So we keep
the domain_trans rule for rootfs file, but allowing for recovery mode
only.

Bug: 73660730
Test: Boot into charger mode on taimen. Check that charger UI works.
Test: Boot into recovery mode. Check that charger process works.
Change-Id: I062d81c346578cdfce1cc2dce18c829387a1fdbc
2019-03-14 09:44:03 -07:00
Gavin Corkery
64b812c27e Rename data/pkg_staging to data/app-staging
Test: n/a
Bug: 126330086

Change-Id: I34d5085d8e6546d77cc854e27ca849462d482396
Merged-In: I34d5085d8e6546d77cc854e27ca849462d482396
2019-03-14 14:00:53 +00:00
Roland Levillain
7606aff18f Merge "No longer label patchoat binaries in file_contexts." am: bf2ee36db9 am: 5b8a175475
am: 8929a3ef7c

Change-Id: Ib16afbb9b336eca1341bd6c5fb2239ba4ababac6
2019-03-14 06:43:50 -07:00
Roland Levillain
6f314bcd95 No longer label patchoat binaries in file_contexts.
The patchoat program has been removed from Android in
https://android-review.googlesource.com/c/platform/art/+/774905.

Test: n/a
Bug: 77856493
Change-Id: Icf6ed2e5671d20f57dff94a55bedfb035cfc0ee7
2019-03-13 20:18:57 +00:00
Andreas Gampe
2a7c398d1c Merge "Sepolicy: ART APEX boot integrity" am: 01147a70f4 am: 950d25ccf9
am: 089db86c5f

Change-Id: I7aa4ba3113928cabbb8de007339207b2dfc70d94
2019-03-13 11:44:28 -07:00
Andreas Gampe
1845b406fc Sepolicy: ART APEX boot integrity
Add ART boot integrity check domain. Give it rights to run
fsverity and delete boot classpath artifacts.

Bug 125474642
Test: m
Test: boot
Change-Id: I933add9b1895ed85c43ec712ced6ffe8f820c7ec
2019-03-12 22:26:17 -07:00
Martijn Coenen
57b86b3817 Merge "Add policy for /metadata/apex." am: 460efa2a01 am: bd415ea496
am: ff4ada393e

Change-Id: I6fe168c03b47778bec5ef70beddcadeee734033d
2019-03-12 14:32:32 -07:00
Martijn Coenen
5fbbf2613c Add policy for /metadata/apex.
This is an area that apexd can use to store session metadata, which
won't be rolled back with filesystem checkpointing.

Bug: 126740531
Test: builds
Change-Id: I5abbc500dc1b92aa46830829be76e7a4381eef91
2019-03-12 18:31:07 +01:00
Gavin Corkery
5a374f0665 Merge "Rename data/pkg_staging to data/app-staging" 2019-03-09 12:41:28 +00:00
Gavin Corkery
acd3db36a2 Rename data/pkg_staging to data/app-staging
Test: n/a
Bug: 126330086

Change-Id: I34d5085d8e6546d77cc854e27ca849462d482396
2019-03-08 15:32:33 +00:00
David Anderson
fe945030d6 Add sepolicy for /metadata/password_slots. am: d99b7fd3f9 am: 2fc6b0457d
am: 0e347a5e3b

Change-Id: I46333da4106981384397a895b3f911fc9b9731e5
2019-03-07 13:08:30 -08:00
David Anderson
d99b7fd3f9 Add sepolicy for /metadata/password_slots.
The device OS and an installed GSI will both attempt to write
authentication data to the same weaver slots. To prevent this, we can
use the /metadata partition (required for GSI support) to communicate
which slots are in use between OS images.

To do this we define a new /metadata/password_slots directory and define
sepolicy to allow system_server (see PasswordSlotManager) to access it.

Bug: 123716647
Test: no denials on crosshatch
Change-Id: I8e3679d332503b5fb8a8eb6455de068c22eba30b
2019-03-07 16:19:15 +00:00
Dario Freni
3b106357ae Use label staging_data_file for installed APEX. am: 5ed5072e06 am: a2e321d86a
am: 489a6a4e50

Change-Id: I3d8573b083ac947e0f4397b2f06d0e476ebab6f5
2019-03-03 16:14:15 -08:00
Dario Freni
5ed5072e06 Use label staging_data_file for installed APEX.
This is needed in cases SELinux labels are restored under /data/apex by
an external process calling restorecon. In normal condition files under
/data/apex/active retain the label staging_data_file used at their
original creation by StagingManager. However, we observed that the label
might be changed to apex_data_file, which we were able to reproduce by
running restorecon.

Explicitly mark files under /data/apex/active and /data/apex/backup as
staging_data_file.

This CL also remove some stale rules being addressed since.

Test: ran restorecon on files in /data/apex/active, attempted installing
a new apex which triggered the violation when files are linked to
/data/apex/backup. With this CL, the operation succeeds.
Bug: 112669193
Change-Id: Ib4136e9b9f4993a5b7e02aade8f5c5e300a7793c
2019-03-03 20:53:42 +00:00
Chris Wailes
6a0bde2eb3 Renamed blastula to unspecialized app process (usap)
Bug: 123017829
Test: make & boot & launch apps
Change-Id: I48b067216f52773c128f72234e453c134b85b75a
2019-03-02 01:18:10 +00:00
Suren Baghdasaryan
a52c22172b Merge "sepolicy for vendor cgroups.json and task_profiles.json files" am: e3f15e2abc am: b582791324
am: 14a03c82a4

Change-Id: Ibd4f155feae6b925952b90e0078a5229aa74c7bb
2019-03-01 10:29:38 -08:00
Suren Baghdasaryan
6155b2fd11 sepolicy for vendor cgroups.json and task_profiles.json files
Vendors should be able to specify additional cgroups and task profiles
without changing system files. Add access rules for /vendor/etc/cgroups.json
and /vendor/etc/task_profiles.json files which will augment cgroups and
task profiles specified in /etc/cgroups.json and /etc/task_profiles.json
system files. As with system files /vendor/etc/cgroups.json is readable
only by init process. task_profiles.json is readable by any process that
uses cgroups.

Bug: 124960615
Change-Id: I12fcff0159b4e7935ce15cc19ae36230da0524fc
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-01 00:32:15 +00:00
Tri Vo
858ae7c145 Merge "Decouple system_suspend from hal attributes." am: c67a1ff8d9 am: e9aa4fc320
am: 4ac6a82aba

Change-Id: I98fe101822b62754dc2562d056cb3e92013c2be5
2019-02-27 13:38:07 -08:00
Tri Vo
a532088e7f Decouple system_suspend from hal attributes.
System suspend service is not a HAL, so avoid using HAL-specific macros
and attributes.

Use system_suspend_server attribute for ISystemSuspend.hal permissions.
Use system_suspend type directly for internal .aidl interface
permissions.

Bug: 126259100
Test: m selinux_policy
Test: blueline boots; wakelocks can still be acquired; device suspends
if left alone.
Change-Id: Ie811e7da46023705c93ff4d76d15709a56706714
2019-02-26 18:10:28 -08:00
Gavin Corkery
2db5015b4c Rename data/staging to data/pkg_staging.
Test: Build and flash, atest apex_e2e_tests
Fixes: 122999313
Change-Id: I2cfa49d8467d67edc470b1cade3746426fa86e37
Merged-In: I2cfa49d8467d67edc470b1cade3746426fa86e37
2019-02-19 15:51:14 +00:00
Gavin Corkery
60a0d53c4b Rename data/staging to data/pkg_staging.
Test: Build and flash, atest apex_e2e_tests
Fixes: 122999313
Change-Id: I2cfa49d8467d67edc470b1cade3746426fa86e37
2019-02-17 20:58:26 +00:00
Chenjie Yu
62540bba0b Merge "train info persist to disk sepolicy" am: a0f56f1d63 am: d098364298
am: a9d2d41da4

Change-Id: Id1863ccf518e9d5d3d5f8decc664cd9be025af22
2019-02-13 17:24:34 -08:00
Chenjie Yu
9e625b0745 train info persist to disk sepolicy
Test: will add gts
Bug: 122807604
Change-Id: I60d2b207d8cf652ff90111cc5bef996f14d93376
2019-02-12 15:40:02 -08:00
David Anderson
2830744829 Full sepolicy for gsid. am: db90b91ea0 am: 300d0ef2c5
am: 2ef1c42189

Change-Id: I4f2faee6ad4c3cc8f3d9385ec6914cf3d28a3275
2019-02-07 22:18:38 -08:00
David Anderson
db90b91ea0 Full sepolicy for gsid.
Bug: 122556707
Test: manual test
Change-Id: I2536deefb3aa75deee4aeae7df074349b705b0f0
2019-02-08 05:56:58 +00:00
Carmen Jackson
a99929f109 Allow the init process to execute the notify_traceur.sh script am: 07cb0ded7b am: 3908f9d7c3
am: 40de488325

Change-Id: Iaef079a45f16ff108c47d97a38e7f5f6865a10e8
2019-02-06 17:03:08 -08:00
Carmen Jackson
07cb0ded7b Allow the init process to execute the notify_traceur.sh script
This sets up a selinux domain (notify_traceur) that can be called from
init and has the permissions to run the activitymanager script.

Bug: 116754134
Test: manual
Change-Id: Ia371bafe5d3d354efdf8cd29365cd74ed3e5cdfd
2019-02-07 00:28:40 +00:00
Chenjie Yu
77a0bc91d3 Merge "active metric dir for statsd" am: 0cb6b7be10 am: 5278613fad
am: 4bf156a6be

Change-Id: I09123be6597cbee6af4b0800bd4d72c5eaa27683
2019-02-06 15:44:20 -08:00
Chenjie Yu
4ee5304bb2 active metric dir for statsd
Bug: 123904359
Test: unit test
Change-Id: I92ac4ef97fb4f951270679f829601b1aca893b7c
2019-02-06 18:06:01 +00:00
Tri Vo
a7061e8e9a sepolicy for ashmemd am: 73d0a67b06 am: 610a8ed7cf
am: e869afd212

Change-Id: I8f025f4b1b5b1fab19998752ef2d6fb9a503ba16
2019-02-05 14:11:45 -08:00
Tri Vo
73d0a67b06 sepolicy for ashmemd
all_untrusted_apps apart from untrusted_app_{25, 27} and mediaprovider
are now expected to go to ashmemd for /dev/ashmem fds.

Give coredomain access to ashmemd, because ashmemd is the default way
for coredomain to get a /dev/ashmem fd.

Bug: 113362644
Test: device boots, ashmemd running
Test: Chrome app works
Test: "lsof /system/lib64/libashmemd_client.so" shows
libashmemd_client.so being loaded into apps.
Change-Id: I279448c3104c5d08a1fefe31730488924ce1b37a
2019-02-05 21:38:14 +00:00
Suren Baghdasaryan
561ce801b0 sepolicy changes to configure cgroup.rc and task_profiles.json access
cgroups.json file contains cgroup information required to mount
cgroup controllers and is readable only by init process.
cgroup.rc contains cgroup map information consisting of the list of
cgroups available in the system and their mounting locations. It is
created by init process and should be readable by any processes that
uses cgroups and should be writable only by init process.
task_profiles.json file contains task profiles used to operate on
cgroups. This information should be readable by any process that uses
cgroups and should be writable only by init process.

Bug: 111307099
Test: builds, boots

Change-Id: Ib2c87c0fc3663c7fc69628f05c846519b65948b5
Merged-In: Ib2c87c0fc3663c7fc69628f05c846519b65948b5
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-02 16:56:08 +00:00
Suren Baghdasaryan
dbd438c239 sepolicy changes to configure cgroup.rc and task_profiles.json access
cgroups.json file contains cgroup information required to mount
cgroup controllers and is readable only by init process.
cgroup.rc contains cgroup map information consisting of the list of
cgroups available in the system and their mounting locations. It is
created by init process and should be readable by any processes that
uses cgroups and should be writable only by init process.
task_profiles.json file contains task profiles used to operate on
cgroups. This information should be readable by any process that uses
cgroups and should be writable only by init process.

Bug: 111307099
Test: builds, boots

Change-Id: Ib2c87c0fc3663c7fc69628f05c846519b65948b5
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-02 05:52:45 +00:00
Xiaoyong Zhou
2ebc63bef4 add selinux rules for mini-keyctl
mini-keyctl is a binary used to load channel keys to .fsverity keyring.
This CL creates a new domain for mini-keyctl and a type for /proc/keys
and adds allow rules needed by this binary.

Bug: 112038861
Test: manual
Merged-In: I3b744d302859a02dfe63c81c7f33bb30912d7994
Change-Id: I3b744d302859a02dfe63c81c7f33bb30912d7994
2019-01-31 15:12:11 -08:00
Xiaoyong Zhou
1ae4faa9dc add selinux rules for mini-keyctl
mini-keyctl is a binary used to load channel keys to .fsverity keyring.
This CL creates a new domain for mini-keyctl and a type for /proc/keys
and adds allow rules needed by this binary.

Bug: 112038861
Test: manual
Change-Id: I3b744d302859a02dfe63c81c7f33bb30912d7994
2019-01-31 13:40:00 -08:00
Jiyong Park
0f9fc7f243 Label the bootstrap linker and bionic mount points am: 4b3f2c6245 am: b546607a27
am: cfd57fc095

Change-Id: Idadc6f1896ce577f9995bfe799185d1da32f57f8
2019-01-30 21:30:49 -08:00
Jiyong Park
4b3f2c6245 Label the bootstrap linker and bionic mount points
Bootstap linker has been moved from /system/bin/linker[64] to
/system/bin/bootstrap/linker[64]. Reflect the change in file_contexts.
Existing paths are not removed since the bootstrap linker (or the
linker from the rumtime APEX) will be bind-mounted to the old path by
init.

Also label the files under /bionic which serve as mount points for
either of the bootstrap bionic or the bionic from the runtime APEX.

In addition, read access for the symlinks in /system/lib/*.so and
/system/bin/linker is granted. This is because Bionic files in the paths
are now symlinks to the corresponding mountpoints at /bionic.

Bug: 120266448
Test: device boots to the UI

Change-Id: Iea4d76eb46754b435b6c5428481cd177da8d2ee1
2019-01-31 13:44:21 +09:00
Shuzhen Wang
043d6165cc Revert "Cameraserver: Allow cameraserver to access /data/misc/cameraserver" am: 6b4caaa3e8 am: e588655bb9
am: e828b68c69

Change-Id: I2f7bea04a595a7c18d915d354a833581a08ec556
2019-01-29 21:58:14 -08:00
Shuzhen Wang
6b4caaa3e8 Revert "Cameraserver: Allow cameraserver to access /data/misc/cameraserver"
This reverts commit 4e1497c7c0.

Reason for revert: Write temporary file to in-memory tmpfs instead

Test: testHeic CTS test
Bug: 123526741
Change-Id: Ifa7f5a0b50c46ee3e1a5695595233b17adc99222
2019-01-29 23:29:05 +00:00