Commit graph

17092 commits

Author SHA1 Message Date
Yao Chen
e1d250891c Allow statsd to write stats log events to perfd(running as shell) via pipes.
Bug: 120921905
Test: locally tested
Change-Id: I23fda0f83daff8765f7946814a61588dac00c85a
2018-12-18 15:58:50 -08:00
Tri Vo
9ee4e3aeaa Merge changes from topic "product_sepolicy.cil"
* changes:
  Separate product_sepolicy.cil out of system sepolicy
  Replace "grep -f" with python util.
2018-12-18 21:13:27 +00:00
Tri Vo
75887dd5af Separate product_sepolicy.cil out of system sepolicy
Product-specific sepolicy will be installed into /product/etc/selinux/*.
This change separates out /product/etc/selinux/product_sepolicy.cil out
of system sepolicy.

This file is merged into precompiled_sepolicy at build-time. In case
precompiled_sepolicy can't be used (e.g. system-only-ota), init wll
merge this file with the rest of the sepolicy at runtime.

I left TODOs to separate other product-specific SELinux artifacts out of
system.

Bug: 119305624
Test: boot aosp_taimen with product_sepolicy.cil
Test: build selinux_policy for aosp_arm64; no product_sepolicy.cil
produced
Change-Id: Idb84a1c8ceb2de78f1460d954497c53fed08935f
2018-12-18 10:42:09 -08:00
Treehugger Robot
490cbfdbd3 Merge "Use hidl memory from allocator in CAS" 2018-12-18 05:34:20 +00:00
Tri Vo
d57789fde8 Replace "grep -f" with python util.
grep can potentially run out of memory on Mac builds for large input
files. So we add a python util to handle filtering out files.

We will also need this util to filter plat_sepolicy.cil out of
product_sepolicy.cil

Bug: 119305624
Test: boot aosp_taimen
Change-Id: I61cd68f407ea5de43a06bf522a5fc149e5067e8c
2018-12-17 16:57:57 -08:00
Winson Chung
ac1a0a7bf5 Adding policy for content suggestions.
Bug: 120865921
Test: Manual verification
Change-Id: Ic0b3f85fad24ccedc0a8e9935c198bc8503bb415
2018-12-18 00:30:34 +00:00
Chong Zhang
404e40c6c1 Use hidl memory from allocator in CAS
Make mediaextractor use hidl memory allocated by
hidl allocator, instead of constructing hidl memory
from IMemory.

bug: 112766913
bug: 111407253
Change-Id: I7902f18768005c995925bc9a7947299e9988b68a
(Needed for internal commit I39e131718ea41f9cb23177c28213ddf7b7741338)
2018-12-17 22:49:18 +00:00
Treehugger Robot
b209cb9670 Merge "Allow to signal perfetto from shell." 2018-12-17 22:00:45 +00:00
Treehugger Robot
5ca7847a87 Merge "Add a property used to enable Vulkan as default render pipeline" 2018-12-17 21:04:31 +00:00
Stan Iliev
7f19d841e4 Add a property used to enable Vulkan as default render pipeline
Test: Booted with Vulkan rendering
Change-Id: I00485c16e5a878321a699f35d28fb85834991255
2018-12-17 11:30:48 -05:00
Todd Kennedy
784c2b8d32 Create new permissionmgr_service
We're creating a new PermissionManagerService that will handle
all of the permission related APIs. These are currently being
routed through PackageManagerService.

Test: Device boots
Change-Id: I7d08561dd33b692209c30d413cdca0ff567358f1
2018-12-17 14:49:01 +00:00
Treehugger Robot
98c6b33088 Merge "SELinux policy for rss_hwm_reset" 2018-12-17 12:31:26 +00:00
Alan Stokes
344e87cc4b Merge "Audit execution of app_data_file native code." 2018-12-17 09:48:00 +00:00
Peter Kalauskas
f0b4fedc1c Merge "Allow lazy cas service to run" 2018-12-16 22:46:51 +00:00
Martijn Coenen
151c7cd049 Merge "Allow apexd to flush block devices." 2018-12-16 18:34:39 +00:00
Rafal Slawik
4e1c5764b5 SELinux policy for rss_hwm_reset
rss_hwm_reset is binary that reset RSS high-water mark counters for all
currently running processes. It runs in a separate process because it
needs dac_override capability.

Bug: 119603799
Test: no errors in logcat
Change-Id: I6221a5eca3427bf532830575d8fba98eb3e65c29
2018-12-15 10:13:03 +00:00
Peter Kalauskas
4cc196f48a Allow lazy cas service to run
Test: Run CtsMediaTestCases on aosp_marlin_svelte
Change-Id: Ie7d491fbc11ef5c24826a0d69e479bc03bd2ad08
2018-12-14 21:29:58 +00:00
Felipe Leme
0f45683fb3 DO NOT MERGE - Renamed "intelligence" to "content_capture"
Bug: 111276913
Test: manual verification

Merged-In: If76dc7bfdad87789a58fc94e0fd280deae1a41ab
Change-Id: If76dc7bfdad87789a58fc94e0fd280deae1a41ab
(cherry picked from commit 73e7fa884b)
2018-12-14 08:34:32 -08:00
Alan Stokes
890414725f Audit execution of app_data_file native code.
On debug builds, introduce audit logging of apps targeting SDK <= 28
that execute native code from a non-priv app home directory via
execve() or dl_open().

Bug: 111338677
Test: Builds + boots.
Test: Launch app that uses private .so files, see granted logs.
Change-Id: I5880801d3a29cbf2c1cf4e0d72adc69a9d548952
2018-12-14 14:54:56 +00:00
Martijn Coenen
558c1b8de5 Allow apexd to flush block devices.
To work around a kernel bug where pages that are read before changing
the loop device offset are not invalidated correctly.

Bug: 120853401
Test: apexd mounts APEX files on gphone_sdk_x86_64
Change-Id: I89f23f8f9d472e599f053553b73cc0618dcb3747
2018-12-14 09:50:31 +00:00
Tri Vo
c2dbce0604 Merge "Add BOARD_ODM_SEPOLICY_DIRS to neverallow checks." 2018-12-14 01:27:32 +00:00
Treehugger Robot
66334bd0e4 Merge "Add SELinux policy for Conscrypt APEX" 2018-12-13 23:27:54 +00:00
Tri Vo
5dbaa245e9 Add BOARD_ODM_SEPOLICY_DIRS to neverallow checks.
It doesn't seem like any of our (Google's) devices use
BOARD_ODM_SEPOLICY_DIRS, but this will be helpful for partners.

Also, use BOARD_VENDOR_SEPOLICY_DIRS instead BOARD_SEPOLICY_DIRS for
readability.

Bug: n/a
Test: m selinux_policy
Change-Id: I23f64a24d51ccdb8aa616d0fd8a06d70b6efed32
2018-12-13 13:41:41 -08:00
Jeff Sharkey
7f82c3eb4d Merge "Allow zygote to create files at /mnt/user/.*" 2018-12-13 16:24:22 +00:00
Florian Mayer
aeca04b967 Allow to signal perfetto from shell.
When daemonizing perfetto, SIGINT should be sent to ensure clean
shutdown.

Denial:
12-06 11:12:16.566  3099  3099 I sh      : type=1400 audit(0.0:462): avc: denied { signal } for scontext=u:r:shell:s0 tcontext=u:r:perfetto:s0 tclass=process permissive=1

Test: m
Test: flash walleye
Test: SIGINT perfetto from shell

Change-Id: I8d34b447ea90c315faf88f020f1dfc49e4abbcce
2018-12-13 10:46:42 +00:00
Paul Crowley
ecccfc84f9 Merge "Remove overpermissive neverallow exceptions." 2018-12-13 06:48:05 +00:00
Sudheer Shanka
2bac81dfab Allow zygote to create files at /mnt/user/.*
Bug: 111789719
Test: manual
Change-Id: I5a5c1da69fd5d55e3276bb7384a94b9831e3cccd
2018-12-12 21:05:38 -08:00
Treehugger Robot
42abd423cd Merge "remove app_data_file execute" 2018-12-13 01:21:28 +00:00
Treehugger Robot
66f75b699f Merge "Add sepolicy for GNSS HAL 2.0 and 1.1" 2018-12-13 00:43:28 +00:00
Treehugger Robot
f523218db3 Merge "bless app created renderscript files" 2018-12-12 23:52:27 +00:00
Paul Crowley
90e68e929c Remove overpermissive neverallow exceptions.
Test: Compiles - neverallow rules are compile time checks
Change-Id: I2e1177897d2697cde8a190228ba83381d9a1877a
2018-12-12 14:55:18 -08:00
Yu-Han Yang
63de8591e8 Add sepolicy for GNSS HAL 2.0 and 1.1
Bug: 112260995
Bug: 120277977
Test: atest VtsHalGnssV2_0TargetTest
Change-Id: I196d8506b2f7c2153e1f647ea5ba61b81bf3d881
2018-12-12 13:41:01 -08:00
Nick Kralevich
b362474374 remove app_data_file execute
Remove the ability for applications to dlopen() executable code from
their home directory for newer API versions. API versions <= 28 are
uneffected by this change.

Bug: 112357170
Test: cts-tradefed run cts -m CtsRenderscriptTestCases
Change-Id: I1d7f3a1015d54b8610d1c561f38a1a3c2bcf79e4
2018-12-12 13:20:39 -08:00
Nick Kralevich
0eb0a16fbd bless app created renderscript files
When an app uses renderscript to compile a Script instance,
renderscript compiles and links the script using /system/bin/bcc and
/system/bin/ld.mc, then places the resulting shared library into the
application's code_cache directory. The application then dlopen()s the
resulting shared library.

Currently, this executable code is writable to the application. This
violates the W^X property (https://en.wikipedia.org/wiki/W%5EX), which
requires any executable code be immutable.

This change introduces a new label "rs_data_file". Files created by
/system/bin/bcc and /system/bin/ld.mc in the application's home
directory assume this label. This allows us to differentiate in
security policy between app created files, and files created by
renderscript on behalf of the application.

Apps are allowed to delete these files, but cannot create or write these
files. This is enforced through a neverallow compile time assertion.

Several exceptions are added to Treble neverallow assertions to support
this functionality. However, because renderscript was previously invoked
from an application context, this is not a Treble separation regression.

This change is needed to support blocking dlopen() for non-renderscript
/data/data files, which will be submitted in a followup change.

Bug: 112357170
Test: cts-tradefed run cts -m CtsRenderscriptTestCases
Change-Id: Ie38bbd94d26db8a418c2a049c24500a5463698a3
2018-12-12 13:20:22 -08:00
Florian Mayer
c32ca90181 Add persist.heapprofd.enable property.
This is analoguous to what Perfetto does with persist.traced.enable.

Test: m
Test: flash walleye
Test: setprop persist.heapprofd.enable 1
      setprop persist.heapprofd.enable 0

Change-Id: I997272ef8c6fe078aca2388ed0cf2ecc3de612a5
2018-12-12 10:26:33 +00:00
Treehugger Robot
a0718293ea Merge "Add a few permissions required by fastbootd" 2018-12-12 08:28:24 +00:00
Sunny Goyal
2a2d638ef6 New system service: app_prediction_service
- Update policy for new system service, used for SystemUI/Apps to
  present predicted apps in their UI.

Bug: 111701043
Test: manual verification
Change-Id: Ia3b5db987097d2d71bf774ca550041e03214471d
2018-12-12 03:33:56 +00:00
Michael Butler
85762ff983 Merge "Allow NN HAL to mmap client-provided fd by default" 2018-12-11 23:52:13 +00:00
Fan Xu
144607d1fb Merge "Remove unused bufferhub sepolicy" 2018-12-11 23:41:42 +00:00
Hridya Valsaraju
44f3d0f097 Add a few permissions required by fastbootd
These address the following denials:

avc: denied { getattr } for pid=547 comm="fastbootd"
path="/dev/block" dev="tmpfs" ino=18532 scontext=u:r:fastbootd:s0
tcontext=u:object_r:block_device:s0 tclass=dir permissive=1␍

avc: denied { read } for pid=547 comm="fastbootd" name="fstab"
dev="sysfs" ino=25820 scontext=u:r:fastbootd:s0
tcontext=u:object_r:sysfs_dt_firmware_android:s0 tclass=dir permissive=1␍␊

avc: denied { open } for pid=547 comm="fastbootd"
path="/sys/firmware/devicetree/base/firmware/android/fstab" dev="sysfs"]
ino=25820 scontext=u:r:fastbootd:s0
tcontext=u:object_r:sysfs_dt_firmware_android:s0 tclass=dir permissive=1

Bug: 119115481
Test: fastboot flashall
Change-Id: I97dc783ceef396145e3baa5d79194560fc0634f7
2018-12-11 11:18:32 -08:00
Benjamin Schwartz
65b9e66f9b Merge "Add power.stats HAL 1.0 sepolicy" 2018-12-11 19:02:59 +00:00
Wei Wang
a939eca2f2 Merge changes I8a42dc04,Iddddb77e
* changes:
  Revert "Move thermal service into system_server"
  Revert "Expose thermal service to all apps"
2018-12-11 17:05:23 +00:00
Wei Wang
8c8eb69f5f Revert "Move thermal service into system_server"
This reverts commit 461d91fe75.

Reason for revert: breaks git_pi-dev-plus-aosp

Change-Id: I8a42dc040a112f0774f31486a8da2a26e1e68a30
2018-12-11 17:04:17 +00:00
Wei Wang
7e6438b380 Revert "Expose thermal service to all apps"
This reverts commit 52611966ad.

Reason for revert: breaks git_pi-dev-plus-aosp

Change-Id: Iddddb77e2d567002aed3844360284c4aeac4088d
2018-12-11 17:02:59 +00:00
Wei Wang
2169472f6e Merge changes I977530a9,Iafb376e6
* changes:
  Expose thermal service to all apps
  Move thermal service into system_server
2018-12-11 16:00:51 +00:00
Carmen Jackson
76d70460ea Allow the Traceur app to start Perfetto.
Bug: 116754732
Test: Started a trace in Traceur using Perfetto successfully.

Change-Id: I217857bf1f43f1b7b24454687d1f26b9d5c6c56a
2018-12-10 18:51:29 -08:00
Wei Wang
52611966ad Expose thermal service to all apps
Thermal API has been added to PowerManager and this CL is to grant
IThermal access to app.

Bug: 119613338
Test: PowerManager CTS test
Change-Id: I977530a9a5490bdc53af1548788b885e7c649f01
2018-12-10 16:46:21 -08:00
Wei Wang
461d91fe75 Move thermal service into system_server
Bug: 118510237
Test: Boot and test callback on ThermalHAL 1.1 and ThermalHAL 2.0

(cherry picked from commit 75cc6bf2d5)

Change-Id: Iafb376e61dc579c3bfd173ac34a4d525b83d8e5c
2018-12-10 16:46:21 -08:00
Benjamin Schwartz
e7040eada0 Add power.stats HAL 1.0 sepolicy
Also giving statsd permission to access it. This change copies the internal sepolicy to AOSP.

Bug: 111185513
Bug: 120551881
Test: make
Change-Id: I7e0386777e05580299caf9b97cb7804459f1a9d0
2018-12-11 00:11:08 +00:00
Fan Xu
ffffed28fa Remove unused bufferhub sepolicy
These selinux policy rules were added for bufferhub to run a binder
service. But later we decided to use a hwbinder service instead, and the
original binder service was removed in git/master. Now we can safely
remove these rules.

Test: Build passed. Device boot successfully without selinux denial.
Bug: 118891412
Change-Id: I349b5f0f2fa8fb6a7cfe7869d936791355c20753
2018-12-10 13:36:11 -08:00