Commit graph

2919 commits

Author SHA1 Message Date
Pawin Vongmasa
7d9d64dcd9 Add public Codec2 HIDL interfaces
Test: make cts -j123 && cts-tradefed run cts-dev -m \
CtsMediaTestCases --compatibility:module-arg \
CtsMediaTestCases:include-annotation:\
android.platform.test.annotations.RequiresDevice

Bug: 112362730
Bug: 119853704

Change-Id: Ie84dab48c4f068eb1f6289b5c022525cd06ef7fc
2018-11-30 05:11:21 -08:00
Tri Vo
2725edc658 Wider neverallow rules for coredomain /dev access.
"iio_device", "radio_device" must not be accessed by coredomain on all
devices. And "tee_device" must not be accessed by coredomain on Treble
devices.

Bug: 110962171
Test: m selinux_policy
Test: mmma system/sepolicy
Change-Id: I27029b6579b41109c01c35c6ab5a992413f2de5c
2018-11-29 19:01:48 -08:00
Igor Murashkin
68b2f98b8b system_server: Allow binder connections to iorapd
Bug: 72170747
Change-Id: I835e6a93cf797f939b808eb6025939d053d509ae
2018-11-29 15:37:22 -08:00
Tri Vo
9cded32f6a Merge "Remove coredomain /dev access no longer needed after Treble" 2018-11-29 19:27:54 +00:00
Treehugger Robot
ad1654797a Merge "Allow init to set powerctl property" 2018-11-29 16:56:19 +00:00
felkachang
196b12eb3e Track isolated_app SELinux denial.
The isolated service that do nothing for AIDL's APIs still got the
SELinux denied. This should fix presubmit test.

01-01 00:00:22.103  5831  5831 I auditd  : type=1400 audit(0.0:6): avc:
denied { getattr } for comm="convert.service"
path="/data/data/com.android.providers.media" dev="sda35" ino=1442136
scontext=u:r:isolated_app:s0:c0,c256,c512,c768
tcontext=u:object_r:privapp_data_file:s0:c512,c768 tclass=dir
permissive=0

Test: build
Bug: 119596573

Change-Id: Ie58326ba217ed6ca56ca9933c6664896ac3d327a
2018-11-29 07:07:55 +00:00
Tri Vo
8a6cc52ed7 Remove coredomain /dev access no longer needed after Treble
According to go/sedenials (internal dogfooding), coredomain access to
following types is not exercised and can be removed:
iio_device
radio_device
tee_device

Access to audio_device is still needed since some ALSA interfaces
(/dev/snd/*) are directly used by system_server.

Bug: 110962171
Test: m selinux_policy
Change-Id: I740b99813e1f93136bfcaec087b74f0e03b259ad
2018-11-29 04:56:18 +00:00
Nick Kralevich
1e5021c450 Move some rules around
Move rules / neverallow assertions from public to private policy. This
change, by itself, is a no-op, but will make future patches easier to
read. The only downside of this change is that it will make git blame
less effective.

Motivation: When rules are placed into the public directory, they cannot
reference a private type. A future change will modify these rules to
reference a private type.

Test: compiles
Bug: 112357170
Change-Id: I56003409b3a23370ddab31ec01d69ff45c80d7e5
2018-11-28 17:55:21 -08:00
Florian Mayer
b1dad09679 Allow heap profiling everything except TCB on userdebug.
Bug: 117762471
Test: m
Test: flash sailfish
Test: profile all running processes with setenforce 1

Change-Id: I71d41d06d2a62190e33b7e3e425a1f7b8039196e
2018-11-28 22:01:58 +00:00
Yifan Hong
ea9cf8148e Merge "Add rules to dump health traces" 2018-11-28 21:54:46 +00:00
Treehugger Robot
b2d0d4a593 Merge "[gpuservice] allow "adb shell cmd gpu vkjson"" 2018-11-28 02:39:56 +00:00
Yifan Hong
0d53ef2c91 Add rules to dump health traces
Test: bugreport
Bug: 119809588
Change-Id: Ia688d68120daebc0a4feb51c4745535e1b371594
2018-11-27 17:36:07 -08:00
Yiwei Zhang
ff0f79c195 [gpuservice] allow "adb shell cmd gpu vkjson"
Also allow adb shell dumpsys gpu to not return error.

Bug: 120095213
Test: flash non-eng build and adb shell cmd gpu vkjson
Change-Id: Ia4a50a475ce76ec35e082dd52d4a6c80dde7f571
2018-11-27 15:58:20 -08:00
Branden Archer
d36b1d5f62 Allow init to set powerctl property
NIAP certification requires that all cryptographic functions
undergo a self-test during startup to demonstrate correct
operation. init now performs this check during startup.

The self-test is forked from init. For the child process
to be able to request a reboot it needs permissions to
set the sys.powerctl property.

Bug: 119826244
Test: Built for walleye. When the BoringSSL self test was forced
      to fail the device rebooted into the bootloader, as
      expected.

Change-Id: I4171b1dd0a5e393252ae5c002171ac51c9cbb3e6
2018-11-27 15:47:12 -08:00
Hongyi Zhang
b61ac077dd grant system_server read permission of server_configurable_flags_data
server_configurable_flags_data_file is used for storing server
configurable flags which have been reset during current booting.
system_server needs to read the data to perform related disaster
recovery actions.
For how the data is read, see SettingsToPropertiesMapper.java.

Test: build succeeds & manual on device
Change-Id: Ifa22aecc13af2c574579299d28433622abbe6b85
2018-11-27 13:29:08 -08:00
Mikhail Naganov
d81a36ad47 Merge "Allow audioserver to access persist.log.tag" 2018-11-27 19:16:26 +00:00
Neda Topoljanac
bffe163b13 SELinux policy for new managed system update APIs
We introduced a new API to allow Device Owner to install an OTA file on disk.
This in turn requires system_server to be able to copy the OTA file to a known
OTA file location, call into update_engine to start the installation and let
update_engine to call back to the system_server to deliver any error conditions
asynchronously. This CL modifies the SELinux policy to allow these interaction.

Test: manual in TestDPC, CTS tests for negative cases: atest com.android.cts.devicepolicy.DeviceOwnerTest#testInstallUpdate
Change-Id: Id1fbea9111f753c5c80f270c269ecb9ef141cd79
Bug: 111173669
2018-11-22 17:46:31 +00:00
Nick Kralevich
bacf448bdb allow system_server BLKSECDISCARD BLKDISCARD
Used at:
7271c452a9/services/core/jni/com_android_server_PersistentDataBlockService.cpp (60)

Addresses the following denials:
  audit(0.0:413): avc: denied { ioctl } for comm="Binder:1365_1C" path="/dev/block/sdg1" dev="tmpfs" ino=20555 ioctlcmd=127d scontext=u:r:system_server:s0 tcontext=u:object_r:frp_block_device:s0 tclass=blk_file permissive=0
  audit(0.0:410): avc: denied { ioctl } for comm="Binder:1365_3" path="/dev/block/sdg1" dev="tmpfs" ino=20555 ioctlcmd=1277 scontext=u:r:system_server:s0 tcontext=u:object_r:frp_block_device:s0 tclass=blk_file permissive=0

Test: policy compiles.
Change-Id: I7614b6269031b7912a7b93dc5307f5687458fba8
2018-11-20 17:57:04 -08:00
Nick Kralevich
cfe1baea25 place dex2oat auditallow statements in userdebug_or_eng blocks
By convention, auditallow statements are always placed in
userdebug_or_eng() blocks. This ensures that we don't inadvertently ship
audit rules on production devices, which could result in device logspam,
and in pathological situations, impact device performance (generating
audit messages is much more expensive than a standard SELinux check).

Bug: 117606664
Test: policy compiles.
Change-Id: I681ed73c83683e8fdbef9cf662488115f6e7a490
2018-11-20 10:50:22 -08:00
Nicolas Geoffray
c7be91d58b Merge "Allow webview_zygote to JIT." 2018-11-20 16:38:52 +00:00
Hector Dearman
b78af6cdb4 Merge "Allow adb root to send config to perfetto" 2018-11-20 15:08:30 +00:00
Dario Freni
5a6d94bc03 Merge "Allow PackageManager to communicate to apexd." 2018-11-20 13:32:32 +00:00
Nicolas Geoffray
cf4d5265c2 Allow webview_zygote to JIT.
bug: 119800099
Test: device boots, no selinux denials
Change-Id: I737afbb4e826014fc91a68ac955199bb1d1a04c7
2018-11-20 13:31:49 +00:00
Hector Dearman
3fa4ac55aa Allow adb root to send config to perfetto
The perfetto binary (the frontend to traced) reads an input config
from stdin. This CL adds allows perfetto to read the config
from adb shell when the user is rooted

Sample denials:
avc: denied { read } for comm="perfetto" path="pipe:[92340]"
dev="pipefs" ino=92340 scontext=u:r:perfetto:s0 tcontext=u:r:su:s0
tclass=fifo_file permissive=0
avc: denied { read } for comm="perfetto" path="pipe:[92491]"
dev="pipefs" ino=92491 scontext=u:r:perfetto:s0 tcontext=u:r:su:s0
tclass=fifo_file permissive=0

Test: adb root
adb shell
echo 'duration_ms: 1000;' > /sdcard/config
cat /sdcard/config | perfetto --txt -c - -d

Change-Id: I12042dfa9a2c262cec907f0231ce2184f46d1be8
2018-11-20 10:05:45 +00:00
David Brazdil
95c8372b6d Merge "Remove 'dex2oat_exec' from untrusted_app" 2018-11-20 10:04:08 +00:00
David Brazdil
535c5d2be0 Remove 'dex2oat_exec' from untrusted_app
Remove the permission to execute dex2oat from apps targetSdkVersion>28.
This has been historically used by ART to compile secondary dex files
but that functionality has been removed in Q and the permission is
therefore not needed.

Some legacy apps do invoke dex2oat directly. Hence allow (with audit) for
targetSdkVersion<= 28.

Test: atest CtsSelinuxTargetSdk25TestCases
Test: atest CtsSelinuxTargetSdk27TestCases
Test: atest CtsSelinuxTargetSdkCurrentTestCases
Bug: 117606664
Change-Id: I2ea9cd56861fcf280cab388a251aa53e618160e5
2018-11-19 23:47:39 +00:00
Nick Kralevich
83f25e26f9 Revert "Add placeholder iris and face policy for vold data directory"
This reverts commit 92bde4b941.

Reason for revert: Rebooting after OTA fails due to the
filesystem still seeing the old label on the device.

Bug: 116528212
Bug: 119747564
Change-Id: Ib5f920f85c7e305e89c377369dca038d2c6c738c
Test: rollback change
2018-11-19 15:00:19 -08:00
Dario Freni
7ad743b7ed Allow PackageManager to communicate to apexd.
This is used for querying the installed packages, as well as
coordinating the installations of packages.

Test: ran an app that queries PM, that queries apexd.
Bug: 117589375
Change-Id: I38203ffe6d0d312d6cc38e131a29c14ace0ba10c
2018-11-19 22:05:21 +00:00
Lalit Maganti
41ddb80cd8 Merge "sepolicy: add rules for traced_probes to capture stderr and kill atrace on timeout" 2018-11-19 21:54:28 +00:00
Florian Mayer
0f3decf2f5 Property to enable heap profile from process startup.
This is world-readable so it can be checked in libc's process init.

Test: m
Test: flash sailfish

Bug: 117821125

Change-Id: Iac7317ceb75b5ad9cfb9adabdf16929263fa8a9d
2018-11-19 21:52:43 +00:00
Treehugger Robot
e80631ff53 Merge "Add new cpu variant related rules to SELinux" 2018-11-19 21:37:32 +00:00
Hongyi Zhang
d600c0c380 allow system_server to read device_config_reset_performed_prop
system server reads this property to keep track of whether server
configurable flags have been reset during current boot.
system server needs this information to decide whether to perform
following disaster recovery actions on framework level.

the get_prop added in this cl in system_server.te is not grouped
in the same place as the set_prop in system_server.te in another
cl (https://android-review.googlesource.com/c/platform/system/sepolicy/+/828284).
This is because these 2 properties are serving for different purposes:
device_config_flags_health_check_prop is used to control features(so will be
all the future set_prop added by other feature teams under "# server configurable flags properties"),
while device_config_reset_performed_prop is used by our API's internal implementation.
So I feel like it might be clearer if I put this get_prop in a different place rather than
appending to "# server configurable flags properties".

Test: build suceeded.

Change-Id: I64379aa8f0bbe093969b98d62093696a32aabe59
2018-11-19 18:52:14 +00:00
Haibo Huang
544a0d5480 Add new cpu variant related rules to SELinux
I added ro.bionic.(2nd_)?_(arch|cpu_variant) to vendor system
properties. And have init to write them to files under dev/.

This change set SELinux rules for these properties and files.

For the system properties: vendor/default.prop will set them. init will
read them.
For the files /dev/cpu_variant:.*: init will write them. bionic libc
will read them. (Basically world readable).

This is to allow libc select the right optimized routine at runtime.
Like memcpy / strcmp etc.

Test: getprop to make sure the properties are set.
Test: ls -laZ to make sure /dev/cpu_variant:.* are correctly labeled.

Change-Id: I41662493dce30eae6d41bf0985709045c44247d3
2018-11-19 18:29:36 +00:00
Hongyi Zhang
745d3839e4 Merge "sepolicies for sys prop enabling flag health check" 2018-11-19 17:48:55 +00:00
Nicolas Geoffray
99ce20e52e Merge "Allow zygote to JIT." 2018-11-18 19:14:15 +00:00
Treehugger Robot
39a39054fb Merge "Audit /dev access that might no longer be needed after Treble" 2018-11-18 15:17:51 +00:00
Nicolas Geoffray
6949a392b3 Allow zygote to JIT.
bug: 110870380
Test: device boots, artificially creating a rwx mapping in zygote works.

Change-Id: I81a32b616a68f186867af25528a0348d1ad73a50
2018-11-17 19:46:11 +00:00
Tri Vo
d918c8df78 Remove redundant cgroup type/labelings.
cgroup is labeled from genfs_contexts. Also, cgroup filesystems can't be
context mounted, i.e. it's not possible to mount them with a label other
than "cgroup".

Bug: 110962171
Test: m selinux_policy
Test: boot aosp_walleye
Change-Id: I8319b10136c42a42d1edaee47b77ad1698e87f2c
2018-11-17 01:24:49 +00:00
Tri Vo
fe14d483da Merge "Don't label /dev/cam from system sepolicy" 2018-11-17 01:12:02 +00:00
Tri Vo
3e09808915 Audit /dev access that might no longer be needed after Treble
Bug: 110962171
Test: boot aosp_walleye, aosp_blueline, no log spam from new audit
Change-Id: Ibeeb317e2cf15584395e3dbb73eb01b827e19a09
2018-11-16 17:05:16 -08:00
Treehugger Robot
c2f8f67bbf Merge "SEPolicy for InputFlinger Service." 2018-11-17 00:40:21 +00:00
Hongyi Zhang
da492f4fca sepolicies for sys prop enabling flag health check
device_config_flags_health_check_prop is used for enabling/disabling
program flags_health_check which is executed during device booting.
"1" means enabling health check actions in flags_health_check, other
values mean flags_health_check will not perform any action.

Test: build succeeded & manual test
Change-Id: I93739dc5d155e057d72d08fd13097eb63c1193b5
2018-11-17 00:09:36 +00:00
Treehugger Robot
6e92480d6c Merge "[SEPolicy] Name GPU service back to "gpu"" 2018-11-16 23:44:30 +00:00
Robert Carr
a49b27af44 SEPolicy for InputFlinger Service.
Add an InputFlinger service in system_server and allow SurfaceFlinger to
exchange sockets with it.

Test: None
Bug: 80101428
Bug: 113136004
Bug: 111440400
Change-Id: I1533ab7a1da0ca61d8a28037fffbc189d796f737
2018-11-16 21:52:01 +00:00
Tri Vo
ddda7e8020 Don't label /dev/cam from system sepolicy
With Treble, cameraserver no longer depends on camera devices directly.
Moreover, pixel 3 doesn't have /dev/cam node.

We still keep "camera_device" type around since vendor policy uses it to
label its /dev nodes.

Bug: 110962171
Test: boot aosp_walleye
Test: camera app still works
Change-Id: If12d640c2a0006b9fc3c9f6704285eb8eb66c626
2018-11-16 21:08:21 +00:00
Yiwei Zhang
174a025d06 [SEPolicy] Name GPU service back to "gpu"
Changed the GPU service name back to be compatible with external
engines/tools' usage of vkjson cmd.

Bug: 118347356
Test: adb shell cmd gpu vkjson
Change-Id: Ie432fd8be63d33070ad037c509467c8367b42d39
2018-11-16 12:58:35 -08:00
Nick Kralevich
fe4061da83 remove system_server debugfs:file r_file_perms
Auditallow added in commit 72edbb3e83 ("Audit generic debugfs access for
removal", May 01 2018) has not triggered. Remove allow rule and tighten
up neverallow rule.

Test: policy compiles
Test: no collected SELinux denials.
Change-Id: I9a90463575f9eab4711b72d6f444fa9d526b80e1
2018-11-16 11:29:44 -08:00
Treehugger Robot
6567cc2653 Merge "Further protect app private data files" 2018-11-16 15:50:59 +00:00
Lalit Maganti
d6ae1a5e42 sepolicy: add rules for traced_probes to capture stderr and kill atrace on timeout
This CL adds rules to allow traced_probes to dup a pipe as the stderr
for atrace and also send a sigkill to atrace after a timeout.

This fixes b/119656920

Change-Id: Ie66aaba47c11ef7c733b442f35fee042b7c546fb
2018-11-16 14:47:19 +00:00
Nick Kralevich
a194d3757a Tighten up handling of new classes
1b1d133be5 added the process2 class but
forgot to suppress SELinux denials associated with these permissions
for the su domain. Suppress them.

Ensure xdp_socket is in socket_class_set, so the existing dontaudit rule
in su.te is relevant. Inspired by
66a337eec6

Add xdp_socket to various other neverallow rules.

Test: policy compiles.
Change-Id: If5422ecfa0cc864a51dd69559a51d759e078c8e7
2018-11-16 03:10:14 -08:00
Nick Kralevich
598a75c11d Further protect app private data files
Remove the special case that allowed init to relabel app_data_file and
privapp_data_file. The auditallow added in
ab82125fc8 has never triggered.

Bug: 80190017
Test: policy compiles
Test: no SELinux denials collected for the auditallow rule
Change-Id: Ide7c31e1a0628464ec2fcf041e8975087c39166d
2018-11-16 01:03:11 -08:00
Treehugger Robot
118a106c63 Merge "Add placeholder iris and face policy for vold data directory" 2018-11-16 04:15:35 +00:00
Kevin Chyn
92bde4b941 Add placeholder iris and face policy for vold data directory
Test: vold is able to create directories, ag/5534962

Bug: 116528212

Change-Id: I61dd8802c13b1c42d334a80b678ca6a877848fc2
2018-11-15 17:32:03 -08:00
Tri Vo
a289d523ea Move coredomains rules from private/domain.te to private/coredomain.te
We lose git history with this, but imo the rules being moved don't have
much reference material. Also, as we write more neverallow rules for
CKI, I'd like to consolidate them in private/coredomain.te

Test: m selinux_policy
Change-Id: I6d0c3d2af0c4dfe7dd3cb1d8836b4b5e00db37a4
2018-11-15 15:15:53 -08:00
Treehugger Robot
3868557d0c Merge "Incidentd gets statsd incident section" 2018-11-15 21:44:27 +00:00
Tri Vo
c7f56cdc83 Remove kmem_device selinux type.
kmem_device was used to label /dev/mem and /dev/kmem. We already have
multiple layers of protection against those /dev nodes being present on
devices.

CTS checks that /dev/mem and /dev/kmem don't exist:
https://android.googlesource.com/platform/cts/+/master/tests/tests/permission/src/android/permission/cts/FileSystemPermissionTest.java#233

VTS enforces our base kernel configs, which have CONFIG_DEVKMEM and
CONFIG_DEVMEM disabled:
https://android.googlesource.com/kernel/configs/+/master/android-4.9/android-base.config#2

Bug: 110962171
Test: m selinux_policy
Change-Id: I246740684218dee0cddf81dabf84d4763a753cde
2018-11-15 21:31:56 +00:00
Treehugger Robot
fb79404e3a Merge "allow apps tun_device ioctl TUNGETIFF;" 2018-11-15 21:06:26 +00:00
Treehugger Robot
46522131db Merge "Allow dumpstate to call gpuservice over binder" 2018-11-15 15:54:41 +00:00
Mårten Kongstad
f62362da52 Add idmap2 and idmap2d
Bug: 78815803
Test: builds, boots
Test: manual: adb shell idmap2 create ...
Test: manual: adb shell ps | grep -e idmap2d
Change-Id: I60852e15d99329896ff9de6559d1e7cd1c67e33d
2018-11-15 14:42:10 +00:00
Nick Kralevich
3b2df198d1 allow apps tun_device ioctl TUNGETIFF;
Commit 619c1ef2ac ("tun_device: enforce
ioctl restrictions") completely removed the ability of untrusted apps to
issue ioctl calls to tun_device. It turns out that this was too
aggressive. Wireshark apparently uses the TUNGETIFF ioctl.

Fixes the following denial:

audit(0.0:384744): avc: denied { ioctl } for comm=4173796E635461736B202332 path="/dev/tun" dev="tmpfs" ino=19560 ioctlcmd=54d2 scontext=u:r:untrusted_app:s0:c51,c257,c512,c768 tcontext=u:object_r:tun_device:s0 tclass=chr_file permissive=1 app=com.wireguard.android

Test: policy compiles.
Change-Id: I71bb494036ea692781c00af37580748ab39d1332
2018-11-15 06:14:07 -08:00
Tomasz Wasilczyk
2e23af5e28 Allow iw to be run at init phase.
This enables native wireless interface configuration at boot.

Bug: 36120314
Test: adb shell ifconfig -a | grep wlan
Change-Id: I797c0c8a8645d690d311f42cec3998b2f4cee77b
2018-11-14 19:10:12 +00:00
Florian Mayer
45f4847c21 Add userdebug selinux config for heapprofd.
Test: m
Test: flash sailfish
Test: profile system_server

Change-Id: I577793af655146ee91be86bb286fcf9d6e6d081d
2018-11-14 09:22:07 +00:00
Risan
0c1848b170 SELinux changes for AppFuse
We are moving AppFuse mount from system_server's mount namespace to
vold. Hence, we could reduce the SELinux permissions given to
system_server, in the expense of adding allow rules to vold and
letting appdomain have access to vold's fd.

Bug: 110379912
Test: testOpenProxyFileDescriptor passes (after vold and
system_server code changes)

Change-Id: I827a108bd118090542354360a8c90b295e6a0fef
2018-11-13 22:45:51 +00:00
Joel Galenson
7c275a6b9d Allow dumpstate to call gpuservice over binder
This prevents denials while taking a bugreport.

Bug: 116711254
Test: cts-tradefed run cts -m CtsSecurityHostTestCases -t
android.security.cts.SELinuxHostTest#testNoBugreportDenials

Change-Id: I65dffda9806e0d627978ffdd392e3deb625149b7
2018-11-13 12:36:30 -08:00
Bookatz
d2f3d18fcd Incidentd gets statsd incident section
There is now an incident section for statsd output data. These selinux
changes must be made for incident to call dump on statsd to get the
data.

Bug: 115678461
Test: adb shell incident -b 3023
and confirm that a valid statsd section is obtained

Change-Id: I761389c160ab3ab6c24556813a1a31088c0f5137
2018-11-13 09:18:34 -08:00
Tri Vo
ced1751e45 Remove mtd_device type.
mtd_device does not label any /dev node present on walleye, and the only
permission to that type is:
allow hal_telephony_server mtd_device:dir search;
I suspect there is no need to keep mtd_device around.

Bug: 110962171
Test: boot aosp_walleye
Change-Id: If74b1258b21edeca38c8b7dc07a3a10b751a7e85
2018-11-12 23:11:03 +00:00
Treehugger Robot
ca5b01b0a6 Merge "Remove dead *_device types from system sepolicy." 2018-11-12 22:29:32 +00:00
Eugene Susla
c496db327e Add SELinux service for RoleManagerService
Test: ensure no build failures;
add RoleManagerService as a boot phase
ensure no SecurityException in logcat on boot
Change-Id: Ia0803c0fb084fe2b12f5c20f5e46354d0dd1aedf
2018-11-12 17:10:59 +00:00
Nick Kralevich
049c03d8c5 bluetooth: allow TUNGETIFF TUNSETIFF
system/sepolicy commit 619c1ef2ac started
enforcing ioctl whitelisting requirements for /dev/tun. Bluetooth needs
the ability to issue TUNSETIFF on /dev/tun, so allow access. We also
allow access to TUNGETIFF for good measure.

Addresses the following denial:

avc: denied { ioctl } for comm=425420536572766963652043616C6C path="/dev/tun" dev="tmpfs" ino=20047 ioctlcmd=0x54ca scontext=u:r:bluetooth:s0 tcontext=u:object_r:tun_device:s0 tclass=chr_file permissive=0

Test: policy compiles
Change-Id: Ie4c138fc774373cec266c59de6663db147d60423
2018-11-10 09:03:10 -08:00
Tri Vo
b805adaa16 Remove dead *_device types from system sepolicy.
No coredomain domain has access to these types and corresponding /dev
nodes don't exist on the device:

audio_seq_device
audio_timer_device
full_device
i2c_device
vcs_device

Bug: 110962171
Test: m selinux_policy
Test: boot walleye
Change-Id: I89ad4755e6760aa166cb22e2655567e5905dc672
2018-11-09 15:45:59 -08:00
Hongyi Zhang
b965e3c5f9 Sepolicies for server configural flags reset
Test: m -j succeeded and manual tested on device

Change-Id: I3415c58335361a9da4ef2368e61bc4e0250a91bb
2018-11-09 18:55:55 +00:00
Mårten Kongstad
f40942ffd8 Add rules for /product{,_services}/overlay
These rules mirror those for /vendor/overlay and /odm/overlay, including
the possilibity of a symlink like /system/vendor -> /vendor.

Test: builds, boots
Change-Id: I323e48fcc13c4ac7779902506539c2600708cc88
2018-11-09 15:49:55 +00:00
Peiyong Lin
7924dc6054 [SEPolicy] Configure policy for gpu service.
Historically GPU service lives in SurfaceFlinger as a convenient hack.
Howerver, SurfaceFlinger doesn't need to know about anything specific about GPU
capability, and shouldn't know about anything about GPU. This patch moves GPU
service out of SurfaceFlinger.

GPU service is a service that accesses to GPU driver, queries GPU capabilities
and reports back. Currently we use this information in CTS and some benchmarks.

BUG: 118347356
Test: Build, flash and boot, use `adb shell cmd gpu vkjson` to verify
Change-Id: I007989e0f3f73b5caf80277979986820dd127c32
2018-11-08 12:31:11 -08:00
Treehugger Robot
ac6352d818 Merge "Allow bufferhub service to allocate buffer" 2018-11-08 19:41:54 +00:00
Treehugger Robot
e3c52b6934 Merge "Allow adbd to read perfetto_traces_data_file." 2018-11-08 18:29:30 +00:00
Yabin Cui
e7f1354c58 Merge changes from topic "runas_exec"
* changes:
  Add runas_app domain to allow running app data file via run-as.
  Revert "Revert "Enforce execve() restrictions for API > 28""
2018-11-08 17:55:30 +00:00
Treehugger Robot
5faae3ae87 Merge "apexd_prop is defined for PRODUCT_COMPATIBLE_PROPERTY = false case" 2018-11-08 16:16:34 +00:00
Florian Mayer
f270aea66a Allow adbd to read perfetto_traces_data_file.
This allows to use adb pull on Perfetto traces on user.

Bug: 118747482

Change-Id: Ie4deed90597b412ccb0e9e6512ffed2acead82d8
2018-11-08 16:13:55 +00:00
Martijn Coenen
6a62606115 Merge changes Ie0396d59,I75b2bade
* changes:
  Allow apexd to configure /sys/block/dm-
  Allow the kernel to access apexd file descriptors.
2018-11-08 15:28:53 +00:00
Martijn Coenen
341476d455 Allow apexd to configure /sys/block/dm-
To configure readahead for APEX dm-verity devices.

Bug: 117823094
Test: apexd can change readahead
Change-Id: Ie0396d59ef758ad55f499f65957697d26a48aae9
2018-11-08 13:58:41 +01:00
Martijn Coenen
ac2b2d44b3 Allow the kernel to access apexd file descriptors.
In earlier kernel versions (<4.0), the loopback driver issues
requests from a kernel thread. Therefore, the kernel needs access
to APEX file descriptors and data files (which are loopback
mounted).

Bug: 119220815
Test: mounting works on sailfish
Change-Id: I75b2bade41c64cf6fa6040d9c2f5489a206e04c6
2018-11-08 11:22:48 +01:00
Tomoharu Kasahara
0a65041cba Allow audioserver to access persist.log.tag
Bug: 113756665
Test: adb shell getprop shows
persist.log.tag.APM_AudioPolicyManager

Change-Id: Id9363718a14c797de3fa146d2d0c34ee860bcdb6
2018-11-08 19:01:47 +09:00
Jiyong Park
b14c1a9674 apexd_prop is defined for PRODUCT_COMPATIBLE_PROPERTY = false case
apexd_prop is also defined in private/propery_contexts in order to make
the type to exist even when PRODUCT_COMPATIBLE_PROPERTY is false (i.e.,
Pixel 1).

Bug: 119220815
Test: m plat_property_contexts for sailfish
the built plat_property_contexts has apexd_prop defined

Change-Id: I9ef71410533c1f64fc6a3112cfcb199d23aaf3db
2018-11-08 11:29:01 +09:00
Kevin Chyn
52261e78c0 Add placeholder sepolicy for iris and face
See aosp/660242 and aosp/608396

Fixes: 116530289

Test: builds
Change-Id: I220ece0d6751839fe764ff91fd7bd20c50104f8f
2018-11-07 14:11:56 -08:00
Fan Xu
1e58323f94 Allow bufferhub service to allocate buffer
Test: build passed.
Bug: 118614333
Change-Id: I3b33d73a2cc7e78119de8b0913b4e2d0ac4a3235
2018-11-07 13:57:55 -08:00
Fan Xu
05668e4071 Merge "Remove buffer_hub_service compat mapping" 2018-11-07 18:27:05 +00:00
Yabin Cui
ffa2b61330 Add runas_app domain to allow running app data file via run-as.
Calling execve() on files in an app's home directory isn't allowed
for targetApi >=29. But this is needed by simpleperf to profile
a debuggable app via run-as.
So workaround it by adding runas_app domain, which allows running
app data file. And add a rule in seapp_contexts to use runas_app
domain for setcontext requests from run-as.

Bug: 118737210
Test: boot marlin and run CtsSimpleperfTestCases.
Change-Id: I5c3b54c95337d6d8192861757b858708174ebfd5
2018-11-07 18:11:40 +00:00
Yabin Cui
5dc2c8c740 Revert "Revert "Enforce execve() restrictions for API > 28""
This reverts commit 15d1a12f7f.

Bug: 118737210
Bug: 112357170
Test: boot marlin
Change-Id: Idcfab04b48f843eead4efa9f58a1337c6685c6ca
2018-11-07 18:07:18 +00:00
Tri Vo
2bb0085dbd Merge "Don't label /dev/{ akm8973.* accelerometer } from system sepolicy" 2018-11-06 22:43:49 +00:00
Tri Vo
fe39ed33dc Don't label /dev/{ akm8973.* accelerometer } from system sepolicy
These /dev nodes are device-specific and should be labeled from device
policy. Moreover, pixels don't have these /dev nodes.

Bug: 110962171
Test: boot pixel 3
Change-Id: I37ca9a956130eb4763c75f5e8a0decbd4f7b97a7
2018-11-06 10:20:50 -08:00
Fan Xu
2d74a45f76 Remove buffer_hub_service compat mapping
As b/116344577 is fixed, we no longer need the compatbility mapping any
more.

Test: build passed. Boot succeeded.
Change-Id: I0d7f02c59853d34bdabaad6841d87e9ca1ee25d7
2018-11-06 10:11:47 -08:00
Felipe Leme
5bf0c6369b New service: intelligence_service
Bug: 111276913
Test: manual verification

Change-Id: Icb309bb07e4e4b39cdc912b1d3dc1ece9cb55f5f
2018-11-05 09:18:03 -08:00
Treehugger Robot
5c48444346 Merge "Update access_vectors" 2018-11-02 19:46:37 +00:00
Nick Kralevich
ced51ddd7c Merge "tun_device: enforce ioctl restrictions" 2018-11-02 12:21:04 +00:00
Jiyong Park
b3b94614f7 apexd exports its status via sysprop
A sysprop apexd.status is set by apexd, to that other components (i.e.
init) can determine whether APEXs are all successfully mounted or no
(i.e., being mounted).

The sysprop is only writable by apexd.

Bug: 117403679
Test: adb shell getprop apexd.status returns 'ready'.
Change-Id: I81bcb96e6c5cb9d899f29ffa84f91eab3820be25
2018-11-02 12:23:42 +09:00
Nick Kralevich
ea1775dcb5 Update access_vectors
Update access_vectors to support newer kernel functionality.
This change does not grant any new access.

Inspired by the following refpolicy commits:
* 25a5b24274
* 109ab3296b
* 437e48ac53

Bug: 118843234
Test: policy compiles
Change-Id: I7c5a8dcf288dc2321adcf368bd0c0573c5257202
2018-11-01 19:53:50 -07:00
Nick Kralevich
619c1ef2ac tun_device: enforce ioctl restrictions
Require all SELinux domains which have permission to perform ioctls on
/dev/tun explicitly specify what ioctls they perform. Only allow the
safe defaults FIOCLEX and FIONCLEX, which are alternate, uncommon ways
to set and unset the O_CLOEXEC flag.

Remove app's ability to issue *any* ioctls on /dev/tun, period. Add
neverallow assertions (compile time assertion + CTS test) to prevent
regressions.

Limit system_server's ability to perform ioctls on /dev/tun to FIOCLEX,
FIONCLEX, TUNGETIFF, and TUNSETIFF. Testing and source code examination
shows that only TUNGETIFF and TUNSETIFF are used by system_server.

The goal of this change is to put SELinux ioctl controls in place for
/dev/tun, so we don't have to maintain the custom kernel patch at
11cee2be0c%5E%21

Delete the neverallow assertion in isolated_app.te. This is already
covered by the assertion present in app_neverallows.te.

Test: cts-tradefed run cts -m CtsHostsideNetworkTests -t com.android.cts.net.HostsideVpnTests
Test: cts-tradefed run cts -m CtsHostsideNetworkTests
Test: cts-tradefed run cts -m CtsNetTestCases
Bug: 111560739
Bug: 111560570
Change-Id: Ibe1c3a9e880db0bee438535554abdbc6d84eec45
2018-11-01 12:13:27 -07:00
Hongyi Zhang
a6f989241b sepolicy for server configurable flags
Test: manual on device
Change-Id: Ibafe1b345489c88a49a7ed3e2e61e5cc5e1880a1
2018-11-01 03:28:56 +00:00
Nick Kralevich
00252207f8 isolated_app: add mmaps
Kernel commit 3ba4bf5f1e2c ("selinux: add a map permission check for mmap")
added a map permission check on mmap so that we can
distinguish memory mapped access (since it has different implications
for revocation). system/sepolicy commit
4397f08288 introduced the permission to
Android and updated common macros. Since then, we've been adding more
mmap support where it was accidentally omitted.

Add the ability for isolated_apps to mmap() app data files. There's no
reason why this should be blocked. Also fixup sdcard access which has
similar problems.

Bug: 118760652
Bug: https://crbug.com/892014
Test: policy compiles.
Change-Id: I3823f313103c9dcedf3b21d081a22f8fbb271c02
2018-10-31 12:55:01 -07:00
Nick Kralevich
caf42d615d Transient SELinux domain for system_server JIT
Create a transient SELinux domain where system_server can perform
certain JIT setup. The idea is that system_server will start in the
system_server_startup domain, setup certain JIT pages, then perform a
one-way transition into the system_server domain. From that point,
further JITing operations are disallowed.

Bug: 62356545
Test: device boots, no permission errors
Change-Id: Ic55b2cc5aba420ebcf62736622e08881a4779004
2018-10-31 12:32:01 +00:00
Treehugger Robot
29db0ebf3d Merge "Revert "Enforce execve() restrictions for API > 28"" 2018-10-31 09:31:02 +00:00
Nick Kralevich
15d1a12f7f Revert "Enforce execve() restrictions for API > 28"
This reverts commit 0dd738d810.

Reason for revert: CtsSimpleperfTestCases CTS test case failures.
See b/118704604 for details.

Bug: 112357170
Bug: 118704604
Change-Id: Ibe921f3bbc3404694542ef695883c1a30777d68b
2018-10-31 03:40:13 +00:00
Nick Kralevich
c4cf98605d Revert "SELinux changes for AppFuse"
This reverts commit 67ed4328eb.

Reason for revert: Broken CTS test. See b/118642091

Bug: 118642091
Bug: 110379912
Change-Id: I5afd16bf23149c74f2740720cdd248a255ff1497
2018-10-30 03:30:55 +00:00
Treehugger Robot
581e6c471c Merge "Enforce execve() restrictions for API > 28" 2018-10-29 21:07:36 +00:00
Nick Kralevich
0dd738d810 Enforce execve() restrictions for API > 28
untrusted_app: Remove the ability to run execve() on files within an
application's home directory. Executing code from a writable /home
directory is a W^X violation (https://en.wikipedia.org/wiki/W%5EX).
Additionally, loading code from application home directories violates a
security requirement that all executable code mapped into memory must
come from signed sources, or be derived from signed sources.

Note: this change does *not* remove the ability to load executable code
through other mechanisms, such as mmap(PROT_EXEC) of a file descriptor
from the app's home directory. In particular, functionality like
dlopen() on files in an app's home directory continues to work even
after this change.

untrusted_app_25 and untrusted_app_27: For backwards compatibility,
continue to allow these domains to execve() files from the
application's home directory.

seapp_contexts: Bump the minimum API level required to enter the
untrusted_app domain. This will run API level 27-28 processes in
the API level 27 sandbox. API level 28 will continue to run with
levelFrom=all, and API level 27 will continue to run with
levelFrom=user.

Bug: 112357170
Test: Device boots and no obvious problems.
Test: See CTS test at https://android-review.googlesource.com/c/platform/cts/+/804228
Change-Id: Ief9ae3a227d16ab5792f43bacbb577c1e70185a0
2018-10-29 09:24:09 -07:00
Nick Kralevich
e1ddd741de drop priv_app app_data_file:file execute;
system/sepolicy commit 23c9d91b46
introduced a new type called privapp_data_file. This type is used to
label priv-app's /home files. For backwards compatibility, priv-app
rules involving normal app_data_files were preserved. Subsequently,
system/sepolicy commit 5d1755194a
assigned the file label privapp_data_file to /home files owned
by priv-apps.

Because of the previous labeling of priv-app data files, priv-apps were
granted the ability to mmap(PROT_EXEC) any other app's /home files,
regardless of how trustworthy or untrustworthy those files were. Commit
23c9d91b46 preserved the status quo.
However, now that we have a more refined label for priv-app /home files,
we no longer need to be as permissive.

Drop the ability for priv-apps to map executable code from
untrusted_apps home directories. "execute" is removed in this change,
and "execute_no_trans" was previously removed in commit
8fb4cb8bc2. Add a neverallow assertion
(compile time assertion + CTS test) to prevent regressions.

Further clarify why we need to support priv-apps loading executable code
from their own home directories, at least for now. b/112037137 covers
further tightening we can do in this area.

Bug: 112357170
Test: Device boots and no problems.
Change-Id: Ia6a9eb4c2ed8a02ad45644d025181ba3c8424cda
2018-10-27 15:20:38 -07:00
Treehugger Robot
de8dfc752c Merge "Switch to r_file_perms" 2018-10-26 22:51:47 +00:00
Nick Kralevich
0bfa7b5385 Switch to r_file_perms
The current rule is missing mmap. r_file_perm implicitly adds mmap, so
we should just use that instead.

Test: policy compiles.
Change-Id: I4051d1eb4c36a2b6ff2b5f26ce53355287cbe2b4
2018-10-26 13:25:51 -07:00
Risan
67ed4328eb SELinux changes for AppFuse
We are moving AppFuse mount from system_server's mount namespace to
vold. Hence, we could reduce the SELinux permissions given to
system_server, in the expense of adding allow rules to vold and
letting appdomain have access to vold's fd.

Bug: 110379912
Test: testOpenProxyFileDescriptor passes (after vold and
system_server code changes)

Change-Id: I4731a8ec846c5cb84ec4b680d51938494e8ddd75
2018-10-26 19:45:50 +00:00
Tri Vo
3eae9de2e8 Merge "same_process_hal_file: access to individual coredomains" 2018-10-26 18:03:13 +00:00
Tri Vo
90cf5a7fb3 same_process_hal_file: access to individual coredomains
Remove blanket coredomain access to same_process_hal_file in favor of
granular access. This change takes into account audits from go/sedenials
(our internal dogfood program)

Bug: 37211678
Test: m selinux_policy
Change-Id: I5634fb65c72d13007e40c131a600585a05b8c4b5
2018-10-26 18:03:01 +00:00
Tri Vo
5292449e3d Merge "Don't label /dev/tegra.* from core policy" 2018-10-26 18:02:30 +00:00
Jiyong Park
173a1d9add Allow apexd more ioctl cmds for loop devices
apexd is using following additional ioctl cmds to mount the mini
filesystem inside APEXs:

 LOOP_SET_STATUS64
 LOOP_SET_FD
 LOOP_SET_BLOCK_SIZE
 LOOP_SET_DIRECT_IO
 LOOP_CLR_FD

Test: m; m apex.test; adb push <the_built_apex> /data/apex; adb reboot

/apex/com.android.example.apex exists

Change-Id: I68388cc4f323e4fcff370c8cdc0958cbd827e9cc
2018-10-26 21:33:29 +09:00
Tri Vo
2ea956c03b Don't label /dev/tegra.* from core policy
/dev/tegra.* is not used in android platform and is device-specific

Bug: 110962171
Test: boot walleye
Change-Id: I4cc790d28457b429a3ed9829de223dae357eb498
2018-10-26 02:33:51 +00:00
Jiwen 'Steve' Cai
d5c5ef900c Sepolicy for bufferhub hwservice
Bug: 118124442
Test: device can boot with android.frameworks.bufferhub@1.0-service
      running
Change-Id: I1d186d5350671b0d2dd4e831429b8fba828316e0
2018-10-25 10:08:05 -07:00
Anton Hansson
564eb9d6d6 Merge "Properly escape dots in file_contexts filenames" 2018-10-25 11:25:17 +00:00
Treehugger Robot
554f18163a Merge "sepolicy: Allow apps to get info from priv_app by ashmem" 2018-10-24 18:02:23 +00:00
Anton Hansson
854adfd6a8 Merge "Add sepolicy for preloads_copy script" 2018-10-24 17:09:11 +00:00
Tom Cherry
fc1980eb8a Merge "Combine vendor-init-actionable with vendor-init-readable" 2018-10-24 15:52:06 +00:00
Anton Hansson
c6742dbbf9 Properly escape dots in file_contexts filenames
I found these with the regex (?<!\\)\.(?!\*|\+)

Test: make
Change-Id: I1c2e817d164b1074cb359cdb6d46bcf71e220765
2018-10-24 14:50:22 +01:00
Tom Cherry
30dd711157 Combine vendor-init-actionable with vendor-init-readable
Historically, vendor-init-actionable was created since the various
property_contexts files were not yet available when init parses its
scripts.  Since then, the property_contexts files are now always
available when init parses its scripts, so we can collapse these two
categories.

Specifically, this change ensures that all of the properties in the
previous 'stable_properties.h' file in init, which contained the
vendor-init-actionable properties, are able to be read by init
according to SEPolicy.

Bug: 71814576
Test: vendor_init fails to use non-readable properties as a trigger
Test: vendor_init successfully uses readable properties as a trigger

Change-Id: Ic6d9919b6047f3076a1a19fc26295c6a77aca627
2018-10-24 01:58:32 +00:00
Sudheer Shanka
95767cce45 Track vrcore_app SELinux denial
Bug: 118185801
Test: bug no. appears in the denial logs
Change-Id: Ib1d1bbbdf25e0e63ac8a7dec98aca08cafc3f870
2018-10-23 12:19:27 -07:00
Anton Hansson
edd13bc3b2 Add sepolicy for preloads_copy script
Copied from device/google/crosshatch-sepolicy.

Test: diff files in system/etc/selinux before and after for aosp_marlin
Change-Id: I518c43af9c217483bdab02424e4aef0270aad366
2018-10-23 17:11:36 +01:00
ji, zhenlong z
fdfa42bf29 sepolicy: Allow apps to get info from priv_app by ashmem
This is used to address a CTS testcase failure. This CTS
testcase need to access the content of Contact, some data
from ContactProvider is transfered through ashmem.

Currently ashmem is backed by the tmpfs filesystem, ContactProvider
in android run as a priv_app, so the file context of the ashmem
created by ContactProvider is priv_app_tmpfs. CTS runs as an
untrusted_app, need to be granted the read permission to the
priv_app_tmpfs files.

Bug: 117961216

[Android Version]:
android_p_mr0_r0

[Kernel Version]:
4.19.0-rc8

[CTS Version]:
cts-9.0_r1

[Failed Testcase]:
com.android.cts.devicepolicy.ManagedProfileTest#testManagedContactsPolicies

[Error Log]:
11-11 11:15:50.479 12611 12611 W AndroidTestSuit: type=1400 audit(0.0:811):
avc: denied { read } for path=2F6465762F6173686D656D202864656C6574656429
dev="tmpfs" ino=174636 scontext=u:r:untrusted_app:s0:c113,c256,c522,c768
tcontext=u:object_r:priv_app_tmpfs:s0:c522,c768 tclass=file permissive=0

[Test Result With This Patch]:
PASS

Change-Id: I45efacabe64af36912a53df60ac059889fde1629
2018-10-23 12:37:03 +08:00
Treehugger Robot
faba431221 Merge "priv_app: remove /proc/net access" 2018-10-22 17:33:48 +00:00
Nick Kralevich
674b168480 start enforcing ioctl restrictions on blk_file
am: 4c8eaba75a

Change-Id: Ic97b8aafa7f6edcf54e08230905b34500fbe677e
2018-10-19 00:00:42 -07:00
Nick Kralevich
acb41aca25 Move class bpf definition
am: f5a1b1bfa9

Change-Id: Idd4890670d766d71d4b2f6feb0066993ca079b90
2018-10-18 23:58:19 -07:00
Jiyong Park
6d474849e8 Allow apexd to realpath(3) on apex_key_files
am: ecc09871ba

Change-Id: I43f3d98669537d24879f3a734e2684968813e148
2018-10-18 23:46:29 -07:00
Nick Kralevich
4c8eaba75a start enforcing ioctl restrictions on blk_file
Start enforcing the use of ioctl restrictions on all Android block
devices. Domains which perform ioctls on block devices must be explicit
about what ioctls they issue. The only ioctls allowed by default are
BLKGETSIZE64, BLKSSZGET, FIOCLEX, and FIONCLEX.

Test: device boots and no problems.
Change-Id: I1195756b20cf2b50bede1eb04a48145a97a35867
2018-10-18 15:24:32 -07:00
Nick Kralevich
dfc3c33689 priv_app: remove /proc/net access
Remove most of /proc/net access for priv_apps. Files in /proc/net leak
unique device identifiers and side channel information about other app's
network connections.

Access for most third party applications was removed in commit
d78e07cbb7. This change applies the same
constraints to priv-apps that we apply to normal apps.

Bug: 114475727
Bug: 9496886
Bug: 68016944
Test: policy compiles and device boots
Change-Id: I5c41ba57fcd6b81d72c4f3a40b310d2188fc79c3
2018-10-18 09:44:50 -07:00
Nick Kralevich
f5a1b1bfa9 Move class bpf definition
No functional change. This reorg just makes it easier to perform diffs
against https://github.com/SELinuxProject/refpolicy/blob/master/policy/flask/access_vectors

Test: policy builds.
Change-Id: I10cf9547d57981c76ee7e76daa382bb504e36d0b
2018-10-18 09:08:26 -07:00
Jiyong Park
ecc09871ba Allow apexd to realpath(3) on apex_key_files
apexd uses realpath(3) to ensure that the public key file that will use
is under /system/etc/security/apex directory. In order to support it,
allow apexd to getattr on apex_key_files.

The canonicalization is required because the key name from APEX might be
wrong. For example, if the key name from an APEX is '../../some/path'
then apexd will use '/system/etc/security/apex/../../some/path' as the
public key file, which is incorrect.

Bug: 115721587
Test: m apex.test; m
/apex/com.android.example.apex@1 exists

Change-Id: I6dc5efa0de369f8497e4f6526e0164e2de589c67
2018-10-18 20:39:37 +09:00
Nick Kralevich
f00935a550 mediaprovider: add functionfs ioctl
am: a73f58aee1

Change-Id: I573c72eb0795862a498772e74cb7f230876fa914
2018-10-17 14:02:36 -07:00
Nick Kralevich
a73f58aee1 mediaprovider: add functionfs ioctl
Addresses the following denial:

type=1400 audit(0.0:51894): avc: denied { ioctl } for comm="MtpServer" path="/dev/usb-ffs/mtp/ep1" dev="functionfs" ino=30291 ioctlcmd=0x6782 scontext=u:r:mediaprovider:s0:c512,c768 tcontext=u:object_r:functionfs:s0 tclass=file permissive=0 app=com.android.providers.media

Test: policy compiles.
Change-Id: I5290abb2848e5824669dae4cea829d4cbea98ab4
2018-10-17 10:14:40 -07:00
Dario Freni
84a010c48c Allow apexd to create symlink in /apex.
am: bab267a88f

Change-Id: I2ae046cd9434b983abe6366bd72e595b48ddfdf4
2018-10-17 09:32:41 -07:00
Dario Freni
bab267a88f Allow apexd to create symlink in /apex.
Bug: 115710947
Test: on device
Change-Id: Ie712689d80fb829f16de70e865cac4f0ff4e9b35
2018-10-17 11:25:02 +01:00
Bowgo Tsai
0a2efc1698 Merge "Allow input config to be under /vendor/odm"
am: 247f061a65

Change-Id: Ibec2927b80068cedc0c7ba7391e6fe53d9ae0892
2018-10-16 17:27:24 -07:00
Bowgo Tsai
591293111e Allow input config to be under /vendor/odm
Input config should be under /odm when it's "device-specific",
instead of /vendor (for "SoC-specific").

However, not all device have /odm partition so having the fallback
symlink: /odm -> /vendor/odm is important

Bug: 112880217
Test: build
Change-Id: I294e2b172d06d58a42c51c128e448c7644f854dc
2018-10-16 18:18:53 +08:00
Chong Zhang
c601d9e5a9 add media.codec.update service
am: 52fb3edbb6

Change-Id: I106c471e9251ec7a4f43b13103c429c3b4fc2476
2018-10-15 17:15:08 -07:00
Florian Mayer
40144ea2af Merge "Add heapprofd selinux config."
am: d5c62bfb41

Change-Id: Ie33eefd304941d2d4553eb35a91e174b2c3c859d
2018-10-15 14:21:32 -07:00
Chong Zhang
52fb3edbb6 add media.codec.update service
Add a service in mediaswcodec to load updated codecs,
and restrict it to userdebug/eng. Reuse existing
mediaextractor_update_service since the codec update
service is identical, this avoids adding a new one
for now as we may not need the service anymore
after switching to APEX.

Bug: 111407413
Bug: 117290290

Change-Id: Ia75256f47433bd13ed819c70c1fb34ecd5d507b4
2018-10-15 21:06:53 +00:00
Florian Mayer
4fde9ec7b3 Add heapprofd selinux config.
This does not actually grant any permissions but just adds the
necessary boilerplate for a new service.

Bug: 117762471
Bug: 117761873

Change-Id: I7cdd2ae368616cfd54fc685c15f775604bfc80d4
2018-10-15 18:31:26 +01:00
Tri Vo
3026dc738f Audit access to same_process_hal_file.
am: 81ade3dd1d

Change-Id: Ie3437cd699d16cbf72fca61c5646800d90feaa2a
2018-10-12 22:43:35 -07:00
Tri Vo
7151273060 Merge "Add type for /system/bin/tcpdump."
am: af9251539a

Change-Id: Ie51d95317f6613e086b2b80a5ca967779ab9eb32
2018-10-12 22:43:20 -07:00
Tri Vo
81ade3dd1d Audit access to same_process_hal_file.
same_process_hal_file is exempted from many Treble neverallows. We want
to know which processes access this type to eventually constrain access
to it.

Bug: 37211678
Test: m selinux_policy
Change-Id: I61c0df21250eb1b1ae2d9c5fa9c801a828539813
2018-10-13 05:27:03 +00:00
Tri Vo
e8b33c3139 Add type for /system/bin/tcpdump.
We add this type with the intent to expose /system/bin/tcpdump to
vendor on userdebug devices only.

Bug: 111243627
Test: device boots /system/bin/tcpdump correctly labeled as
tcpdump_exec, can browse internet, turn wifi on/off
Change-Id: Icb35e84c87120d198fbb2b44edfa5edf6021d0f0
2018-10-12 21:51:46 +00:00
Siarhei Vishniakou
c38d803278 Merge "Allow system_server to read vendor_file"
am: 25b4eb217c

Change-Id: I78ecee68fdc8dadf62b0c3977f01a0571a1bdc1f
2018-10-12 13:14:55 -07:00
Siarhei Vishniakou
3639f57960 Allow system_server to read vendor_file
Input device configuration files .idc, .kl that are placed in /vendor
are currently not accessible.
Allow the read access here.

Bug: 112880217
Test: move .idc and .kl files from /system to /vendor, then observe
logcat. With this patch, avc denials disappear.

Change-Id: I72ad62b9adf415f787565adced73fd8aaff38832
2018-10-12 02:42:09 +00:00
Chong Zhang
817027b055 Merge "add mediaswcodec service"
am: 9977e25411

Change-Id: Id64de9050f14d4f782dbdf6a9b695a52201e042e
2018-10-11 19:03:25 -07:00
Treehugger Robot
9977e25411 Merge "add mediaswcodec service" 2018-10-12 01:48:47 +00:00