sepolicy: Add sepolicies for foss

FOSS is part of hardware.graphics.composer process now. Earlier
it was part of  mm-pp-daemon process. So adding corresponding sepolicies
and removing obsolete sepolicies related to mm-pp-daemon.

Change-Id: I6b6f5995813ac268b90d3d7d4cee0ec7cb67f6f5
This commit is contained in:
Gurpreet Singh Dhami
2019-02-04 11:53:15 -05:00
committed by Gerrit - the friendly Code Review server
parent 33913c473f
commit 5a0a08ed0a
5 changed files with 11 additions and 82 deletions

View File

@@ -146,7 +146,6 @@
/vendor/bin/time_daemon u:object_r:time_daemon_exec:s0
/vendor/bin/imsrcsd u:object_r:hal_rcsservice_exec:s0
/vendor/bin/tloc_daemon u:object_r:tlocd_exec:s0
/vendor/bin/mm-pp-dpps u:object_r:mm-pp-daemon_exec:s0
/vendor/bin/hvdcp_opti u:object_r:hvdcp_exec:s0
/vendor/bin/hw/qcrild u:object_r:rild_exec:s0

View File

@@ -38,14 +38,14 @@ binder_call(hal_display_color_client, hal_display_color_server)
add_hwservice(hal_display_color_server, hal_display_color_hwservice)
allow hal_display_color_client hal_display_color_hwservice:hwservice_manager find;
# Rule for display color to access graphics composer process
unix_socket_connect(hal_display_color, pps, hal_graphics_composer_default);
# Rule for vndbinder usage
allow hal_display_color qdisplay_service:service_manager find;
vndbinder_use(hal_display_color);
binder_call(hal_display_color, hal_graphics_composer)
# Rule for pps socket usage
unix_socket_connect(hal_display_color, pps, mm-pp-daemon)
#Add rules for postproc hal
add_hwservice(hal_display_color_server, hal_display_postproc_hwservice)
allow hal_display_postproc_client hal_display_postproc_hwservice:hwservice_manager find;

View File

@@ -55,8 +55,6 @@ allow hal_graphics_composer_default graphics_device:chr_file rw_file_perms;
# HWC_UeventThread
allow hal_graphics_composer_default self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
# Rule for pps socket usage
unix_socket_connect(hal_graphics_composer_default, pps, mm-pp-daemon)
# Allow ion_device read/write permission
allow hal_graphics_composer_default ion_device:chr_file rw_file_perms;
@@ -71,10 +69,14 @@ userdebug_or_eng(`
allow hal_graphics_composer_default debugfs_mdp:file r_file_perms;
')
# Allow sensor service access
allow hal_graphics_composer fwk_sensor_hwservice:hwservice_manager find;
binder_call(hal_graphics_composer, system_server)
# allow composer to register display config
add_hwservice(hal_graphics_composer_server, hal_display_config_hwservice);
# allow composer client to find display config service.
allow hal_graphics_composer_client hal_display_config_hwservice:hwservice_manager find;
# Allow qdcmss socket access
unix_socket_connect(hal_graphics_composer_default, qdcmsocket, qdcm-ss)
unix_socket_connect(hal_graphics_composer_default, qdcmsocket, qdcm-ss)

View File

@@ -1,73 +0,0 @@
# Copyright (c) 2018, The Linux Foundation. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
type mm-pp-daemon, domain;
type mm-pp-daemon_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(mm-pp-daemon)
#Need to use fb ioctls to communicate with kernel
allow mm-pp-daemon graphics_device:chr_file rw_file_perms;
allow mm-pp-daemon graphics_device:dir r_dir_perms;
# Allow reading/writing data config files
allow mm-pp-daemon display_vendor_data_file:dir create_dir_perms;
allow mm-pp-daemon display_vendor_data_file:file create_file_perms;
# Allow read to sensor device and read/write to sensor socket
allow mm-pp-daemon sensors_device:chr_file r_file_perms;
allow mm-pp-daemon sensors:unix_stream_socket connectto;
# Allow read to display vendor properties
get_prop(mm-pp-daemon, vendor_display_prop)
# Rule for IPC communication
allow mm-pp-daemon qdisplay_service:service_manager find;
vndbinder_use(mm-pp-daemon)
hwbinder_use(mm-pp-daemon)
hal_client_domain(mm-pp-daemon, hal_graphics_composer)
allow mm-pp-daemon fwk_sensor_hwservice:hwservice_manager find;
binder_call(mm-pp-daemon, system_server)
# Allow mm-pp-daemon to change the brightness
allow mm-pp-daemon sysfs_leds:dir r_dir_perms;
allow mm-pp-daemon sysfs_leds:file rw_file_perms;
allow mm-pp-daemon sysfs_leds:lnk_file read;
allow mm-pp-daemon sysfs_graphics:dir r_dir_perms;
allow mm-pp-daemon sysfs_graphics:file rw_file_perms;
allow mm-pp-daemon sysfs_data:file r_file_perms;
# Allow socket calls in pp-daemon
unix_socket_connect(mm-pp-daemon, pps, init)
allow mm-pp-daemon init:unix_stream_socket { listen accept };
# Allow connections between sensor manager and mm-pp-daemon
#allow mm-pp-daemon system_server:unix_stream_socket rw_socket_perms;
# access lcd-backlight
r_dir_file(mm-pp-daemon, sysfs_leds)

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2018, The Linux Foundation. All rights reserved.
# Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -29,6 +29,8 @@ allowxperm system_server self:socket ioctl msm_sock_ipc_ioctls;
binder_call(system_server, hal_camera_default)
binder_call(system_server, hal_graphics_composer)
allow system_server persist_file:dir search;
allow system_server persist_sensors_file:dir search;
allow system_server persist_sensors_file:file r_file_perms;
@@ -37,7 +39,6 @@ allow system_server hal_audio_default:file w_file_perms;
allow system_server sysfs_sensors:dir search;
allow system_server sysfs_sensors:file rw_file_perms;
binder_call(system_server, mm-pp-daemon)
# allow access to low persistence mode sysfs node
allow system_server sysfs_graphics:file rw_file_perms;