sepolicy: WFD app sepolicy change

Because of the system UID removal from WFD app, give permissions to wfd
app instead of system app

Change-Id: Ic56db7fec69e1b16e761162ef0393cabb375de50
This commit is contained in:
Lubin Yin
2019-11-07 14:02:50 -08:00
committed by Gerrit - the friendly Code Review server
parent 1b462b2387
commit 40209bf7a9
7 changed files with 92 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2019, The Linux Foundation. All rights reserved.
# Copyright (c) 2019-2020, 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
@@ -28,3 +28,5 @@
#Add new domain for qti value added Location apps
user=_app seinfo=platform name=com.qualcomm.location.XT isPrivApp=true domain=vendor_location_app type=app_data_file
user=_app seinfo=platform name=com.qualcomm.location isPrivApp=true domain=vendor_location_app type=app_data_file
user=_app seinfo=platform name=com.qualcomm.wfd.service:wfd_service domain=vendor_wfd_app type=app_data_file
user=_app seinfo=platform name=com.qualcomm.wfd.client domain=vendor_wfd_app type=app_data_file

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2015, 2017, 2019, The Linux Foundation. All rights reserved.
# Copyright (c) 2015, 2017, 2019-2020, 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
@@ -40,19 +40,5 @@ get_prop(system_app, bluetooth_prop);
# allow system_app access to Workload Classifier Property
set_prop(system_app, vendor_wlc_prop);
#WFD
set_prop(system_app, vendor_wfd_service_prop);
userdebug_or_eng(`
get_prop(system_app, vendor_wfd_sys_debug_prop);
#Access to MM-OSAL debug prop for parser debugging on WFD sink
get_prop(system_app, vendor_mm_osal_prop);
#Allow access to logmask file in /data/
allow system_app system_data_file:file r_file_perms;
')
binder_call(system_app, vendor_wfdservice)
# allow access to read video SKU property for WFD sink
get_prop(system_app, vendor_sys_video_prop)
# allow system_app access to wigig Property
get_prop(system_app, vendor_wigig_core_prop);

54
qva/private/wfd_app.te Normal file
View File

@@ -0,0 +1,54 @@
# Copyright (c) 2020 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.
typeattribute vendor_wfd_app coredomain;
app_domain(vendor_wfd_app)
net_domain(vendor_wfd_app)
set_prop(vendor_wfd_app, vendor_wfd_service_prop);
userdebug_or_eng(`
get_prop(vendor_wfd_app, vendor_wfd_sys_debug_prop);
#Access to MM-OSAL debug prop for parser debugging on WFD sink
get_prop(vendor_wfd_app, vendor_mm_osal_prop);
#Allow access to logmask file in /data/
allow vendor_wfd_app system_data_file:file r_file_perms;
')
binder_call(vendor_wfd_app, vendor_wfdservice)
# allow access to read video SKU property for WFD sink
get_prop(vendor_wfd_app, vendor_sys_video_prop)
allow vendor_wfd_app vendor_wfdservice_service:service_manager find;
allow vendor_wfd_app audioserver_service:service_manager find;
allow vendor_wfd_app mediaserver_service:service_manager find;
allow vendor_wfd_app mediadrmserver_service:service_manager find;
# Access to /data/media for debug dump
allow vendor_wfd_app media_rw_data_file:dir create_dir_perms;
allow vendor_wfd_app media_rw_data_file:file create_file_perms;

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2017, 2019 The Linux Foundation. All rights reserved.
# Copyright (c) 2017, 2019-2020 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
@@ -41,7 +41,7 @@ binder_use(vendor_wfdservice)
binder_call(vendor_wfdservice, surfaceflinger)
#Allow apps to interact with vendor_wfdservice
binder_call(vendor_wfdservice, system_app)
binder_call(vendor_wfdservice, vendor_wfd_app)
#Allow access to Audio Flinger APIs
binder_call(vendor_wfdservice, audioserver)

28
qva/public/wfd_app.te Normal file
View File

@@ -0,0 +1,28 @@
# Copyright (c) 2020, 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 vendor_wfd_app, domain;

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2019 The Linux Foundation. All rights reserved.
# Copyright (c) 2019-2020 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
@@ -41,5 +41,5 @@ binder_call(vendor_wfdhdcphalservice_qti, vendor_wfdvndservice);
hal_client_domain(vendor_wfdhdcphalservice_qti, hal_graphics_composer)
#Allow to use fd from mediacodec and wfd app
allow vendor_wfdhdcphalservice_qti { mediacodec system_app }:fd use;
allow vendor_wfdhdcphalservice_qti { mediacodec vendor_wfd_app }:fd use;

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2019 The Linux Foundation. All rights reserved.
# Copyright (c) 2019-2020 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
@@ -46,7 +46,7 @@ binder_call(vendor_wfdvndservice, vendor_wfdhdcphalservice_qti);
r_dir_file(vendor_wfdvndservice, firmware_file)
#Allow for using fds
allow vendor_wfdvndservice { mediacodec system_app vendor_wfdhdcphalservice_qti}:fd use;
allow vendor_wfdvndservice { mediacodec vendor_wfd_app vendor_wfdhdcphalservice_qti}:fd use;
#Allow access to tee/ion device
allow vendor_wfdvndservice tee_device:chr_file rw_file_perms;