Commit graph

4621 commits

Author SHA1 Message Date
Hung-ying Tyan
dea144c1e5 Sepolicy: add dynamic_system_prop
and allow shell and system_app (Settings) to set it to enable Dynamic System Update.
Also allow priv_app (user of the API) to read it.

Bug: 119647479
Bug: 129060539
Test: run the following command on crosshatch-user:
      adb shell setprop persist.sys.fflag.override.settings_dynamic_system 1

Change-Id: I24a5382649c64d36fd05a59bc87faca87e6f0eb8
Merged-In: I24a5382649c64d36fd05a59bc87faca87e6f0eb8
2019-04-30 05:36:19 +00:00
TreeHugger Robot
5f30c238ec Merge "Allow signals to power/thermal HAL from dumpstate" into qt-dev 2019-04-24 20:18:26 +00:00
TreeHugger Robot
58a9b10bb2 Merge "Add new surfaceflinger ro props" into qt-dev 2019-04-24 19:55:07 +00:00
TreeHugger Robot
e28daa6172 Merge "Fix denial of /debug_ramdisk/adb_debug.prop" into qt-dev 2019-04-24 02:47:19 +00:00
Bowgo Tsai
62fb037476 Fix denial of /debug_ramdisk/adb_debug.prop
This CL fix the following SELinux denial, by allowing init to getatter
for tmpfs:file.

audit: type=1400 audit(15464939.926:4): avc:  denied  { getattr } for
pid=1 comm="init" path="/debug_ramdisk/adb_debug.prop" dev="tmpfs"
ino=25480 scontext=u:r:init:s0 tcontext=u:object_r:tmpfs:s0 tclass=file
permissive=0

Note: the current sepolicy (before this change) has the following rules
for tmpfs:file:

$ sesearch --allow -t tmpfs -c file $OUT/vendor/etc/selinux/precompiled_sepolicy
  allow dex2oat tmpfs:file { read map getattr };
  allow init tmpfs:file { read unlink open setattr };
  allow postinstall_dexopt tmpfs:file read;
  allow profman tmpfs:file { read map };
  allow vendor_init tmpfs:file { read map open setattr };

Bug: 126493225
Test: boot a device with debug ramdisk, checks related files are loaded
Change-Id: I6dd356de989d597828a6e04846b793d611c477fa
Merged-In: I6dd356de989d597828a6e04846b793d611c477fa
(cherry picked from commit 5a234338c1)
2019-04-23 23:13:43 +00:00
Wei Wang
76d93f0ce8 Allow signals to power/thermal HAL from dumpstate
Bug: 129711808
Test: Take BR
Change-Id: Ibcb03698a6e2966f4913ddb6e674502bce4df235
2019-04-23 14:21:03 -07:00
Ady Abraham
ff9d4bdd63 Add new surfaceflinger ro props
add the new ro properties added to surfaceflinger:
ro.surface_flinger.set_idle_timer_ms
ro.surface_flinger.use_smart_90_for_video

Bug: 131054357
Test: Boot with SELinux enforcing
Change-Id: I887b318a95db200280344a11fcf7deaadafdeca9
2019-04-23 14:17:32 -07:00
Tri Vo
1bbbf810c9 Treble-ize sepolicy for fwk HIDL services.
Bug: 130734497
Test: m selinux_policy; system_server and statds still have permission
to export HIDL services.
Change-Id: I6e87b236bdbdd939fca51fb7255e97635118ed2d
Merged-In: I6e87b236bdbdd939fca51fb7255e97635118ed2d
(cherry picked from commit 1d34b8cc31)
2019-04-22 17:07:06 -07:00
Chong Zhang
785521e211 add mediaswcodec to watchdog and dumpstate
bug: 130887807
test: adb bugreport and check mediaswcodec stack is there
Change-Id: I4a37e4e06c4905f435e96d8b1497e3617e688478
(cherry-picked from https://android-review.googlesource.com/c/platform/system/sepolicy/+/947830)
2019-04-19 12:16:40 -07:00
TreeHugger Robot
f9085929fb Merge "Allow bootstrap bionic only to init, ueventd, and apexd" into qt-dev 2019-04-15 16:39:14 +00:00
Joel Galenson
99149c9fbf Fix denial during bugreport.
Bug: 116711254
Test: Build.
Change-Id: Iafad9228a171796ce7ab18d60697eea396be4efa
Merged-In: I060b0d929a9d147f6327432844106d8270222d18
2019-04-11 09:41:50 -07:00
Jiyong Park
972d4b6473 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
Merged-In: Id7bba2e8ed1c9faf6aa85dbbdd89add04826b160
Change-Id: Id7bba2e8ed1c9faf6aa85dbbdd89add04826b160
(cherry picked from commit a0f998e6de)
2019-04-11 13:04:19 +09:00
Benjamin Schwartz
b3ecb4e5b9 Allow signals to hal_power_stats_server from dumpstate
This is needed for bugreport to include ANR trace for the process.

Bug: 128878895
Test: adb bugreport
Change-Id: I92e6952b03ffb047e9fb75b0e44024f2623debb3
2019-04-09 10:25:58 -07:00
Roshan Pius
73449cee1a Merge "wifi: Add a new property to indicate active wifi iface" am: 849ac8020d am: 09b3e95f62
am: 2a65fd6fd5

Change-Id: I72cb4f33460d38b5c3b249a47d0cf0dec3e8ab6e
2019-04-03 10:48:37 -07:00
Treehugger Robot
849ac8020d Merge "wifi: Add a new property to indicate active wifi iface" 2019-04-03 16:51:55 +00:00
Jiyong Park
401b639533 Remove apex_key_file am: cff95d7b5f am: 6c36a99417
am: c035d085ec

Change-Id: I25f855da622f2fc754b5b2ad38c58dfc2e6351d3
2019-04-03 03:29:11 -07:00
Przemyslaw Szczepaniak
8c82a41271 Merge "NNAPI property to disable extensions use on GSI/AOSP product partition." am: d385346ada am: b97cabd363
am: 4431bd1422

Change-Id: Icd04af7d194b9d02e826eee774757e1cdfc62e46
2019-04-03 03:01:40 -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
Przemyslaw Szczepaniak
d385346ada Merge "NNAPI property to disable extensions use on GSI/AOSP product partition." 2019-04-03 08:51:53 +00:00
Jeff Vander Stoep
3d23317c01 Merge "Allow execmod for apps with targetSdkVersion=26-28" am: 61f28b33a4 am: 7bc1740052
am: ceeee0e4cf

Change-Id: I1476980b7652130dc022080e791a5999f45ebf1e
2019-04-02 20:52:23 -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
Roshan Pius
d8790b66e1 wifi: Add a new property to indicate active wifi iface
Denial:
libc    : Unable to set property "wifi.active_interface" to "wlan0":
error code: 0x18

Bug: 129506593
Test: Verified that the denial is no longer seen in the logs
Change-Id: Ia345f5df1446e7ba3a44d6e8299bdc1f5f6ad9c8
2019-04-02 11:47:23 -07:00
Xiao Ma
7703c2726c Merge "revert ipmemorystore selinux policy." am: f99aa3cb66 am: a2d7ab7f4b
am: ddabaebdec

Change-Id: Iaad8edaaa6a31a3fb23e57555fc4c5e1a4eaa332
2019-04-01 21:19:40 -07:00
Xiao Ma
f99aa3cb66 Merge "revert ipmemorystore selinux policy." 2019-04-02 03:56:42 +00:00
Jaegeuk Kim
b9ac23f198 Merge "sepolicy: allow init to tune f2fs" am: 6273b696eb am: a3602ee5ec
am: f88544580f

Change-Id: I88e76f29fb45e42e1f8d51860a30fdde9a277939
2019-04-01 09:34:42 -07:00
Treehugger Robot
6273b696eb Merge "sepolicy: allow init to tune f2fs" 2019-04-01 16:10:28 +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
Dan Harms
51d9f6318c Merge " Allow radio server to client binder callback" am: aed7273584 am: 827f3ac470
am: a07b0c490f

Change-Id: I2824e96269339792c673ce2699cde53bebf4e7ec
2019-03-29 21:43:12 -07:00
Treehugger Robot
aed7273584 Merge " Allow radio server to client binder callback" 2019-03-30 04:28:09 +00:00
Peiyong Lin
51605b2e9b [sepolicy] Add sysprop for SurfaceFlinger GPU protected contents. am: d50d36242c am: 5ff5900d16
am: 3c1bc0328a

Change-Id: I2bdd4e946a2aea0bea563a6a6ae034770c790445
2019-03-29 20:50:45 -07:00
Dan Harms
c3b573598b Allow radio server to client binder callback
Test: Built, flashed, test radio
Change-Id: Idb6f50386508119694afc54d52eb32df381df4b7
2019-03-29 15:22:16 -07:00
Jaegeuk Kim
4439b5785e sepolicy: allow init to tune f2fs
This allows init to tune some f2fs knobs like cp_interval.

Bug: 127511432
Change-Id: I9353444578cb47bc7965cd7b068954a8270c5391
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2019-03-29 22:15:08 +00:00
Peiyong Lin
d50d36242c [sepolicy] Add sysprop for SurfaceFlinger GPU protected contents.
Not every device can support GPU protected contents, add a sysprop to allow
configuration.

BUG: 35315015
Test: N/A
Change-Id: I59f1b3ea81db742bc4d0b5a22e82de7385a726b7
2019-03-29 14:12:51 -07:00
Tim Murray
af3639d08a sepolicy: Grant system_server and init access to /proc/pressure/memory am: 251591fa04 am: efd9d3fdb1
am: 50cd647f85

Change-Id: Iab4b3442c6e34595e660a8a4bbd01700eaedcec3
2019-03-29 13:37:17 -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
bb9d64da64 Merge "super_block_device -> super_block_device_type" am: 93b81f30ae am: f0e9c939cc
am: 150f84e06c

Change-Id: Iaf25b3ca37135972e0552996b36bc709bb7defb0
2019-03-28 14:03:12 -07: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
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
7145b25226 Merge "Relabel /data/system/packages.list to new type." 2019-03-28 17:36:36 +00:00
YH_Lin
021c29b0ac Merge "sepolicy: add sepolicy rules for vold to write sysfs gc_urgent" am: a2186d08ca am: d155e2c768
am: 8dd0afad0d

Change-Id: Ie47df919a7727c3cd58d430fe08a48daf1fe5ca1
2019-03-28 07:36:43 -07:00
Treehugger Robot
a2186d08ca Merge "sepolicy: add sepolicy rules for vold to write sysfs gc_urgent" 2019-03-28 14:19:20 +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
ebce1b0546 Add sepolicy for installing GSIs to external storage. am: 6557d87b0f am: 9ca965a943
am: d25ee0ab07

Change-Id: Ibfac4341dad1571ba10100a4bb4e15314f1006cb
2019-03-28 03:22:13 -07: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
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
Nick Kralevich
efb3b8bcfd Merge "Don't audit audit_access denials to /dev/binder" am: f3e8dce5d4 am: 83484d2346
am: d644476185

Change-Id: I2a6bd8311b587952e42a6011e8813f9bb1826ff8
2019-03-26 14:45:17 -07:00
Yifan Hong
85c7c803f1 Merge "Add super_block_device_type" am: b9be03d63a am: 9d8a33b32b
am: b1a5384b71

Change-Id: I935a288ed4f9f872ed78c9b15dc32496681a73a2
2019-03-26 14:22:33 -07:00