Commit graph

319 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
TreeHugger Robot
c8f5ea846d Merge "Rename dynamic_android to dynamic_system" 2019-03-22 17:21:38 +00:00
Cheney Ni
25c58d0b57 Add rules for accessing the related bluetooth_audio_hal_prop am: e55a74bdff am: dd367bd058
am: 7f1e977b42

Change-Id: I0f2dd66489bb9d529f6e6cbd5bba7651fc5cf7ea
2019-03-20 01:53:39 -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
Po-Chien Hsueh
24302d7e1e Rename dynamic_android to dynamic_system
Per API review, dynamic_android should be renamed to dynamic_system.

Bug: 126613281
Test: run DynamicSystemInstallationService via adb
Change-Id: Ia908cdd0c21b3a82f59b30e03a985dc260530230
2019-03-19 13:37:15 +08:00
Alex Salo
4d7e0a9374 Add selinux setting for attention am: a1ce292dbb am: 6a931dff20
am: 5179c7039a

Change-Id: I0b03e82b19d881285c4ae70719616461028082fd
2019-03-18 14:48:54 -07: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
Florian Mayer
b2ba3d7643 Merge "Allow traced to lazily start heapprofd." am: 4db9df1a92 am: d43f517327
am: 576e5f0097

Change-Id: Iff4be3df5adbedfc522c40716b2171fc49079c68
2019-03-15 11:36:24 -07:00
Florian Mayer
4db9df1a92 Merge "Allow traced to lazily start heapprofd." 2019-03-15 18:17:52 +00:00
Xiaoyong Zhou
f184b1233e Merge "add label for /proc/sys/fs/verity/require_signatures" am: 3637592a2d am: b846522a7f
am: 2c77cd209d

Change-Id: I6f792869110ef5ca72215cc2d6c80fc5cb8cf9ae
2019-03-14 16:32:40 -07:00
Florian Mayer
a769f0fd43 Allow traced to lazily start heapprofd.
Bug: 126724929

Change-Id: I15f0ae10d5e45fc65850635230e377b6f77ad4d7
2019-03-14 20:42:29 +00: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
Tao Bao
73090c6ff8 Move /sbin/charger to /system/bin/charger. am: ecc7e8cacb am: 18e68c790f
am: b20b005e2e

Change-Id: I4c459ee3e6dc294cac751d844a378cd3ed0c75cc
2019-03-14 10:17:23 -07: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
Tri Vo
daa48f8e20 Allow global read access to /sys/kernel/mm/transparent_hugepage/ am: d6c5ff5f72 am: f59537cd15
am: fb81c6462b

Change-Id: I4188084fd08814039face646157a8050d46047c8
2019-03-13 17:06:01 -07: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
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
Martijn Coenen
57b86b3817 Merge "Add policy for /metadata/apex." am: 460efa2a01 am: bd415ea496
am: ff4ada393e

Change-Id: I6fe168c03b47778bec5ef70beddcadeee734033d
2019-03-12 14:32:32 -07:00
Martijn Coenen
5fbbf2613c Add policy for /metadata/apex.
This is an area that apexd can use to store session metadata, which
won't be rolled back with filesystem checkpointing.

Bug: 126740531
Test: builds
Change-Id: I5abbc500dc1b92aa46830829be76e7a4381eef91
2019-03-12 18:31:07 +01:00
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
a116e1afe5 Merge "Add sepolicy for resolver service" 2019-03-07 05:35:12 +00: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
fc8d3f317d Merge "Fix denials during bugreport." 2019-03-04 21:24:10 +00: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
Joel Galenson
f24854f8e8 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
2019-03-01 12:35:48 -08:00
Suren Baghdasaryan
a52c22172b Merge "sepolicy for vendor cgroups.json and task_profiles.json files" am: e3f15e2abc am: b582791324
am: 14a03c82a4

Change-Id: Ibd4f155feae6b925952b90e0078a5229aa74c7bb
2019-03-01 10:29:38 -08:00
Suren Baghdasaryan
6155b2fd11 sepolicy for vendor cgroups.json and task_profiles.json files
Vendors should be able to specify additional cgroups and task profiles
without changing system files. Add access rules for /vendor/etc/cgroups.json
and /vendor/etc/task_profiles.json files which will augment cgroups and
task profiles specified in /etc/cgroups.json and /etc/task_profiles.json
system files. As with system files /vendor/etc/cgroups.json is readable
only by init process. task_profiles.json is readable by any process that
uses cgroups.

Bug: 124960615
Change-Id: I12fcff0159b4e7935ce15cc19ae36230da0524fc
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-03-01 00:32:15 +00:00
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
Daniel Rosenberg
cd07e928dc Add Label to f2fs sysfs files am: 46c50683d6 am: fe47f9e353
am: 24c041f6da

Change-Id: Iebfb964bfe56dca5a529dd8e2f6dce004b8717bd
2019-02-20 16:22:10 -08:00
Daniel Rosenberg
46c50683d6 Add Label to f2fs sysfs files
Test: ls -lZ /sys/fs/f2fs
Bug: 123367711
Change-Id: I0035feb8409b7ec8e11510795fb7d8845992694e
2019-02-20 22:40:40 +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
Yiwei Zhang
a625aa7007 Merge "Game Driver: sepolicy update for plumbing GpuStats into GpuService" am: 64c8df4a54 am: 30287cfbf1
am: 77758a0cee

Change-Id: Ic0778ac8300ba6d0d86a6ca79cf2323ddc70ad08
2019-02-11 10:26:41 -08:00
Yiwei Zhang
544d6b34ec Game Driver: sepolicy update for plumbing GpuStats into GpuService
Allow all the app process with GUI to send GPU health metrics stats to
GpuService during the GraphicsEnvironment setup stage for the process.

Bug: 123529932
Test: Build, flash and boot. No selinux denials.
Change-Id: Ic7687dac3c8a3ea43fa744a6ae8a45716951c4df
2019-02-08 18:15:17 -08:00
David Anderson
2830744829 Full sepolicy for gsid. am: db90b91ea0 am: 300d0ef2c5
am: 2ef1c42189

Change-Id: I4f2faee6ad4c3cc8f3d9385ec6914cf3d28a3275
2019-02-07 22:18:38 -08:00
David Anderson
db90b91ea0 Full sepolicy for gsid.
Bug: 122556707
Test: manual test
Change-Id: I2536deefb3aa75deee4aeae7df074349b705b0f0
2019-02-08 05:56:58 +00:00
Joel Fernandes
7b59e039f5 Merge "Add permissions for sys.use_memfd property" am: f6085fefe6 am: b80724d882
am: 28d070c9c7

Change-Id: I90b55fba1975b0ce30e445571a52dc0e8bb53346
2019-02-07 06:32:19 -08:00
Joel Fernandes
deef7f0afd Add permissions for sys.use_memfd property
Will be used to forcefully turn on memfd if device supports it.
Currently used only for debugging.

Change-Id: I46a1b7169677ea552d4b092e7501da587c42ba1a
Signed-off-by: Joel Fernandes <joelaf@google.com>
2019-02-06 15:16:16 -05:00
Primiano Tucci
784da728cf Merge "Allow traced to notify traceur via property" am: 9125a0aefd am: ba8180db1e
am: 6d766d6c83

Change-Id: Ia13f48dff8a9d5eb6e4b69e60bfa2cc66f9b47ff
2019-02-06 11:01:06 -08:00
Primiano Tucci
8da4e4fb7c Allow traced to notify traceur via property
This CL introduces allows traced to set the
sys.traceur.trace_end_signal property at the end
of the tracer. In turn that property notifies the
the Traceur app.
This is to allowing Traceur to be killed during
a long-trace and avoid wasting resources making
it a persistent service.
See aosp/886616 for the matching traceur change.

Test: manual
Bug: 116754732
Change-Id: I89e2f02b3f973813ce8ff3507d397a06502f84c1
2019-02-06 08:47:04 +00:00
Tri Vo
a7061e8e9a sepolicy for ashmemd am: 73d0a67b06 am: 610a8ed7cf
am: e869afd212

Change-Id: I8f025f4b1b5b1fab19998752ef2d6fb9a503ba16
2019-02-05 14:11:45 -08:00
Tri Vo
73d0a67b06 sepolicy for ashmemd
all_untrusted_apps apart from untrusted_app_{25, 27} and mediaprovider
are now expected to go to ashmemd for /dev/ashmem fds.

Give coredomain access to ashmemd, because ashmemd is the default way
for coredomain to get a /dev/ashmem fd.

Bug: 113362644
Test: device boots, ashmemd running
Test: Chrome app works
Test: "lsof /system/lib64/libashmemd_client.so" shows
libashmemd_client.so being loaded into apps.
Change-Id: I279448c3104c5d08a1fefe31730488924ce1b37a
2019-02-05 21:38:14 +00:00
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
Suren Baghdasaryan
561ce801b0 sepolicy changes to configure cgroup.rc and task_profiles.json access
cgroups.json file contains cgroup information required to mount
cgroup controllers and is readable only by init process.
cgroup.rc contains cgroup map information consisting of the list of
cgroups available in the system and their mounting locations. It is
created by init process and should be readable by any processes that
uses cgroups and should be writable only by init process.
task_profiles.json file contains task profiles used to operate on
cgroups. This information should be readable by any process that uses
cgroups and should be writable only by init process.

Bug: 111307099
Test: builds, boots

Change-Id: Ib2c87c0fc3663c7fc69628f05c846519b65948b5
Merged-In: Ib2c87c0fc3663c7fc69628f05c846519b65948b5
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-02 16:56:08 +00:00
Suren Baghdasaryan
dbd438c239 sepolicy changes to configure cgroup.rc and task_profiles.json access
cgroups.json file contains cgroup information required to mount
cgroup controllers and is readable only by init process.
cgroup.rc contains cgroup map information consisting of the list of
cgroups available in the system and their mounting locations. It is
created by init process and should be readable by any processes that
uses cgroups and should be writable only by init process.
task_profiles.json file contains task profiles used to operate on
cgroups. This information should be readable by any process that uses
cgroups and should be writable only by init process.

Bug: 111307099
Test: builds, boots

Change-Id: Ib2c87c0fc3663c7fc69628f05c846519b65948b5
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-02-02 05:52:45 +00:00
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
a0bea70f10 Merge "SEPolicy updates for adding native flag namespace(media)." 2019-02-01 19:50:13 +00:00
Xiaoyong Zhou
2ebc63bef4 add selinux rules for mini-keyctl
mini-keyctl is a binary used to load channel keys to .fsverity keyring.
This CL creates a new domain for mini-keyctl and a type for /proc/keys
and adds allow rules needed by this binary.

Bug: 112038861
Test: manual
Merged-In: I3b744d302859a02dfe63c81c7f33bb30912d7994
Change-Id: I3b744d302859a02dfe63c81c7f33bb30912d7994
2019-01-31 15:12:11 -08:00
Xiaoyong Zhou
1ae4faa9dc add selinux rules for mini-keyctl
mini-keyctl is a binary used to load channel keys to .fsverity keyring.
This CL creates a new domain for mini-keyctl and a type for /proc/keys
and adds allow rules needed by this binary.

Bug: 112038861
Test: manual
Change-Id: I3b744d302859a02dfe63c81c7f33bb30912d7994
2019-01-31 13:40:00 -08:00
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
Shuzhen Wang
043d6165cc Revert "Cameraserver: Allow cameraserver to access /data/misc/cameraserver" am: 6b4caaa3e8 am: e588655bb9
am: e828b68c69

Change-Id: I2f7bea04a595a7c18d915d354a833581a08ec556
2019-01-29 21:58:14 -08:00
Shuzhen Wang
6b4caaa3e8 Revert "Cameraserver: Allow cameraserver to access /data/misc/cameraserver"
This reverts commit 4e1497c7c0.

Reason for revert: Write temporary file to in-memory tmpfs instead

Test: testHeic CTS test
Bug: 123526741
Change-Id: Ifa7f5a0b50c46ee3e1a5695595233b17adc99222
2019-01-29 23:29:05 +00:00
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
Roland Levillain
1cab1b17c0 Introduce a postinstall_apex_mnt_dir label for /postinstall/apex. am: a42ebf4128 am: 9ae5d888eb
am: 2f42ac1194

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

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

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

Change-Id: I4cee94a2540767c54eecedb9d40943f35186be21
2019-01-28 09:13:15 -08:00
Shuzhen Wang
4e1497c7c0 Cameraserver: Allow cameraserver to access /data/misc/cameraserver
Test: Cameraserver writes/reads/overwrites files in the folder
Bug: 79465976
Change-Id: I76460844a8e02e4c6ce704b85c72e57f861f5b18
2019-01-28 07:32:00 -08:00
Jeff Vander Stoep
41a2abfc0d Properly Treble-ize tmpfs access
This is being done in preparation for the migration from ashmem to
memfd. In order for tmpfs objects to be usable across the Treble
boundary, they need to be declared in public policy whereas, they're
currently all declared in private policy as part of the
tmpfs_domain() macro. Remove the type declaration from the
macro, and remove tmpfs_domain() from the init_daemon_domain() macro
to avoid having to declare the *_tmpfs types for all init launched
domains. tmpfs is mostly used by apps and the media frameworks.

Bug: 122854450
Test: Boot Taimen and blueline. Watch videos, make phone calls, browse
internet, send text, install angry birds...play angry birds, keep
playing angry birds...

Change-Id: I20a47d2bb22e61b16187015c7bc7ca10accf6358
Merged-In: I20a47d2bb22e61b16187015c7bc7ca10accf6358
(cherry picked from commit e16fb9109c)
2019-01-26 17:30:41 +00:00
Jeffrey Vander Stoep
dd57e7b69f Merge "Properly Treble-ize tmpfs access" 2019-01-26 17:27:47 +00:00
Jeff Vander Stoep
e16fb9109c Properly Treble-ize tmpfs access
This is being done in preparation for the migration from ashmem to
memfd. In order for tmpfs objects to be usable across the Treble
boundary, they need to be declared in public policy whereas, they're
currently all declared in private policy as part of the
tmpfs_domain() macro. Remove the type declaration from the
macro, and remove tmpfs_domain() from the init_daemon_domain() macro
to avoid having to declare the *_tmpfs types for all init launched
domains. tmpfs is mostly used by apps and the media frameworks.

Bug: 122854450
Test: Boot Taimen and blueline. Watch videos, make phone calls, browse
internet, send text, install angry birds...play angry birds, keep
playing angry birds...

Change-Id: I20a47d2bb22e61b16187015c7bc7ca10accf6358
2019-01-25 08:56:45 -08:00
Michael Wright
345d030880 Add new external vibrator service to system_server am: e9f1668c17 am: 24f1d94dfa
am: a55d651f46

Change-Id: I956c3652a6e0d84ed14f5c3ab52459d7214679ca
2019-01-25 08:54:32 -08:00
Michael Wright
e9f1668c17 Add new external vibrator service to system_server
Bug: 111457573
Test: N/A
Change-Id: I457fd9d13cc481f2687ab39d22240c6ea7231183
2019-01-25 14:26:07 +00: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
Yabin Cui
0c7428049c Merge "Add sepolicy for simpleperf_app_runner." am: 31bd80439f am: fc44e546bd
am: c2bf098d77

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

Change-Id: Ifb6c2ab78e075684bc197d06f761becced8281d1
2019-01-23 23:23:09 +00:00