Commit graph

554 commits

Author SHA1 Message Date
Nick Kralevich
e80b3ea8bc Merge "Add TODOs" am: 3db3b1148b
am: a0d0c96fc0

Change-Id: I54c5fb7ae2079cc3b1c73249d79548487948ffc1
2019-05-02 12:03:45 -07:00
Nick Kralevich
44b0efb332 Add TODOs
Bug: 131761776
Test: compiles
Change-Id: Iba3ad475ce25a1ece96717ceecb7c4df8e358d48
2019-05-02 08:29:21 -07:00
Wei Wang
d2aa8da5de Merge "Allow psi monitor users to setched kernel threads" am: 1415c2da7d
am: b8aa92f212

Change-Id: Ifd4f3a350c275da0f26b120cdee287f104e51f6a
2019-05-02 08:12:00 -07:00
TreeHugger Robot
6f1800f6df Merge "Allow psi monitor users to setched kernel threads" into qt-dev 2019-05-02 14:48:56 +00:00
Luke Huang
26f84c68a6 Clean sepolicy of unused netd_socket
Bug: 65862741
Test: built, flashed, booted
Change-Id: Ie6a5e7d8bb501fb6144c9fe00756301b90ab5210
2019-05-02 08:08:20 +00:00
Wei Wang
e95d8e9550 Allow psi monitor users to setched kernel threads
psi monitor sched_setscheduler(kworker->task, SCHED_FIFO, &param) was added into pa/1282597

Bug: 131252752
Bug: 129476847
Test: build
Change-Id: I69fdd90e4a39da8d33b417efc7ea7a0da9d9290b
2019-05-01 10:23:02 -07:00
Wei Wang
a3d6302c57 Allow psi monitor users to setched kernel threads
psi monitor sched_setscheduler(kworker->task, SCHED_FIFO, &param) was added into pa/1282597

Bug: 131252752
Bug: 129476847
Test: build
Change-Id: I69fdd90e4a39da8d33b417efc7ea7a0da9d9290b
2019-05-01 10:18:48 -07:00
Tri Vo
0b0f1cf708 Merge "Treble-ize sepolicy for fwk HIDL services." into qt-dev 2019-04-23 22:10:50 +00:00
TreeHugger Robot
847149180c Merge "Move pf_key socket creation permission to netd" into qt-dev 2019-04-23 21:57:09 +00:00
Tri Vo
1079e6c4a5 Merge "Treble-ize sepolicy for fwk HIDL services." am: 6cf01b3ef2
am: 48c8f21b37

Change-Id: Iee8b7b999a4ca887361e2923136ac9cc9e8a06ca
2019-04-22 17:28:57 -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
Tri Vo
6cf01b3ef2 Merge "Treble-ize sepolicy for fwk HIDL services." 2019-04-23 00:05:06 +00:00
Tri Vo
1d34b8cc31 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
2019-04-22 12:47:53 -07:00
Chong Zhang
45f5738b91 Merge "add mediaswcodec to watchdog and dumpstate" am: 40a71c6f7b
am: 851681366e

Change-Id: I6236774d935a59648ecb0c039df8c15e6991e9ed
2019-04-19 18:14:17 -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
Chong Zhang
ad3621a7b7 add mediaswcodec to watchdog and dumpstate
bug: 130887807
test: adb bugreport and check mediaswcodec stack is there
Change-Id: I4a37e4e06c4905f435e96d8b1497e3617e688478
2019-04-19 12:13:33 -07:00
Chong Zhang
e024c222f5 Merge "Allow system_server to schedule mediaswcodec" am: 6e4d217991
am: 24a7570815

Change-Id: Ia103b93ae69656c76eb7da7b309c842641ed7ed6
2019-04-17 14:47:25 -07:00
Chong Zhang
6fd8d82f31 Allow system_server to schedule mediaswcodec
bug: 130669553
Change-Id: I49d4ef473181d2270d90a9350c5e05b8b7db76bb
(cherry-picked from https://android-review.googlesource.com/c/platform/system/sepolicy/+/946836)
2019-04-17 20:51:51 +00:00
Chong Zhang
042f844e54 Allow system_server to schedule mediaswcodec
bug: 130669553
Change-Id: I49d4ef473181d2270d90a9350c5e05b8b7db76bb
2019-04-17 09:51:51 -07:00
Chenbo Feng
3bf0e82198 Move pf_key socket creation permission to netd
Allow netd to trigger the kernel synchronize rcu with open and close
pf_key socket. This action was previously done by system_server but now
it need to be done by netd instead because there might be race issue
when netd is operating on a map that is cleaned up by system server.

Bug: 126620214
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: Id5ca86aa4610e37a2752709ed9cfd4536ea3bfaf
Merged-In: Id5ca86aa4610e37a2752709ed9cfd4536ea3bfaf
(Cherry picked from commit 8a5539b5f0)
2019-04-12 23:41:35 +00:00
Chenbo Feng
d7c74f9f7f Merge "Move pf_key socket creation permission to netd" am: 3cba24a81a
am: e2954cb101

Change-Id: I17fbef0cb1d7688c2d27c7d9096239ff6d61bb32
2019-04-12 16:39:56 -07:00
Chenbo Feng
8a5539b5f0 Move pf_key socket creation permission to netd
Allow netd to trigger the kernel synchronize rcu with open and close
pf_key socket. This action was previously done by system_server but now
it need to be done by netd instead because there might be race issue
when netd is operating on a map that is cleaned up by system server.

Bug: 126620214
Test: android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: Id5ca86aa4610e37a2752709ed9cfd4536ea3bfaf
2019-04-12 02:24:46 +00:00
Hector Dearman
323fefc9b9 Merge "Re-add sys_traced prop" am: bc67b7b1b4
am: d81efb87aa

Change-Id: I7bf6bea95273ac50b6f0dbe69bc7b6de63a6eefe
2019-04-08 12:00:38 -07: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
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
Florian Mayer
36b29c5e6f Merge "Relabel /data/system/packages.list to new type." am: 7145b25226 am: 1d0b6aed97
am: ba385e3116

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

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

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

Bug: 123186697

Change-Id: Ieabf313653deb5314872b63cd47dadd535af7b07
2019-03-28 10:27:43 +00:00
Joe Onorato
f039fde20f Merge "Allow incidentd to communicate with clients over pipes." am: d7148b99cb am: 33c67b19ea
am: ea553b2ed9

Change-Id: Iff93c427e5ee3305b7feae53bcd01cc75ef7956c
2019-03-24 15:58:22 -07: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
8ede7c92f4 Sepolicy: Allow everyone to search keyrings am: 59d5d90da8 am: 7cf9a365c4
am: 0193fb4d7f

Change-Id: Id356a0c04069f3cec2105e46f7252fd2c787e07d
2019-03-14 13:48:10 -07: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
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
Tim Murray
31c584db24 Merge "system_server: allow writes to /proc/pid/*" am: 62e8da9713 am: 17787a50e0
am: 279410d99b

Change-Id: Idff522fdd206b0e991eaccd473a150b01e24c71f
2019-03-12 23:30:37 -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
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
Luke Huang
325c9263ab Merge "Add sepolicy for resolver service" am: a116e1afe5 am: 551bfafd34
am: 5332340b5e

Change-Id: Iac635eaaae96a1d75fc398bf9a21bf8e40f94a73
2019-03-06 21:52: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
David Anderson
853811dc37 Merge "Allow system_server and shell to start gsid on-demand." am: 753225ce9c am: da4057e3a4
am: f1d803049a

Change-Id: Id02be74583bc9f500d318e9dcd7b7b4e96da0aec
2019-02-28 14:58:22 -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
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
Nick Chalko
1cf5e30f9b Merge "Add sysfs_extcon for /sys/class/extcon" am: cac127c8fd am: 31bd5722e2
am: 574b1a3655

Change-Id: Ia9cc7087bebfa4dddb9dcb669932166484919ec0
2019-02-25 15:29:52 -08:00
Nick Chalko
4ccc8568ec Add sysfs_extcon for /sys/class/extcon
Bug: 124364409
Change-Id: Idc33732454674bbdc7f4ff6eda173acc24e318b3
Test: cherry picked to pi-tv-dr-dev and tested on JBL Link bar
2019-02-21 17:16:34 +00:00
David Anderson
cf25f23612 Merge "Add sepolicy for gsid properties, and allow system_server to read them." am: 8bcd43a33e am: 879acc21ef
am: 1ef063b050

Change-Id: I5915d05386ace9d5f69231d996bccbaaf25dc8b2
2019-02-20 14:17:14 -08:00
David Anderson
8fe3c74654 Add sepolicy for gsid properties, and allow system_server to read them.
Bug: 123777418
Test: manual test
Change-Id: I9f8c721dfd074e638573d85cf1d8045a69c3854e
2019-02-19 21:08:09 +00: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
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
Jeff Sharkey
74ba35a8d0 Merge "Allow system watchdog to collect traces from vold." am: bdabddfe12 am: 41481caa7e
am: 5dc99104fe

Change-Id: Iabd688cdad508f17869aed8322f0ced5e09589e4
2019-02-06 12:35:31 -08:00
Jeff Sharkey
d101896ec8 Allow system watchdog to collect traces from vold.
We're investigating a bug where vold gets wedged, and we need to
collect ANR stack traces from it to debug further.

avc: denied { signal } for comm="watchdog" scontext=u:r:system_server:s0 tcontext=u:r:vold:s0 tclass=process permissive=0
avc: denied { ptrace } for scontext=u:r:crash_dump:s0 tcontext=u:r:vold:s0 tclass=process permissive=0

Bug: 122090837
Test: manual
Change-Id: I738e63717715189b9ae2317472f671e3563afaa9
2019-02-06 09:25:00 -07:00
markchien
74414efa95 [KA08] Allow system_server call tcp socket ioctl am: f6b59fe644 am: 816e62dace
am: a83aa1a3ab

Change-Id: I665414697ce20774665b2440b9e81219d4dae736
2019-02-06 00:30:16 -08:00
markchien
f6b59fe644 [KA08] Allow system_server call tcp socket ioctl
In order to offload application tcp socket’s keepalive
message, system server must know if application's socket
is idle with no data in send/receive queues. Allow
system_server to use ioctl on all tcp sockets.

Bug: 114151147
Test: -build, flash, boot
Change-Id: I3f5a0e06bc22f8a64ae6180db48df2a31106c511
2019-02-06 13:17:38 +09:00
Santos Cordon
b78a1f5e13 SEPolicy for Suspend Control interface.
Bug: 121210355
Test: manual
Change-Id: I9c46c72f0219309140ed2fb008ef57b4bca6ff2b
Merged-In: I9c46c72f0219309140ed2fb008ef57b4bca6ff2b
2019-02-05 18:03:32 +00:00
Santos Cordon
fd92fb93bc SEPolicy for Suspend Control interface.
Bug: 121210355
Test: manual
Change-Id: I9c46c72f0219309140ed2fb008ef57b4bca6ff2b
2019-02-05 11:40:04 +00:00
Mathieu Chartier
34b50ee563 Merge "Add device_config_runtime_native_boot_prop" am: 75b4c083fc am: 475b3ed674
am: dd8f1019fe

Change-Id: Idd2d9e43805e15ff07fcd0be9c5828484c22bbd1
2019-02-01 18:21:08 -08:00
Mathieu Chartier
0327d10599 Add device_config_runtime_native_boot_prop
Some runtime properties require reboots and should be in the
native_boot namespace instead of native.

Bug: 120794191
Bug: 123524494
Test: set a property and ensure it can be read in AndroidRuntime.cpp
Change-Id: I1d1e984dcba26dd04d34a7d30fc63e1b75a8a311
2019-02-01 13:46:34 -08:00
Dongwon Kang
b66168d221 Merge "SEPolicy updates for adding native flag namespace(media)." am: a0bea70f10 am: 034c811b6d
am: e5b51aab86

Change-Id: I45ab0a8bcedacf22bc60f43f0dd69de878df8795
2019-02-01 13:34:10 -08:00
Dongwon Kang
523c746859 SEPolicy updates for adding native flag namespace(media).
Test: add sepolicy, build, check GetServerConfigurableFlag function
Bug: 123658514
Change-Id: I798b0ef901068c53070e768305acd38118a7e886
2019-01-31 10:06:32 -08:00
Hung-ying Tyan
27d99eeed2 Sepolicy for dynamic_android_service am: e4350c1a64 am: 4633c2fdc0
am: dd41ec3053

Change-Id: I69048987035e7fc705d957f7e40299c970552a69
2019-01-30 18:41:02 -08:00
Hung-ying Tyan
e4350c1a64 Sepolicy for dynamic_android_service
Dynamic_android service is a proxy running in SystemServer to the
gsi_service daemon. It provides a set of SystemApi's to manage
installation of a new system image to the device while keeping the
original system image intact.

Bug: 122929007
Test: manual; see dynamic_android service start in logcat
Change-Id: Idb9b0475677dad13b7864ca0cf6041dcab04b4e3
2019-01-31 01:30:36 +00:00
Jeff Vander Stoep
c4bc7d04db Initial selinux policy support for memfd am: 9f5d0d90a3 am: 5314cb2a93
am: beb8e5d159

Change-Id: Ia03563336f924ea99af2763b2edc71c2be52b6d3
2019-01-30 11:51:10 -08:00
Jeff Vander Stoep
9f5d0d90a3 Initial selinux policy support for memfd
Move all app tmpfs types to appdomain_tmpfs. These are still protected
by mls categories and DAC. TODO clean up other app tmpfs types in a
separate change.

Treble-ize tmpfs passing between graphics composer HAL and
surfaceflinger.

Bug: 122854450
Test: boot Blueline with memfd enabled.
Change-Id: Ib98aaba062f10972af6ae80fb85b7a0f60a32eee
2019-01-30 19:11:49 +00:00
Mathieu Chartier
b4eeac082b Merge "Rename runtime -> runtime_native property namespace" am: 91b0ef13d8 am: a35beeb6f3
am: e888dfe164

Change-Id: I2be9aa92f6bf7e9384f6e762937847003088c284
2019-01-29 15:26:34 -08:00
Mathieu Chartier
669cef88a3 Rename runtime -> runtime_native property namespace
The convention for native properties is to use _native suffix.

Bug: 123524494
Bug: 120794191
Test: set a property and ensure it can be read in AndroidRuntime.cpp

Change-Id: I69feab9be78f24d812b8f953d3ec06a5d8d18f15
2019-01-29 10:20:36 -08:00
Mathieu Chartier
32aede6d43 Merge "Add runtime property permissions for experiments" am: 2c92514304 am: 01a1ca2d55
am: cc338e14da

Change-Id: I4093910bc1e8f3c4a5022fd1db834117cbf328f2
2019-01-29 00:48:55 -08:00
Mathieu Chartier
05ad04dd91 Add runtime property permissions for experiments
Bug: 120794191
Bug: 123524494
Test: set a property and ensure it can be read in AndroidRuntime.cpp

Change-Id: Ib37102f35e9987d3d9baff83c45571a5d632ad50
2019-01-28 12:39:23 -08:00
Victor Hsieh
312d6a989a Merge "Allow system_server to search su:key in debuggable build" am: 565cbe2140 am: 3b3843f048
am: eea1277ba7

Change-Id: I623b640c8788999b0ab2ed45cd59fb07f23d8580
2019-01-25 21:59:35 -08:00
Victor Hsieh
a8b2bc47ec Allow system_server to search su:key in debuggable build
Test: successful fs-verity setup with key loaded from shell
Bug: 112037636
Change-Id: Ide01d11f309008fffeafdedb517508db94472873
2019-01-25 12:59:29 -08:00
Ng Zhi An
52eb5982f5 Merge "Update sepolicy with new native boot flag for activity_manager" am: 055286fc94 am: d5315561bc
am: ad2235d039

Change-Id: I2d59357604c642d7943d075cb0bd923876263372
2019-01-24 14:27:23 -08:00
Chenbo Feng
6e6b8b5fa9 Merge "Allow system_server to write to bpf maps" am: b761636b9d am: ac0b2ee2fd
am: 096a2d3018

Change-Id: I2de8c56981abdc3795b03e6588cbc60a28db37c0
2019-01-24 11:58:10 -08:00
Ng Zhi An
c5bf4a3994 Update sepolicy with new native boot flag for activity_manager
Whitelist the persistent system properties that will be used as
flags in activity manager experiments.

Bug: 120794810
Test: m, flash, test getting flag value in ActivityManagerService.java
Change-Id: I90a10bc87d6db3a64347b62fd02e6f0b12ac9fa8
2019-01-24 11:07:17 -08:00
Chenbo Feng
3c3d52e460 Allow system_server to write to bpf maps
The bpf maps for per uid stats need to be regularly cleaned now to
optimize the memory usage and performance. It can only done by
system_server since it is the process that scrapes and read the stats.
So allow it to write to maps to clean the stats. This change also
allows the system server to create PF_KEY sockets since we need a
reliable way to force synchronize the rcu on devices with 4.9 kernel.

Test: CtsUsageStatsTestCases
Bug: 79171384
Change-Id: I6564a56a5906a958f7d8e1d290b85de3f6fa121d
2019-01-24 03:44:25 +00:00
Siarhei Vishniakou
522688e39c Merge "Permissions for input_native_boot flags" am: b1f34ddaf7 am: aee5061689
am: 6ef1644a97

Change-Id: I21f93af8044a142ce91db3882c5c74a2f514dca9
2019-01-23 15:31:23 -08:00
Siarhei Vishniakou
c0c9155589 Permissions for input_native_boot flags
For input experiments that are enabled at boot time, allow system_server
to read and write the device config flags.

Bug: 120794829
Test: presubmit
Change-Id: I0f075a7579c593d4e07c3e31be529e34554068a6
2019-01-22 16:18:47 -08:00
Hongyi Zhang
926f3dba20 Merge "Clean up server_configurable_flags test prop" am: d71144a922 am: 365d9f3c8c
am: 7a4610d779

Change-Id: I8ff8876aa9bd5fbb052e0b79fb0c78881d431890
2019-01-22 12:13:13 -08:00
Hongyi Zhang
f3db0085f0 Clean up server_configurable_flags test prop
Test: m -j & manually on device
Change-Id: I3f5ddeb26ddf1bf280ef5e7b3e62b4b892b83a3c
2019-01-22 01:42:36 +00:00
Martijn Coenen
e6da5cb024 Initial sepolicy for app_zygote. am: 1bbda7e662 am: fd4b0b29f9
am: e50dea816b

Change-Id: I6d16b8948f9c1b923f5b5395a52bc0d75ba89bc8
2019-01-21 00:37:52 -08:00
Martijn Coenen
1bbda7e662 Initial sepolicy for app_zygote.
The application zygote is a new sort of zygote process that is a
child of the regular zygote. Each application zygote is tied to the
application for which it's launched. Once it's started, it will
pre-load some of the code for that specific application, much like
the regular zygote does for framework code.

Once the application zygote is up and running, it can spawn
isolated service processes that run in the isolated_app domain. These
services can then benefit from already having the relevant
application code and data pre-loaded.

The policy is largely the same as the webview_zygote domain,
however there are a few crucial points where the policy is different.

1) The app_zygote runs under the UID of the application that spawned
   it.
2) During app_zygote launch, it will call a callback that is
   controlled by the application, that allows the application to
   pre-load code and data that it thinks is relevant.

Especially point 2 is imporant: it means that untrusted code can run
in the app_zygote context. This context is severely limited, and the
main concern is around the setgid/setuid capabilities. Those conerns
are mitigated by installing a seccomp filter that only allows
setgid/setuid to be called in a safe range.

Bug: 111434506
Test: app_zygote can start and fork children without denials.
Change-Id: I1cc49ee0042d41e5ac6eb81d8f8a10ba448d4832
2019-01-21 08:24:41 +00:00
Srinivas Paladugu
55dffae07f Merge "Allow system server to access zram sysfs" 2019-01-18 23:00:32 +00:00
William Hester
2367e8790b Merge "Add the testharness service to sepolicy rules" am: 1fefa6c0e8 am: a587f0d4d3
am: d10adc6f50

Change-Id: I9af82b1f2583945eb8c0ba5563cf2d548e552619
2019-01-17 17:52:59 -08:00
William Hester
5f486c74bf Add the testharness service to sepolicy rules
The testharness service will manage Test Harness Mode and provide a
command-line interface for users to enable Test Harness Mode; however it
does not directly provide a public API.

Bug: 80137798
Test: make
Test: flash crosshatch
Change-Id: Ie396e40fcea8914b4dd2247f2314e029b66ad84e
2019-01-17 13:10:37 -08:00
Srinivas Paladugu
d36d94a551 Allow system server to access zram sysfs
This patch allows
 - System server needs write access to zram sysfs
   directory to be able to trigger writeback to disk.
 - init should be able to change attrs on zram to make
   them writeable by system_server.
 - Vendor init scripts should be able to set zram properties.

Bug: 117682284
Bug: 122674343
Test: Test writeback on go ref device
Change-Id: I308e48210f34894204992043eced5f276d736baf
2019-01-16 20:52:05 -08:00
chenbruce
4e5057af68 SEPolicy updates for adding native flag namespace(netd). am: e3d625b72e am: fa0e90a368
am: 51ae024208

Change-Id: Iffb914913a3062836fe0fc857dc992d53d8cd336
2019-01-14 19:53:05 -08:00
chenbruce
e3d625b72e SEPolicy updates for adding native flag namespace(netd).
For experiment flag testing, we add a flag netd and have
SEPolicy updates.

Test:  add sepolicy, m -j, check GetServerConfigurableFlag function in netd
Bug:122050512
Change-Id: I21c844c277afc358085d80447f16e4c0d4eba5b3
2019-01-15 02:47:57 +00:00
Jeff Vander Stoep
fd58a907d1 netdomain: allow node_bind for ping sockets am: 036090d203 am: 846665fed4
am: 8564f581d9

Change-Id: Ibfd68b0c367ba653e97f70974b05d132c4fa1fe3
2019-01-14 09:21:19 -08:00
Jeff Vander Stoep
036090d203 netdomain: allow node_bind for ping sockets
Grant for icmp_socket for devices with 4.14 or greater kernel, and
rawip_socket for devices with earlier kernels.

Bug: 122572608
Test: build
Change-Id: I1c9d2ce6761dbd2c4db3635600c5f5c335461083
2019-01-14 16:59:03 +00:00
Victor Hsieh
2bdcdd30c9 Merge "Allow fs-verity setup within system_server" am: 9c654b7ca1 am: 756d10a17d
am: 0b8f7188aa

Change-Id: I6be6a3fed51915ce323e2dea8b96c23707ca5470
2019-01-11 22:33:58 -08:00
Victor Hsieh
7397ebd1e1 Allow fs-verity setup within system_server
The original fs-verity implementation requires CAP_SYS_ADMIN and thus
the actual setup is proxied through installd.  Instead, upstream
FS_IOC_ENABLE_VERITY ioctl checks write permission to inode, and thus
can happen in system_server.

Also, replace the old measure ioctl with FS_IOC_SET_VERITY_MEASUREMENT.
Note that although the number is name, they work differently.

Test: set ro.apk_verity.mode=2, in-progress CTS passed without denial
Bug: 112037636
Change-Id: I3e8d14321df8904dfed68b83aae8b3dd99c211ac
2019-01-11 12:21:59 -08:00
Siarhei Vishniakou
434dd2d6c7 Merge "Permissions for InputClassifier HAL" am: 1531e72e76 am: f01aeef78c
am: 26670ab73f

Change-Id: I45ee39fb63dab2ec91a5a909e59c990bacc7c48a
2019-01-11 11:54:26 -08:00
Siarhei Vishniakou
41a871ba84 Permissions for InputClassifier HAL
Add the required permissions for the InputClassifier HAL.

Bug: 62940136
Test: no selinux denials in logcat when HAL is used inside input flinger.
Change-Id: Ibc9b115a83719421d56ecb4bca2fd196ec71fd76
2019-01-11 02:08:19 +00:00
Chenbo Feng
480c3cc5f7 Merge "Use bpfloader to create bpf maps instead of netd" am: a739746990 am: 1e98efd4c6
am: d0392f3828

Change-Id: Ic30cdf07bc4f507e0409b4183b1616ed92ceccf4
2019-01-09 11:36:15 -08:00
Chenbo Feng
7b57104013 Use bpfloader to create bpf maps instead of netd
Recent change in netd and bpfloader switched the creater of bpf maps
from netd to bpfloader. Change the rules related to it to make sure it
doesn't fail.

Test: dumpsys netd trafficcontroller
Bug: 112334572
Change-Id: I016ff68b58ef7b12bdfdebc2fd178be1d0206a62
2019-01-08 10:30:22 -08:00
Narayan Kamath
dda010f606 Allow system_server to read apex_data_file. am: 9f343b32be am: 801e32ecc2
am: 5f7fc5fd41

Change-Id: Iff0fb59f0a8793f3f6aa652a3049720b1895ec4e
2019-01-08 04:24:15 -08:00
Narayan Kamath
9f343b32be Allow system_server to read apex_data_file.
For consistency with APKs, signature verification is performed
in the system_server. This includes checking that the signature of
an updated install matches the signature of the active package that
it updates. For this, it requires search access to /data/apex and
read access to the files under that directory.

Test: m
Change-Id: Ia073adb8892886e4767fa5529e95c110b9cbff1b
2019-01-08 11:55:01 +00:00
Dario Freni
9a8cac3238 Merge "SEPolicy for Staged Installs." am: 4d399f606f am: 757484f199
am: 783eee99dd

Change-Id: Id6b404c391e130cf0f74db6613ee7ca6426498c0
2019-01-08 02:19:28 -08:00