Commit Graph

3424 Commits

Author SHA1 Message Date
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
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
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