Commit graph

17327 commits

Author SHA1 Message Date
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
Treehugger Robot
37ab42e542 Merge "Label APEX files correctly when TARGET_FLATTEN_APEX=true" 2019-01-30 15:06:21 +00:00
Shuzhen Wang
248633385e Allow cameraserver to access tmpfs
Bug: 79465976
Test: testHeic CTS test
Change-Id: I51eb485dc29d869c5d35fc317b0e008d04bdcbad
2019-01-30 05:31:42 +00: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
91b0ef13d8 Merge "Rename runtime -> runtime_native property namespace" 2019-01-29 22:44:36 +00:00
Treehugger Robot
13fdfa44cd Merge "Fix perfetto CTS test" 2019-01-29 22:31:31 +00: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
Jiyong Park
e7fab1859f Label APEX files correctly when TARGET_FLATTEN_APEX=true
When TARGET_FLATTEN_APEX=true, APEX files are not packaged in *.apex
files but flattened to the system partition under /system/apex/<name>
directories. There was a bug that those flattened files are not labeled
because the per-APEX file_contexts were applied only when building
*.apex. Fixing this by converting the file_contexts files so that
/system/apex/<name> path is prepended and applying the generated
file_contexts file for system.img when TARGET_FLATTEN_APEX=true.

Bug: 123314817
Test: TARGET_FLATTEN_APEX=true m
ls -alZ /system/apex/*/* shows that the files are correctly labeled

Change-Id: Ia82740a1da0083d5bcfd71354a6d374d2a918342
2019-01-29 10:07:54 +09:00
Mathieu Chartier
2c92514304 Merge "Add runtime property permissions for experiments" 2019-01-29 00:43:43 +00:00
Remi NGUYEN VAN
a579a99d31 Merge "Add NetworkStack policies for netd and netlink" 2019-01-28 23:13:08 +00:00
Treehugger Robot
df44eca185 Merge "Ensure that memory and binder_driver tracepoints are available in user builds" 2019-01-28 22:04:58 +00: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
Treehugger Robot
c5f6cd22fd Merge "Audit native code loading on user builds." 2019-01-28 17:52:32 +00: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
Shuzhen Wang
8db7e4a7fa Cameraserver: Allow camera server to talk to MediaCodec
Test: Verify that cameraserver can call MediaCodec functions
Bug: 79465976
Change-Id: I145d2aac5004bf0d9432c3d5dd4d6dcd672374be
2019-01-28 07:32:00 -08:00
Alan Stokes
3f63dbf372 Audit native code loading on user builds.
Extend the auditing of native code loading from non-priv app home
directories to user builds. Only applies to apps targeting SDK <= 28.

Bug: 111338677
Test: Builds
Change-Id: I6fbbd80626a1c87dd7ece689f9fecd7c0a1a59d6
2019-01-28 14:15:48 +00:00
Roland Levillain
9f28f8b360 Fix comment about transition from otapreopt_chroot to postinstall_dexopt.
Test: n/a
Change-Id: Id29de05c9dc4cf6771292050bbd8946bbb939cdd
2019-01-28 12:40:12 +00:00
Isabelle Taylor
19f4998480 Fix perfetto CTS test
The test was failing because of a selinux denial.
This adds the required rule.

Test: atest (previously failing CTS test passed)
Change-Id: Ieb99f9ab4c6014a3d0aa1fe6c6fb6b82fa9b7631
2019-01-28 10:18:16 +00:00
SzuWei Lin
d97c99e4aa Define rcs to be a radio_service
RcsService will die continously without the setting.

Bug: 123325711
Test: boot aosp_arm64_ab-userdebug on a blueline device
Change-Id: Ic140cb3e6466428bf62f0065c78aaf16f957f4d5
2019-01-28 07:00:10 +00:00
Remi NGUYEN VAN
780fbadf08 Add NetworkStack policies for netd and netlink
Allow netd to send network events to the NetworkStack, and allow the
NetworkStack to interact with netlink_route_socket for neighbor
monitoring.

Test: built, booted, WiFi works, no more violations
Bug: 112869080
Change-Id: If212b2897e37e9d249f81ba8139461bce461528e
2019-01-28 14:40:52 +09:00
Treehugger Robot
063022a6ec Merge "iorapd: add tmpfs type" 2019-01-27 07:46:14 +00:00
Treehugger Robot
df88d3faee Merge "Properly Treble-ize tmpfs access" 2019-01-27 07:46:14 +00:00
Joe Onorato
5536a08be3 Add incidentcompanion service.
It is a side channel for dumpstate and incidentd to communicate
status and get user authorization to share bugreports by calling
system_server.

Test: atest PermissionControllerTest / atest GooglePermissionControllerTest
Change-Id: I995a43a25f375e5c97dba1deb92ebe893ca8585d
2019-01-26 13:15:45 -08:00
Jeff Vander Stoep
6742ab4e4e iorapd: add tmpfs type
Fixes build breakage:
system/sepolicy/private/traced.te:36:ERROR 'unknown type iorapd_tmpfs' at token ';' on line 43166:

Bug: 123445058
Test: build marlin-userdebug
Change-Id: Iefeba03ed2efee92fb0d61214514338c6d999bd1
(cherry picked from commit 426ff11951)
2019-01-26 12:55:13 -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
0e48c3bcdd Merge "runtime_event_log_tags_file: dontaudit map permission" 2019-01-26 17:28:51 +00:00
Treehugger Robot
1934af2cf2 Merge "Require equivalence for mls restrictions on symlinks" 2019-01-26 06:30:46 +00:00
Treehugger Robot
3698256b63 Merge "Allow iorapd to access perfetto" 2019-01-26 06:18:32 +00:00
Treehugger Robot
565cbe2140 Merge "Allow system_server to search su:key in debuggable build" 2019-01-26 05:36:28 +00:00
Treehugger Robot
527d215ca0 Merge "Don't audit access for postinstall_mnt_dir" 2019-01-25 22:41:50 +00:00
Tri Vo
7d8146bc8a Merge "sepolicy: refactor Android.mk" 2019-01-25 22:12:00 +00: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
Jeff Vander Stoep
bed2e162ea Require equivalence for mls restrictions on symlinks
An app should never follow a symlink provided by another app.

Test: build, boot Taimen, install some apps, watch youtube, browse
chrome.
Bug: 123350324
Change-Id: Iedd42fe1c27d406f7f58293c20d05e1b7646d8a2
2019-01-25 12:30:47 -08:00
Roland Levillain
f6243dac0b Merge "Clean up APEX-related otapreopt_chroot policies." 2019-01-25 18:34:43 +00:00
Leland Miller
9dd538eded Merge "Add policy for ircs service" 2019-01-25 18:28:57 +00:00
Andreas Gampe
bfefce386f Merge "Sepolicy: Initial Apexd pre-/postinstall rules" 2019-01-25 18:23:35 +00:00
Leland Miller
fa5dfd4d23 Add policy for ircs service
Test: Manually verified that service is accessible
Change-Id: If3748f4719b6194eccd16a097a0f1fc050f4160f
2019-01-25 10:12:04 -08:00
Tri Vo
8b3016b5db sepolicy: refactor Android.mk
system/sepolicy/Android.mk has become too large (~2k lines) and hard to
navigate. This patch reorganizes build rules for convenience. No
functional changes are made.

Test: m selinux_policy
Change-Id: I9a022b223b2387a4475da6d8209d561bfea228fb
2019-01-25 18:01:17 +00:00
Tri Vo
f6014e8e62 Merge "Move selinux_denial_metadata to /vendor." 2019-01-25 17:51:48 +00:00
Nick Kralevich
a310da9aec Merge "disallow priv-apps from following untrusted app symlinks." 2019-01-25 17:51:38 +00:00
Roland Levillain
66fcb98464 Clean up APEX-related otapreopt_chroot policies.
Test: A/B OTA update test (asit/dexoptota/self_full).
Bug: 113373927
Bug: 120796514
Change-Id: Icbbe1babe0dceebff2546264ddabe779babba761
2019-01-25 14:36:37 +00: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
Roland Levillain
c5ec14ba9a Merge changes from topics "runtime-apex-otapreopt_chroot-tear-down", "runtime-apex-installd-support", "runtime-apex-otapreopt_chroot-support"
* changes:
  Allow `oatpreopt_chroot` to deactivate APEX packages in `/postinstall/apex`.
  Allow `oatpreopt` to run `dex2oat` from the Runtime APEX.
  Allow `otapreopt_chroot` to mount APEX packages using `apexd` logic.
2019-01-25 11:56:30 +00:00
Jiyong Park
4372bfb5cd Don't audit access for postinstall_mnt_dir
The dynamic linker always calls access(2) on the path. Don't generate SElinux
denials since the linker does not actually access the path in case the path
does not exist or isn't accessible for the process.

Bug: 120996057
Test: copy ping to /data/local/tmp, run it, no selinux denials
Test: bionic unit tests

Change-Id: Idf33ba7bc6c0d657b6ab0abde6bd078e4bb024e5
2019-01-25 20:48:58 +09:00
Carmen Jackson
4a90f2d012 Ensure that memory and binder_driver tracepoints are available in user builds
Bug: 123367055
Test: used Traceur to take a trace on a user build and verified the
tracepoints are in the resultant trace

Change-Id: I39e963762bf2b9f0e427ee217a3b2a246f970902
2019-01-24 23:43:46 -08:00
Treehugger Robot
c7fb2809bf Merge "Add more neverallows to app_zygote policy." 2019-01-25 05:24:02 +00:00
Tri Vo
4eb68150aa Move selinux_denial_metadata to /vendor.
selinux_denial_metadate is an concatenation of different bug maps on the
device, including vendor one. This file is only used for debugging, so
we simply move it to /vendor instead of splitting it up.

/vendor/etc/selinux/selinux_denial_metadata has vendor_configs_file
selinux type, which is logd readable.

Bug: 5159394
Test: bug information is still preserved in avc logs, e.g.
audit(0.0:248): avc: denied { read } for
name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=18012
scontext=u:r:platform_app:s0:c512,c768
tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
b/79617173 app=com.android.systemui
Change-Id: Id5eb9abd3bdeed92feb2aca40880903533468d50
2019-01-25 00:13:59 +00:00
Tri Vo
6c9d368ab1 Merge "Split system and product sepolicy hashes." 2019-01-25 00:04:34 +00:00
Andreas Gampe
261ea86192 Sepolicy: Initial Apexd pre-/postinstall rules
Give apexd permission to execute sh.

Add userdebug_or_eng domains and rules for the test
APEX for pre- and post-install.

Bug: 119260955
Bug: 119261380
Test: atest apexservice_test
Change-Id: I0c4a5e35e096101a53c9d1f212d2db2e63728267
2019-01-24 15:06:17 -08:00