Commit graph

3528 commits

Author SHA1 Message Date
Jeff Vander Stoep
d5bf5c0e31 Revert "audit use of net.dns. property"
This is just causing unnecessary log spam. Remove.

This reverts commit ecb00a109c.
Test: build
2019-04-11 19:25:59 +00:00
Jiyong Park
a0f998e6de Allow bootstrap bionic only to init, ueventd, and apexd
The bootstrap bionic (/system/lib/bootstrap/*) are only to the early
processes that are executed before the bionic libraries become available
via the runtime APEX. Allowing them to other processes is not needed and
sometimes causes a problem like b/123183824.

Bug: 123183824
Test: device boots to the UI
Test: atest CtsJniTestCases:android.jni.cts.JniStaticTest#test_linker_namespaces
Change-Id: Id7bba2e8ed1c9faf6aa85dbbdd89add04826b160
2019-04-11 09:51:38 +09:00
Treehugger Robot
9596d6d4c7 Merge "Re-label /data/pkg_staging files as staging." 2019-04-10 16:30:21 +00:00
Treehugger Robot
e8bdbdeeab Merge "ephemeral_app: restore /dev/ashmem open permissions" 2019-04-10 16:02:01 +00:00
Dario Freni
e7aaa0c273 Re-label /data/pkg_staging files as staging.
While the directory is not present anymore in Q, it has been shipped on
Q Beta 2 and the absence of such label might cause issues to devices
with pending installs which receive an OTA > Beta 2.

Bug: 130184133
Test: m
Merged-In: Ie3e77eebd2e7fd7b3a6a940d189cbc2bb386dc0e
Change-Id: Ie3e77eebd2e7fd7b3a6a940d189cbc2bb386dc0e
2019-04-10 15:53:01 +00:00
Tri Vo
19200ae354 ephemeral_app: restore /dev/ashmem open permissions
ephemeral_app domain doesn't distinguish between apps that target Q vs
ones target pre-Q. Restore ashmem permissions for older apps.

Bug: 130054503
Test: start com.nextlatam.augmentedfaces instant app
Change-Id: I490323cce96d69e561fc808426a9dfba2aeac30f
Merged-In: I490323cce96d69e561fc808426a9dfba2aeac30f
(cherry picked from commit 0da2ecda62)
2019-04-09 14:18:18 -07:00
Nick Kralevich
622ab8a2ba Add policy for /system/bin/auditctl
/system/bin/auditctl is executed by init to set the kernel audit
throttling rate limit. Grant the rules necessary for this to happen.

Test: compiles and boots
Test: Perform an operation which generates lots of SELinux denials,
      and count how many occur before and after the time period.
Bug: 118815957

Change-Id: Id9df65497d1172ab7c2e84ff6a43722f11c61620
2019-04-09 12:47:10 -07:00
Treehugger Robot
f2c5821e50 Merge "Add producer socket to the selinux perfetto domain." 2019-04-08 16:48:35 +00:00
Hector Dearman
bc67b7b1b4 Merge "Re-add sys_traced prop" 2019-04-08 12:23:12 +00:00
Stephen Nusko
cdda2dc3c9 Add producer socket to the selinux perfetto domain.
This change allows the perfetto cmdline client to access
the (unprivileged) producer socket of traced, with the
intent of triggering finalization of already running traces
(see b/130135730). Matching change: aosp/932138

Note that:
- perfetto cmdline can already access the consumer socket
  (to start tracing sessions).
- The producer socket is already exposed to most domains,
  including unprivileged apps.

Bug: 130135730
Bug: 128966650
Change-Id: Id9106279584798e6689102085fa46a0b7ecb1ba7
2019-04-08 08:21:54 +00:00
Hector Dearman
0756dcc9da Re-add sys_traced prop
Add permissions for:
persist.device_config.global_settings.sys_traced

Bug: b/71737179
Test: As follows:
patch aosp/891475
patch aosp/891853
patch ag/6224352

$ adb shell
walleye:/ $ ps -A | grep traced
nobody        1135     1   52288   2200 0                   0 S traced
nobody        1136     1   52288   2256 0                   0 S
traced_probes
walleye:/ $ settings put global sys_traced 0
walleye:/ $ ps -A | grep traced
1|walleye:/ $
walleye:/ $ settings put global sys_traced 1
1|walleye:/ $ ps -A | grep traced
nobody       12386     1   52288   2208 0                   0 S traced
nobody       12387     1   52288   2248 0                   0 S
traced_probes
Change-Id: I8898672c8fdc9c5d87a31b90f6c7d5c03bef78ed
2019-04-05 15:53:57 +00:00
Isabelle Taylor
07b5bc635a Merge "Allow traced_probes access to atrace HAL" 2019-04-05 10:07:19 +00:00
Chalard Jean
a4c9f7b2c6 Let dumpstate get netd stack traces.
Test: manual
Bug: 128804277
Change-Id: Ibb3c0063f96f835edb13868b3e7a9fb9f6f94195
2019-04-05 17:33:56 +09:00
Treehugger Robot
16a9ab81e1 Merge "Allow surfaceflinger to access bufferhub" 2019-04-04 21:09:12 +00:00
Treehugger Robot
54524c9192 Merge "system_server_startup: allow SIGCHLD to zygote" 2019-04-04 20:06:48 +00:00
Isabelle Taylor
e8c4ba8137 Allow traced_probes access to atrace HAL
03-26 10:34:53.532   585   585 E SELinux : avc:  denied  { find } for interface=android.hardware.atrace::IAtraceDevice sid=u:r:traced_probes:s0 pid=917 scontext=u:r:traced_probes:s0 tcontext=u:object_r:hal_atrace_hwservice:s0 tclass=hwservice_manager permissive=0

Bug: 127378737
Test: manually
Change-Id: Icfeee8e8d62c9e11072d4f8cc1d04f256b9636c5
2019-04-04 16:31:50 +00:00
Jeff Vander Stoep
67dc274f87 system_server_startup: allow SIGCHLD to zygote
avc: denied { sigchld } for comm="main"
scontext=u:r:system_server_startup:s0 tcontext=u:r:zygote:s0
tclass=process permissive=0

Test: build
Change-Id: I98c106b17ba1740f953c3108bd0fc927c150096f
2019-04-04 09:25:15 -07:00
Jiwen 'Steve' Cai
2177320456 Allow surfaceflinger to access bufferhub
Bug: 112940221
Test: AHardwareBufferTest
Change-Id: I3e0304d8e8e3a91860ea8ce4ebe740966beed301
2019-04-03 15:54:53 -07:00
Jiyong Park
cff95d7b5f Remove apex_key_file
We no longer have /system/etc/security/apex/* as the public keys are all
bundled in APEXes. Removing the selinux label and policies for it.

Bug: 936942
Test: device is bootable

Change-Id: I6b6144a8d15910d1ba8584a0778244ed398dc615
2019-04-03 09:49:15 +00:00
Treehugger Robot
5686c383c8 Merge "Allow traced_probes to read packages.list." 2019-04-03 09:28:26 +00:00
Przemyslaw Szczepaniak
d385346ada Merge "NNAPI property to disable extensions use on GSI/AOSP product partition." 2019-04-03 08:51:53 +00:00
Luke Huang
554b334d7b Sepolicy for netutils_wrapper to use binder call
Bug: 65862741
Test: built, flashed, booted
Change-Id: I346520c47b74fde5137ad7c777f0a9eca50a06d7
2019-04-03 03:09:37 +00:00
Treehugger Robot
61f28b33a4 Merge "Allow execmod for apps with targetSdkVersion=26-28" 2019-04-03 01:58:26 +00:00
Nick Kralevich
99a5103585 rs.te: Allow ephemeral_app FD use
Allow renderscript to use file descriptors created by ephemeral apps.
This is needed to support renderscript execution by ephemeral apps.

Steps to reproduce:

  atest com.google.android.pm.gts.PackageManagerHostTest#testRenderScriptLoading

Expected:

  Test passes

Actual:
  03-26 03:33:45.373  4607  4607 F linker  : CANNOT LINK EXECUTABLE "/system/bin/bcc": can't enable GNU RELRO protection for "": Permission denied
  03-26 03:33:45.373  4566  4600 E RenderScript: Child process "/system/bin/bcc" terminated with status 256
  03-26 03:33:45.373  4566  4600 E RenderScript: bcc: FAILS to compile 'init_test'
  03-26 03:33:45.374  4566  4596 E TestRunner: failed: testRenderScriptLoading(com.google.android.gts.packagemanager.InstantAppTestCases)
  03-26 03:33:45.375  4566  4596 E TestRunner: ----- begin exception -----
  03-26 03:33:45.375  4566  4596 E TestRunner: java.lang.AssertionError: Instant App should be able to access RenderScript APIs.
  03-26 03:33:45.375  4566  4596 E TestRunner:  at org.junit.Assert.fail(Assert.java:88)
  03-26 03:33:45.375  4566  4596 E TestRunner:  at com.google.android.gts.packagemanager.InstantAppTestCases.testRenderScriptLoading(InstantAppTestCases.java:338)
  03-26 03:33:45.375  4566  4596 E TestRunner:  at java.lang.reflect.Method.invoke(Native Method)
  03-26 03:33:45.375  4566  4596 E TestRunner:  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)

Additional notes: Confusingly ephemeral_app is not part of untrusted_app_all,
but it is part of all_untrusted_apps, which is used for neverallow
assertions.

Bug: 129356700
Test: atest com.google.android.pm.gts.PackageManagerHostTest#testRenderScriptLoading
Change-Id: I47781012b9fd2cd1d03a3d50bed0c693bcf9ec7b
2019-04-02 13:59:39 -07:00
Jeff Vander Stoep
c9aba12002 Allow execmod for apps with targetSdkVersion=26-28
Bug: 129760476
Test: build
Change-Id: I239c16e8269b81c22738e7813c1d4ae46068aa53
2019-04-02 13:07:27 -07:00
Przemyslaw Szczepaniak
62a22ce5d6 NNAPI property to disable extensions use on GSI/AOSP product partition.
Property is NNAPI client-readable and writeable only by init/build.prop.

Bug: 129666983
Bug: 120483623
Test: flashed crosshatch/Cts tests for NNAPI
Change-Id: Ic4c0f176440610a2c54c078863f3d5382323cc65
2019-04-02 20:23:40 +01:00
Florian Mayer
d04ffff3ea Allow traced_probes to read packages.list.
Bug:123186697

Change-Id: Ifa480ae42f00740a39b8126e8fa6fd2120ac9b61
2019-04-02 17:18:35 +01:00
Xiao Ma
f99aa3cb66 Merge "revert ipmemorystore selinux policy." 2019-04-02 03:56:42 +00:00
Mårten Kongstad
4bc3ca77e8 Add rule for /oem/overlay
Bug: 121033532
Test: builds, boots
Change-Id: I70b23b11831d57b3241e6057c745aa4ce9f795ef
2019-04-01 16:36:39 +00:00
Xiao Ma
e2876a3d11 revert ipmemorystore selinux policy.
Since ipmemorystore service has been moved to network stack from
system service, also should revert the relevant sepolicy which is
corresponding to the previous configuration.

Bug: 128392280
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I1ae09696e620b246f817db71e7b71c32aae9be05
2019-04-01 16:37:25 +09:00
Treehugger Robot
2c6a0eb2d9 Merge "netutils_wrapper: suppress sysfs denials" 2019-03-30 04:38:39 +00:00
Jeff Vander Stoep
c510da9918 netutils_wrapper: suppress sysfs denials
Addresses spurious denials caused by users of netutils_wrapper which
open files in /sys without O_CLOEXEC.
avc: denied { read } for comm="iptables-wrappe"
dev="sysfs" ino=47786 scontext=u:r:netutils_wrapper:s0
tcontext=u:object_r:sysfs_msm_subsys:s0 tclass=file

Test: build
Change-Id: I1c1f82428555be6a9798a189420dd85a9db107f7
2019-03-29 14:29:42 -07:00
Tim Murray
251591fa04 sepolicy: Grant system_server and init access to /proc/pressure/memory
Need ability for system components to access psi memory pressure file.
Add required permissions for system_server and init to access
/proc/pressure/memory file.

Bug: 129476847
Test: system_server can read /proc/pressure/memory
Change-Id: I10ce4f4fe0e3618fa77539e93246d0aae933082c
Signed-off-by: Tim Murray <timmurray@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-28 22:11:25 +00:00
Yifan Hong
93b81f30ae Merge "super_block_device -> super_block_device_type" 2019-03-28 19:55:44 +00:00
Florian Mayer
eda65027c7 Merge "Allow heapprofd to read test files." 2019-03-28 18:21:10 +00:00
Yifan Hong
ab85caaa56 super_block_device -> super_block_device_type
Domains that access super_block_device should instead
access super_block_device_type, which includes appropriate
block devices for retrofit DAP devices.

Test: boots (sanity)
Test: manual OTA
Bug: 128991918
Change-Id: Ie025b1e3c17e82330042aaa4a3e2e4a02ec1265b
2019-03-28 18:08:19 +00:00
Florian Mayer
7145b25226 Merge "Relabel /data/system/packages.list to new type." 2019-03-28 17:36:36 +00:00
Hector Dearman
2d4894323c Merge "Fix typos in genfs_contexts" 2019-03-28 10:51:03 +00: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
David Anderson
6557d87b0f Add sepolicy for installing GSIs to external storage.
To install GSIs on external storage (such as sdcards), gsid needs some
additional privileges:
 - proc_cmdline and device-tree access to call ReadDefaultFstab().
   This is ultimately used to check whether system's dm-verity has
   check_at_most_once enabled, which is disallowed with sdcards.
 - vfat read/write access to write files to the sdcard. Note that
   adopted sdcards are not supported here.
 - read access to the sdcard block device. To enable this without
   providing access to vold_block_device, a new sdcard_block_device
   label was added. Devices must apply this label appropriately to
   enable gsid access.
 - FIBMAP access for VFAT filesystems, as they do not support FIEMAP.
   This only appears to work by granting SYS_RAWIO.

Bug: 126230649
Test: adb shell su root gsi_tool install --install_dir=/mnt/media_rw/...
      works without setenforce 0

Change-Id: I88d8d83e5f61d4c0490f912f226fe1fe38cd60ab
2019-03-27 17:12:51 -07:00
Steven Moreland
180ffccc8f Merge "private: allow zygote mnt_expand_file:dir getattr;" 2019-03-27 22:59:49 +00:00
Treehugger Robot
3337a33609 Merge "Move fs-verity key loading into fsverity_init domain" 2019-03-27 20:31:19 +00:00
Hector Dearman
714b917411 Fix typos in genfs_contexts
Each tracing event is listed twice in this file, once in
debugfs and once in tracefs:

genfscon debugfs /tracing/events/sched/sched_switch/
genfscon tracefs /events/sched/sched_switch/

Some of the debugfs entries are missing the required leading
/tracing/ prefix, probably a copy paste error from when they were
added.

Test: make
Change-Id: I6e64eac0c2b95b38c4648b92765c748c631348b7
2019-03-27 17:06:39 +00:00
Treehugger Robot
76a1a76b35 Merge "Revert "Temporarily hide denial to fix tests."" 2019-03-27 16:54:12 +00: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
Nick Kralevich
9097360049 Revert "Temporarily hide denial to fix tests."
This reverts commit 94b5fe4af5.

Reason for revert: Obsoleted by https://android-review.googlesource.com/933916

Bug: 129298168
Change-Id: I6b34cfdf76b5094db17ee06831d8a662ea360956
Test: Build.
2019-03-27 13:56:20 +00:00
Florian Mayer
12f7e0e658 Allow heapprofd to read test files.
This is needed to test the unwinding of test binaries.

03-26 19:55:44.311   939   939 W heapprofd: type=1400 audit(0.0:13): avc: denied { search } for name="nativetest" dev="sda45" ino=6815745 scontext=u:r:heapprofd:s0 tcontext=u:object_r:nativetest_data_file:s0 tclass=dir permissive=0

Change-Id: Icfbc6060a8755934f1c3935aac55ce7792dc7d85
2019-03-27 11:07:05 +00:00
Yifan Hong
40f1682ba6 Merge changes from topic "lpdumpd"
* changes:
  Add rules for lpdump and lpdumpd
  Allow to getattr kmsg_device
2019-03-26 20:35:36 +00:00
Nick Kralevich
a2b90b5efc Merge "Temporarily hide denial to fix tests." 2019-03-26 20:06:49 +00:00
Joel Galenson
94b5fe4af5 Temporarily hide denial to fix tests.
This shoud be removed once the offending code is fixed.

Bug: 129298168
Test: Build.
Change-Id: Ie94a626be777a094fb587f72b3987994e085a23e
2019-03-25 17:37:51 -07:00
Tri Vo
a109fa645c Merge "Allow system_suspend access to /sys/power/wake_[un]lock." 2019-03-25 23:38:09 +00: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
Joe Onorato
d7148b99cb Merge "Allow incidentd to communicate with clients over pipes." 2019-03-24 22:41:01 +00:00
Joe Onorato
9cc5c09be5 Allow incidentd to communicate with clients over pipes.
Previously we dumped the data into dropbox.  This improves a couple
things:
  - We write into dropbox via the fd, so dropbox doesn't pull from the
    incidentd directory anymore.
  - There is a new API to for priv apps to explicitly read incident
    reports. That gives incidentd finer grained control over who can
    read it (specifically, it only allows apps to access the incident
    reports they requested, or were requested for them via statsd,
    instead of getting DUMP and reading whatever they want from
    dropbox).

Test: bit incident_test:* GtsIncidentManagerTestCases:*
Bug: 123543706
Change-Id: I9a323e372c4ff95d91419a61e8a20ea5a3a860a5
2019-03-22 17:04:49 -07:00
Andreas Gampe
30186cf611 Sepolicy: Allow otapreopt access to vendor overlay files
A handful of APKs are vendor overlay files. Allow access.

Test: m
Change-Id: I791fa37a3bcb07729386047f0cda178753af9de5
2019-03-22 12:13:53 -07:00
Andreas Gampe
1a5db599ce Sepolicy: Allow otapreopt to mount logical partitions
Logical partitions are handled through libdm. Allow access to
device-mapper.

Bug: 128867786
Test: m
Change-Id: I6979487b91d24b7309c876f2bdc26a827e2fcd1e
2019-03-22 12:13:05 -07:00
David Brazdil
c848dee19c Merge "dexoptanalyzer: Allow writing into installd's pipe" 2019-03-22 13:48:58 +00:00
Florian Mayer
3b641a60a2 Merge "Give heapprofd dac_read_search on userdebug." 2019-03-22 10:37:05 +00:00
Alan Stokes
5c378a5374 Clarify priv_app.te.
No semantic changes. Just trying to make this easier to understand:
- Separate out common bundles of services from individual services
  (the naming doesn't make this obvious).
- Comment the common ones.
- Put related binder_call and service_manager:find rules together.

Test: Builds
Change-Id: Iba4a85a464da032e35450abff0febcdcf433df48
2019-03-21 23:52:30 +00:00
Florian Mayer
e922aa38bf Give heapprofd dac_read_search on userdebug.
This is needed because some oat dex files are generated without world
readable permissions. See the bug for details.

We are still constrained by the SELinux rules above.

Bug: 129048073

Change-Id: I84e34f83ceb299ff16b29a78f16c620fc0aa5d68
2019-03-21 17:22:09 +00:00
Steven Moreland
c46e31c961 private: allow zygote mnt_expand_file:dir getattr;
zygote is using this permission to preload Java libraries.

Bug: 128529256
Test: boot
Change-Id: If7e56409ae0171f5a04eadb2c297c865f9d4ffaf
2019-03-20 16:26:43 +00:00
David Brazdil
246efa2a24 dexoptanalyzer: Allow writing into installd's pipe
Dexoptanalyzer is getting a new mode to instruct installd on which dex
files it needs to open for itself and dex2oat from class loader context.
The file list is communicated by a pipe from a forked dexoptanalyzer
process to the installd parent. Give dexoptanalyzer permission to write
to installd's pipes.

Bug; 126674985
Test: atest installd_dexopt_test
Change-Id: Ic415e2dc543099d26681103c9d368c941d21b49a
2019-03-20 15:37:12 +00:00
Roland Levillain
f52fefe5ee Merge "Allow otapreopt_chroot to use a flattened Runtime APEX package." 2019-03-20 10:38:57 +00:00
Tri Vo
8730aeb2e9 Allow system_suspend access to /sys/power/wake_[un]lock.
Bug: 128923994
Test: boot taimen, no denials when writing to /sys/power/wake_[un]lock
Change-Id: Ib9ade5e532f906d2228642dfa5f52f609e559199
2019-03-19 21:34:49 -07:00
Cheney Ni
e55a74bdff Add rules for accessing the related bluetooth_audio_hal_prop
This change allows those daemons of the audio and Bluetooth which
include HALs to access the bluetooth_audio_hal_prop. This property is
used to force disable the new BluetoothAudio HAL.
  - persist.bluetooth.bluetooth_audio_hal.disabled

Bug: 128825244
Test: audio HAL can access the property
Change-Id: I87a8ba57cfbcd7d3e4548aa96bc915d0cc6b2b74
2019-03-20 03:12:25 +00:00
Andreas Gampe
08450264ae Sepolicy: Allow zygote to pick up dalvikcache artifacts
Allow the zygote to pick up integrity-checked boot classpath
artifacts from the dalvik cache.

Bug: 125474642
Test: m
Test: manual
Merged-In: I45d760c981c55a52bd0b22c79a9cba4868a09528
Change-Id: I45d760c981c55a52bd0b22c79a9cba4868a09528
2019-03-19 10:36:12 -07:00
Andreas Gampe
e72ec6bfd3 Sepolicy: Allow system_server_startup to load dalvikcache artifacts
Allow the startup domain to pick up integrity-checked artifacts
from the dalvik-cache. The corresponding framework code will
only load the system server classpath.

Bug: 128688902
Test: m
Test: manual
Merged-In: Ib37f8d7c39431e2792eeb4dac1cd732307519827
Change-Id: Ib37f8d7c39431e2792eeb4dac1cd732307519827
2019-03-19 10:36:03 -07:00
Roland Levillain
66f40a8b2d Allow otapreopt_chroot to use a flattened Runtime APEX package.
- Allow (again) `otapreopt` (running as `postinstall_dexopt`) to
  execute `dex2oat` from `/postinstall` -- this is for the case where
  it is located in a flattened Runtime APEX in
  `/postinstall/system/apex`.
- Allow `dex2oat` to read directories under `/postinstall`.
- Allow `otapreopt_chroot` to unmount flattened APEX packages under
  `/postinstall/system/apex` (which are bind-mounted in
  `/postinstall/apex`).

Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 127543974
Bug: 123684826
Bug: 113373927
Change-Id: Ie023ee5c64989ea071e1683f31073a70c93cac18
2019-03-19 14:44:22 +00:00
Xiao Ma
87b6d4018d Merge "Allow the netowrk stack to access its own data files." 2019-03-19 13:21:12 +00:00
Jeff Vander Stoep
60bb29fcdf crash_dump: suppress devpts denials
The following denial caused a presubmit failure:
06-15 15:16:24.176   956   956 I auditd  : type=1400 audit(0.0:4): avc:
denied { read write } for comm="crash_dump64" path="/dev/pts/3"
dev="devpts" ino=6 scontext=u:r:crash_dump:s0
tcontext=u:object_r:devpts:s0 tclass=chr_file permissive=0

Suppress these denials. They are not needed by crash_dump and are only
caused by the default behavior of sharing FDs across exec.

Test: build
Change-Id: I183f7a54e6b807fdf46b04d67dd4b819d4f0e507
2019-03-19 04:05:51 +00:00
Xiao Ma
c06f0f602a Allow the netowrk stack to access its own data files.
After moving IpMemoryStore service to network stack module(aosp/906907),
the following untracked SELinux denials are observed on boot.

W id.networkstack: type=1400 audit(0.0:63): avc: denied { write } for
name="com.android.networkstack" dev="sda13" ino=704810
scontext=u:r:network_stack:s0:c49,c260,c512,c768
tcontext=u:object_r:system_data_file:s0 tclass=dir permissive=0

Add radio_data_file type for network stack user configuration and
relevant permission to allow access to its data, as the network stack
is a privileged app.

Test: m -j passed
Change-Id: I6eab528714df6a17aae0cb546dcc3ad4bb21deea
2019-03-19 11:42:11 +09:00
Alex Salo
a1ce292dbb Add selinux setting for attention
Bug: 126472144
Test: adb shell dumpsys attention
Change-Id: Ie421b719c8fc0414ee664055aa5d007c081edf17
2019-03-18 21:00:35 +00:00
Andreas Gampe
3c581e2064 Sepolicy: Allow otapreopt_chroot to find linker
The linker is behind a symlink. Allow to read and follow.

Bug: 128840749
Test: m
Test: manual a/b ota
Test: DexoptOtaTests
Change-Id: I15bd76e517ab3cebf13ebd42ff6e5dae42364c83
2019-03-18 10:55:32 -07:00
Andreas Gampe
d6fdcefaa8 Sepolicy: Move otapreopt_chroot to private
Move complete domain to private/. Move referencing parts in domain
and kernel to private.

Bug: 128840749
Test: m
Change-Id: I5572c3b04e41141c8f4db62b1361e2b392a5e2da
2019-03-18 10:54:42 -07:00
Treehugger Robot
ac9cd71fed Merge "Sepolicy: Fix comment on apexd:fd use" 2019-03-16 23:50:32 +00:00
Andreas Gampe
15e02450f1 Sepolicy: Fix comment on apexd:fd use
The file descriptors for /dev/zero are no longer open. However,
a descriptor to the shell is still inherited. Update the comment.

Bug: 126787589
Test: m
Test: manual
Change-Id: I0d4518d2ba771622ea969bbf02827db45788bc09
2019-03-15 11:26:05 -07:00
Florian Mayer
4db9df1a92 Merge "Allow traced to lazily start heapprofd." 2019-03-15 18:17:52 +00: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
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
Treehugger Robot
3637592a2d Merge "add label for /proc/sys/fs/verity/require_signatures" 2019-03-14 23:10:39 +00:00
Florian Mayer
a769f0fd43 Allow traced to lazily start heapprofd.
Bug: 126724929

Change-Id: I15f0ae10d5e45fc65850635230e377b6f77ad4d7
2019-03-14 20:42:29 +00:00
Andreas Gampe
59d5d90da8 Sepolicy: Allow everyone to search keyrings
Allow everyone to look for keys in the fsverity keyring. This is
required to access fsverity-protected files, at all.

This set of permissions is analogous to allowances for the fscrypt
keyring and keys.

Bug: 125474642
Test: m
Test: manual
Change-Id: I6e8c13272cdd76d9940d950e9dabecdb210691b1
2019-03-14 13:21:07 -07:00
Xiaoyong Zhou
a711d375ab add label for /proc/sys/fs/verity/require_signatures
This CL add new label for files created by fsverity.

Bug: 112038861
Test: ls -Z /proc/sys/fs/verity/require_signatures.
Change-Id: I8e49ad9a43282bc608449eb0db4ea78617c4ee9a
2019-03-14 12:44:31 -07:00
Treehugger Robot
a907d15ba1 Merge "Sepolicy: Fix APEX boot integrity" 2019-03-14 17:20:18 +00: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
bf2ee36db9 Merge "No longer label patchoat binaries in file_contexts." 2019-03-14 13:19:12 +00:00
Martijn Coenen
1f1c4c3fa5 Allow apexd to talk to vold.
To query filesystem checkpointing state.

Bug: 126740531
Test: no denials
Change-Id: I28a68b9899d7cb42d7e557fb904a2bf8fa4ecf66
2019-03-14 07:23:40 +00:00
Jeff Vander Stoep
1795d0bcfd crash_dump: dontaudit devices passed by exec()
avc: denied { read } for comm="crash_dump64" name="v4l-touch22"
dev="tmpfs" ino=18821 scontext=u:r:crash_dump:s0
tcontext=u:object_r:input_device:s0 tclass=chr_file

Test: build
Change-Id: Iac66b77ad255c950b21fd267c88fdbc382be2877
2019-03-13 20:50:25 -07:00
Suren Baghdasaryan
96cc32b0eb Merge "sepolicy: Remove unnecessary psi procfs rules" 2019-03-14 01:42:21 +00:00
Tri Vo
d6c5ff5f72 Allow global read access to /sys/kernel/mm/transparent_hugepage/
If kernel is built with CONFIG_TRANSPARENT_HUGEPAGE optimization,
libjemalloc5 will attempt to read
/sys/kernel/mm/transparent_hugepage/enabled and hit an SELinux denial.

Various denials similiar to the following are seen on cuttlefish:
avc: denied { open } for comm="surfaceflinger"
path="/sys/kernel/mm/transparent_hugepage/enabled" dev="sysfs" ino=776
scontext=u:r:surfaceflinger:s0 tcontext=u:object_r:sysfs:s0 tclass=file
permissive=1

Bug: 28053261
Test: boot cuttlefish without above denials.
Change-Id: Ic33f12d31aacc42d662a8c5c297fbb5f84d4deea
2019-03-13 23:47:25 +00:00
Suren Baghdasaryan
f4b7e01c1f sepolicy: Remove unnecessary psi procfs rules
Remove unnecessary rules which will be added from 28.0.cil automatically
by the build process.

Bug: 111308141
Test: builds

Change-Id: I02064785cac1ed6d8b4e462604a1b8db10c1a25a
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-13 20:53:55 +00:00
Suren Baghdasaryan
9902c67cfa Merge "sepolicy: Allow lmkd access to psi procfs nodes" 2019-03-13 20:51:31 +00:00
Andreas Gampe
6cd179f992 Sepolicy: Fix APEX boot integrity
Update copy-paste comment header. Fix file access to the right
type.

Follow-up to commit 1845b406fc.

Bug 125474642
Test: m
Test: boot

Change-Id: I33bfef51c78ca581063c0f950e1837546d013050
2019-03-13 13:38:31 -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
Treehugger Robot
98de091a4f Merge "Allow traced_probes to access power rail data." 2019-03-13 19:47:54 +00:00
Andreas Gampe
01147a70f4 Merge "Sepolicy: ART APEX boot integrity" 2019-03-13 18:19:03 +00:00
Treehugger Robot
e5667b30d5 Merge "Allow mini-keyctl to setattr for restricting keyring" 2019-03-13 17:30:22 +00:00
Ben Murdoch
f948ea58c7 Allow traced_probes to access power rail data.
Allows power rail data to be logged in the trace, allowing
high fidelity attribution of battery power use.

Matching feature CL: aosp/891533

SELinux denials that lead to this:
avc: denied { call } for scontext=u:r:traced_probes:s0 tcontext=u:r:hal_power_stats_default:s0 tclass=binder

Test: checked data in a trace
Bug: 122584217

Change-Id: I7e0f4e825be3f54bc78d91da1cb85c2f61465a44
2019-03-13 17:11:31 +00:00
Suren Baghdasaryan
53065d6aa8 sepolicy: Allow lmkd access to psi procfs nodes
Lmkd needs read access to /proc/pressure/memory, proc/pressure/cpu
and proc/pressure/io nodes to read current psi levels.
Lmkd needs write access to /proc/pressure/memory to set psi monitor
triggers.

Bug: 111308141
Test: modified lmkd to use PSI and tested using lmkd_unit_test

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Merged-In: I9efd60c7fbb89cc08938fa5119b13d794813b52b
Change-Id: I9efd60c7fbb89cc08938fa5119b13d794813b52b
2019-03-13 10:00:37 -07:00
Treehugger Robot
20fe557ec5 Merge "Sepolicy: Give sys_admin for relabel" 2019-03-13 15:06:54 +00: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
Tim Murray
a8d538f66d system_server: allow writes to /proc/pid/*
Test: system_server can write to /proc/<pid>/*
bug 119988524

Change-Id: I312b8022cd143907bcbfc8152691e2053e1e816d
2019-03-12 16:20:11 -07:00
Victor Hsieh
f7bf277313 Allow mini-keyctl to setattr for restricting keyring
This fix the current denial during boot.

Test: no more avd denial in dmesg
Bug: 112038861
Change-Id: Ie3c3788ff011bcee189b83cfccba6137580f804d
2019-03-12 13:46:53 -07:00
Andreas Gampe
7263cb4603 Sepolicy: Give sys_admin for relabel
This requirement slipped through.

Bug: 125474642
Test: m
Test: manual
Change-Id: I8b31bda519632a549574d3057bc49a158e796e2e
2019-03-12 10:49:16 -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
Tri Vo
131fa73add Restrict access to suspend control
Test: m selinux_policy
Change-Id: Ieccfd2aa059da065ace4f2db1b9634c52dd2cb24
2019-03-07 18:31:58 +00: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
Luke Huang
a116e1afe5 Merge "Add sepolicy for resolver service" 2019-03-07 05:35:12 +00:00
Treehugger Robot
c67985a067 Merge "Sepolicy: Allow crash_dump to ptrace apexd in userdebug" 2019-03-06 22:12:11 +00:00
Andreas Gampe
efece54e06 Sepolicy: Allow crash_dump to ptrace apexd in userdebug
In userdebug, for better diagnostics, allow crash_dump to "connect
to" apexd.

Considering apexd is quite powerful, user devices remain restricted.

Bug: 118771487
Test: m
Change-Id: Id42bd2ad7505cd5578138bfccd8840acba9a334d
2019-03-05 09:59:50 -08:00
Luke Huang
524f25ebb0 Add sepolicy for resolver service
Bug: 126141549
Test: built, flashed, booted
Change-Id: I34260e1e5cc238fbe92574f928252680c1e6b417
2019-03-05 15:49:33 +00:00
Joel Galenson
19c90604ad Fix denials during bugreport.
Bug: 124465994
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t
android.security.cts.SELinuxHostTest#testNoBugreportDenials
Test: Build all policies.

Change-Id: Ic20b1e0fd3a8bdea408d66f33351b1f5ebc5d84c
(cherry picked from commit f24854f8e8)
2019-03-04 14:01:12 -08:00
Treehugger Robot
e146c216cc Merge "Fix typo." 2019-03-04 21:52:58 +00:00
Jayant Chowdhary
bfb9f7caa5 Merge changes from topic "fwk-cameraservice-sepolicy"
* changes:
  Abstract use of cameraserver behind an attribute
  Add selinux rules for HIDL ICameraServer.
2019-03-04 19:43:07 +00:00
Florian Mayer
3b601a5e59 Fix typo.
Change-Id: I03d31ea03d7a1e3e230a97ac1f0ead82d5962f34
2019-03-04 16:43:37 +00:00
Florian Mayer
315d8bfa15 Allow profilable domains to use heapprofd fd and tmpfs.
This is needed to allow to communicate over shared memory.

Bug: 126724929

Change-Id: I73e69ae3679cd50124ab48121e259fd164176ed3
2019-03-04 12:05:35 +00:00
Nicolas Geoffray
d4536b0814 Merge "Allow ota_preopt to read runtime properties." 2019-03-04 10:15:28 +00: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
Jayant Chowdhary
fe0af517db Abstract use of cameraserver behind an attribute
Bug: 124128212

Test: Builds

Change-Id: Ia0df765e15a72b3bdd1cba07ff1cf16128da5ae2
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2019-03-01 14:02:59 -08:00
Jayant Chowdhary
ca41deb378 Add selinux rules for HIDL ICameraServer.
Bug: 110364143

Test: lshal->android.frameworks.cameraservice.service@2.0::ICameraService/default
      is registered.

Merged-In: I689ca5a570c169581b2bfb9d117fcdafced0a7e0
Change-Id: I689ca5a570c169581b2bfb9d117fcdafced0a7e0
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit 039d4151da)
2019-03-01 14:01:07 -08:00
Treehugger Robot
f669b1393d Merge "Update fence event path for kernel 4.10+" 2019-03-01 20:56:05 +00:00
Suren Baghdasaryan
e3f15e2abc Merge "sepolicy for vendor cgroups.json and task_profiles.json files" 2019-03-01 18:01:39 +00:00
Jesse Hall
17b29bd523 Update fence event path for kernel 4.10+
The sysfs path for controlling dma fence events changed yet again in
Linux 4.10, see kernel commit f54d1867005c3.

Test: adb shell atrace --list_categories | grep sync
Change-Id: Id6332f794ee4e350c936e1e777e9d94fc7cd6d11
2019-03-01 09:55:11 -08:00
Sudheer Shanka
45d73adc62 Merge "Remove priv_app SELinux denial tracking." 2019-03-01 17:01:06 +00:00
Nicolas Geoffray
400147579a Allow ota_preopt to read runtime properties.
Test: m
Bug: 126646365
Change-Id: I20770fd73b8ccc876c3d9042074a754d89e324a2
2019-03-01 10:05:35 +00:00
Andreas Gampe
67e14adba6 Sepolicy: Add runtime APEX postinstall fsverity permissions
Add rights to check and enable fsverity data.

Bug: 125474642
Test: m
Change-Id: I35ce4d6ac3db5b00d35860033a5751de26acf17c
2019-02-28 16:51:12 -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
Sudheer Shanka
a32080bcc2 Remove priv_app SELinux denial tracking.
The underlying issue has been fixed, so this
SELinux denial shouldn't occur anymore.

Bug: 118185801
Test: manual
Change-Id: I5656e341bcb7b554bcd29e00315648eb75ec0a3d
2019-02-28 14:15:47 -08:00
David Anderson
753225ce9c Merge "Allow system_server and shell to start gsid on-demand." 2019-02-28 22:08:10 +00:00
Tri Vo
e8cb09db42 Merge "ashmem: expand app access" 2019-02-28 22:00:50 +00:00
Tri Vo
9fbc87c89f ashmem: expand app access
We are only interested in removing "open" access from apps, so leave
apps with (rw_file_perms - open) permissions to /dev/ashmem

Bug: 126627315
Test: emulator boots without denials to /dev/ashmem
Change-Id: I7f03fad5e4e82aebd1b6272e4956b16f86043637
2019-02-28 10:47:35 -08:00
Andreas Gampe
4c2d06c458 Sepolicy: Add base runtime APEX postinstall policies
Add art_apex_postinstall domain that is allowed to move
precreated AoT artifacts from /data/ota.

Bug: 125474642
Test: m
Change-Id: Id674e202737155a4ee31187f096d1dd655001fdd
2019-02-28 09:24:17 -08:00
David Anderson
64bbf05150 Allow system_server and shell to start gsid on-demand.
gsid is started lazily to reduce memory pressure. It can be started
either via gsi_tool (invoked by adb shell), or by DynamicAndroidService
via system_server.

Bug: 126622385
Test: no denials running "gsi_tool status"
Change-Id: I90a5f3f28fe4f294fb60e7c87a62e76716fbd5c0
2019-02-28 07:54:25 -08:00
Andreas Gampe
57346a0566 Sepolicy: Add runtime APEX preinstall fsverity permissions
Add rights to create and install fsverity data.

Bug: 125474642
Test: m
Change-Id: I752c40c7b396b2da082cb17641702a2c5c11b9c3
2019-02-28 05:12:56 -08:00
Andreas Gampe
ae127d8340 Sepolicy: Add base runtime APEX preinstall policies
Add art_apex_preinstall domain that is allowed to create AoT
artifacts in /data/ota.

Bug: 125474642
Test: m
Change-Id: Ia091d8df34c4be4f84c2052d3c333a0e36bcb036
2019-02-28 05:12:56 -08:00
Kevin Rocard
83f65ebbb2 Allow audioserver to access the package manager
This can not be done from the system server as there are native API that
do not go through it (aaudio, opensles).

Test: adb shell dumpsys media.audio_policy | grep -i 'Package manager'
Bug: 111453086
Signed-off-by: Kevin Rocard <krocard@google.com>
Change-Id: I0a4021f76b5937c6191859892fefaaf47b77967f
2019-02-28 01:50:22 +00:00
Tri Vo
7eb9143e46 Merge "Neverallow app open access to /dev/ashmem" 2019-02-28 00:02:14 +00:00
Tri Vo
c67a1ff8d9 Merge "Decouple system_suspend from hal attributes." 2019-02-27 21:25:27 +00:00
Tri Vo
8b12ff5f21 Neverallow app open access to /dev/ashmem
Apps are no longer allowed open access to /dev/ashmem, unless they
target API level < Q.

Bug: 113362644
Test: device boots, Chrome, instant apps work
Change-Id: I1cff08f26159fbf48a42afa7cfa08eafa1936f42
2019-02-27 21:17:25 +00:00
Alan Stokes
1c8b376f81 Merge "Audit execution of app_data_file by untrusted_app." 2019-02-27 21:07:19 +00:00
Alan Stokes
931623e5b9 Audit execution of app_data_file by untrusted_app.
Test: Builds
Bug: 126536482
Change-Id: I9fe7623353cbb980db3853a8979f03ba033c7f45
2019-02-27 18:07:09 +00:00
Andreas Gampe
025cab88ab Merge changes I6a76eba4,Iff1ecabc
* changes:
  Sepolicy: Move dex2oat and postinstall_dexopt to private
  Sepolicy: Move dac_override checks to private
2019-02-27 16:56:52 +00:00
Nikita Ioffe
53c0743d79 Merge "Allow apexd to reboot device" 2019-02-27 08:49:32 +00: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
Andreas Gampe
6d5baca452 Sepolicy: Move dex2oat and postinstall_dexopt to private
In preparation for additions that should be private-only, move the
types to private. Both have to be moved as they are dependent.

Bug: 125474642
Test: m
Change-Id: I6a76eba41b036bc6fb83588adbe9d63767d3e159
2019-02-26 13:13:45 -08:00
Andreas Gampe
f77bcdcf57 Sepolicy: Move dac_override checks to private
In preparation for moving other components to private, so that
private-only components can stay private.

Bug: 125474642
Test: m
Change-Id: Iff1ecabc4f45051d06e062b3338a117c09b39ff9
2019-02-26 13:12:05 -08:00
Nick Kralevich
68e27caeb6 allow shell rs_exec:file rx_file_perms
Hostside tests depend on being able to execute /system/bin/bcc. Allow
it.

From bug:

In the NDK:

  $ ./checkbuild.py
  $ virtualenv -p ../out/bootstrap/bin/python3 env
  $ source env/bin/activate
  $ ./run_tests.py --filter rs-cpp-basic
  FAIL rs-cpp-basic.rstest-compute [armeabi-v7a-19]: android-28 marlin HT67L0200247 QPP1.190205.017
  New RS 0xee70f000
  Segmentation fault

  FAIL rs-cpp-basic.rstest-compute [arm64-v8a-21]: android-28 marlin HT67L0200247 QPP1.190205.017
  New RS 0x7a91e13000
  Segmentation fault

  02-23 23:00:45.635  9516  9518 V RenderScript: Successfully loaded runtime: libRSDriver_adreno.so
  02-23 23:00:45.650  9518  9518 W rstest-compute: type=1400 audit(0.0:15): avc: denied { read } for name="bcc" dev="dm-0" ino=390 scontext=u:r:shell:s0 tcontext=u:object_r:rs_exec:s0 tclass=file permissive=0
  02-23 23:00:45.651  9516  9518 E RenderScript: Cannot open file '/system/bin/bcc' to compute checksum
  02-23 23:00:45.652  9516  9516 E rsC++   : Internal error: Object id 0.

Test: compiles
Fixes: 126388046
Change-Id: I28e591d660c4ba9a33135e940d298d35474ef0b6
2019-02-26 13:09:28 -08:00
Bo Hu
67bce94bd4 Merge "adbd: do not audit vsock_socket create" 2019-02-26 17:10:11 +00:00
Nikita Ioffe
cfe7f7b2ab Allow apexd to reboot device
In some scenarios (native watchdog finding a regression, apexd failing
to mount apexes), a rollback of apexd will be triggered which requires
device reboot.

Bug: 123622800
Test: manually triggered apexd rollback and verified it reboots phone
Change-Id: I4c5d785a69dd56a63348c75c1897601749db9bc5
2019-02-26 13:29:22 +00:00