Commit graph

514 commits

Author SHA1 Message Date
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
Roland Levillain
1cab1b17c0 Introduce a postinstall_apex_mnt_dir label for /postinstall/apex. am: a42ebf4128 am: 9ae5d888eb
am: 2f42ac1194

Change-Id: Iad72d60f0da9773c63b0814360e33a56b54d45f8
2019-01-29 10:35:21 -08:00
Roland Levillain
a42ebf4128 Introduce a postinstall_apex_mnt_dir label for /postinstall/apex.
Directory `/postinstall/apex` is used as a mount point for a tmpfs
filesystem during A/B OTA updates. APEX packages from the new system
partition are mounted ("activated") in subdirectories of
`/postinstall/apex`, so that they are available when `otapreopt` is
running.

Directory `/postinstall/apex` used to be of type `tmpfs` for SELinux
purposes. The new `postinstall_apex_mnt_dir` label is more
restrictive, and tightens permissions granted to `otapreopt_chroot`,
`otapreopt` (running as `postinstall_dexopt`), and `dex2oat`,
regarding the apexd logic recently added to `otapreopt_chroot`.

Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: I03f0b0433d9c066a0c607f864d60ca62fc68c990
2019-01-29 10:09:50 +00:00
Shuzhen Wang
bdcc2e6c5f Cameraserver: Allow cameraserver to access /data/misc/cameraserver am: 4e1497c7c0 am: 33898587ef
am: 588ea7beb8

Change-Id: I4cee94a2540767c54eecedb9d40943f35186be21
2019-01-28 09:13:15 -08:00
Shuzhen Wang
4e1497c7c0 Cameraserver: Allow cameraserver to access /data/misc/cameraserver
Test: Cameraserver writes/reads/overwrites files in the folder
Bug: 79465976
Change-Id: I76460844a8e02e4c6ce704b85c72e57f861f5b18
2019-01-28 07:32:00 -08:00
Yabin Cui
0c7428049c Merge "Add sepolicy for simpleperf_app_runner." am: 31bd80439f am: fc44e546bd
am: c2bf098d77

Change-Id: I4541dc21f078cbbee1e9196b199e880edbe087e5
2019-01-24 12:26:08 -08:00
Yabin Cui
e5fc21c787 Add sepolicy for simpleperf_app_runner.
Bug: 118835348
Test: build and boot pixel 3.
Test: run simpleperf_app_runner manually.

Change-Id: Ifb6c2ab78e075684bc197d06f761becced8281d1
2019-01-23 23:23:09 +00:00
Eric Holk
2adbea0501 [layout compilation] Modify sepolicy to allow installd to run viewcompiler am: f8dfb5f83b am: e82f50b4d2
am: 89ac429953

Change-Id: Ia1fcea3fab76f0a9addf31b752e7379d89b054bd
2019-01-18 17:45:36 -08:00
Eric Holk
f8dfb5f83b [layout compilation] Modify sepolicy to allow installd to run viewcompiler
We will generate precompiled layouts as part of the package install or upgrade
process. This means installd needs to be able to invoke viewcompiler. This
change gives installd and viewcompiler the minimal set of permissions needed for
this to work.

Bug: 111895153
Test: manual
Change-Id: Ic1fe60bd264c497b5f79d9e1d77c2da4e092377b
2019-01-18 23:29:47 +00:00
Christian Wailes
80c0317775 Merge "Add SELinux policies for blastula pool sockets." am: 0f466d76d9 am: b260bc494a
am: 650ef53d4f

Change-Id: Ia8bd4f3bd7dd5969c7072f7553286c4972ac7db4
2019-01-18 12:51:39 -08:00
Chris Wailes
232f395548 Add SELinux policies for blastula pool sockets.
This patch adds the necessary SELinux contexts for the blastula pool
sockets.

Topic: zygote-prefork
Test: make & flash & check log for message
Bug: 68253328
Change-Id: I46d62e5ab8c573cb7704feec2b1d42d91a990fd9
2019-01-17 23:23:34 +00:00
Annie Meng
d74f55a4d8 Add rules for multi-user backup/restore am: 4c3d11c018 am: 5d03112e4c
am: 760134702b

Change-Id: I75689dac043ac9105c85aedd84345cb7bdde4f12
2019-01-17 09:25:53 -08:00
Annie Meng
4c3d11c018 Add rules for multi-user backup/restore
The backup system service will move its storage location to per-user CE
directories to support multiple users. Add additional iterations on the
existing rules to support the new location.

/data/backup -> /data/system_ce/[user id]/backup
Previously covered by rule backup_data_file

/cache/backup -> /data/system_ce/[user id]/backup_stage
Previously covered by rule cache_backup_file

Also add support for vold to create and perform restorecon on the new
locations.

Example denials and detailed proposal in the doc on the linked bug.

Bug: 121197420
Test: 1) Boot device; check dirs created with correct label; run backup
successfully on system user
2) Create secondary user; check dirs created with correct label; run
backup successfully

Change-Id: I47faa69cd2a6ac55fb762edbf366a86d3b06ca77
2019-01-17 12:53:08 +00:00
Annie Meng
3106519cd5 Merge "Add initial sepolicy for app data snapshots." am: 9e332a59b2 am: 169013e771
am: dc5ac5b634

Change-Id: Ie12c803c3a8d1ad67bda34bb94491e99f0b24aae
2019-01-17 03:20:26 -08:00