Add rules for qms daemon

Change-Id: Ifb54c1cfcdf231964530a3fe6e2785808cd6904a
This commit is contained in:
Pavan Kumar M 2023-03-16 14:10:53 +05:30 committed by Gerrit - the friendly Code Review server
parent b6acde700a
commit 43fa987fe0
8 changed files with 171 additions and 162 deletions

View file

@ -24,6 +24,12 @@
# 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.
#
# Changes from Qualcomm Innovation Center are provided under the following license:
#
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
type vendor_qdisplay_service, vndservice_manager_type;
type vendor_per_mgr_service, vndservice_manager_type;
type vendor_qfeatenab_client_service, vndservice_manager_type;
type vendor_qms_service, vndservice_manager_type;

View file

@ -24,6 +24,11 @@
# 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.
# Changes from Qualcomm Innovation Center are provided under the following license:
#
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
display.qservice u:object_r:vendor_qdisplay_service:s0
featenab_client.service u:object_r:vendor_qfeatenab_client_service:s0
vendor.qcom.PeripheralManager u:object_r:vendor_per_mgr_service:s0
vendor.qti.data.qmsservice.IQmsService u:object_r:vendor_qms_service:s0

View file

@ -24,7 +24,11 @@
# 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.
#
# Changes from Qualcomm Innovation Center are provided under the following license:
#
#Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
#SPDX-License-Identifier: BSD-3-Clause-Clear
# CTS test case CtsSecurityHostTestCases#testNoBugreportDenials
# tries to check the if there are any denials from
@ -46,3 +50,4 @@ allow dumpstate vendor_hal_neuralnetworks_default:process signal;
binder_call(dumpstate, hal_light_default)
binder_call(dumpstate, hal_power_default)
binder_call(dumpstate, vendor_qms)

View file

@ -27,37 +27,8 @@
# Changes from Qualcomm Innovation Center are provided under the following license:
#
# Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the
# disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
# GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
# HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
#QTI file types
type vendor_qti_data_file, file_type, data_file_type;
@ -186,3 +157,6 @@ type vendor_dpm_vndr_data_file, file_type, data_file_type ;
type vendor_qesd_socket, file_type;
type vendor_sysfs_usb_node, fs_type, sysfs_type;
#qms
type vendor_qms_vndr_data_file, file_type, data_file_type;

View file

@ -25,40 +25,10 @@
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Changes from Qualcomm Innovation Center are provided under the following
# license:
# Changes from Qualcomm Innovation Center are provided under the following license:
#
# Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the
# disclaimer below) 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 Qualcomm Innovation Center nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
# GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
# HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
###################################
#Dev nodes
@ -186,6 +156,7 @@
/(vendor|system/vendor)/bin/hw/sxrservice u:object_r:vendor_sxrd_vndr_exec:s0
/vendor/bin/trusteduilistener u:object_r:vendor_trusteduilistener_exec:s0
/vendor/bin/modemManager u:object_r:vendor_modem_manager_exec:s0
/(vendor|system/vendor)/bin/qms u:object_r:vendor_qms_exec:s0
#### Context for location features
## location daemons and binaries
@ -256,6 +227,7 @@
/data/vendor/gaming(/.*)? u:object_r:vendor_qspmhal_data_file:s0
/data/vendor/qvr(/.*)? u:object_r:vendor_qvrd_vndr_data_file:s0
/data/vendor/sxr(/.*)? u:object_r:vendor_sxrd_vndr_data_file:s0
/data/vendor/qms(/.*)? u:object_r:vendor_qms_vndr_data_file:s0
###################################
# persist files

View file

@ -27,37 +27,8 @@
#
# Changes from Qualcomm Innovation Center are provided under the following license:
#
# Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the
# disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
# GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
# HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
vendor_internal_prop(vendor_dataadpl_prop);
vendor_internal_prop(vendor_cnd_vendor_prop);
@ -121,6 +92,9 @@ vendor_internal_prop(vendor_hvdcp_opti_prop);
# property for xlat
vendor_restricted_prop(vendor_xlat_prop);
#qms property
vendor_internal_prop(vendor_qms_prop)
#qvr property
vendor_restricted_prop(vendor_qvr_prop);
vendor_restricted_prop(vendor_sxr_prop);

View file

@ -27,72 +27,8 @@
#
# Changes from Qualcomm Innovation Center are provided under the following license:
#
# Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the
# disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
# GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
# HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
# Changes from Qualcomm Innovation Center are provided under the following
# license:
#
# Copyright (c) 2022 Qualcomm Innovation Center, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the
# disclaimer below) 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 Qualcomm Innovation Center nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
# GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
# HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
ctl.vendor.cnd u:object_r:vendor_cnd_vendor_prop:s0
persist.vendor.cne. u:object_r:vendor_cnd_vendor_prop:s0
@ -207,3 +143,6 @@ persist.vendor.mwqem. u:object_r:vendor_mwqem_prop:s0
#pasr property
vendor.pasr. u:object_r:vendor_pasr_prop:s0
ro.vendor.pasr. u:object_r:vendor_pasr_prop:s0
#qms
persist.vendor.data.qms. u:object_r:vendor_qms_prop:s0

134
qva/vendor/common/qms.te vendored Normal file
View file

@ -0,0 +1,134 @@
# 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
# 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.
#
# Changes from Qualcomm Innovation Center are provided under the following license:
#
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
type vendor_qms, domain;
type vendor_qms_0, domain;
type vendor_qms_1, domain;
type vendor_qms_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(vendor_qms)
allow vendor_qms self:capability {
net_admin
};
allow vendor_qms vendor_qms:{
netlink_socket
qipcrtr_socket
netlink_generic_socket
netlink_route_socket
}create_socket_perms_no_ioctl;
allow vendor_qms self:udp_socket create_socket_perms;
allowxperm vendor_qms self:udp_socket ioctl priv_sock_ioctls;
#hal_server_domain_bypass(vendor_qms, vendor_hal_qms_qti)
#hal_attribute_service(vendor_hal_qms_qti, vendor_hal_qms_service)
#binder_call(vendor_hal_qms_qti_server, servicemanager)
#binder_call(vendor_hal_qms_qti_client, vendor_hal_qms_qti_server)
#binder_call(vendor_hal_qms_qti_server, vendor_hal_qms_qti_client)
allow vendor_qms self:netlink_route_socket nlmsg_readpriv;
hal_client_domain(vendor_qms,hal_wifi_hostapd)
hal_client_domain(vendor_qms,hal_wifi_supplicant)
hal_client_domain(vendor_qms, hal_bluetooth)
crash_dump_fallback(vendor_qms);
# QMS child process
allow vendor_qms self:process setcurrent;
allow vendor_qms {
vendor_qms_0
vendor_qms_1
}:process dyntransition;
neverallow { domain - vendor_qms } {
vendor_qms_0
vendor_qms_1
}:process dyntransition;
neverallow vendor_qms ~{
vendor_qms_0
vendor_qms_1
}:process dyntransition;
neverallow { vendor_qms_0 vendor_qms_1 } self:capability_class_set *;
allow vendor_qms_0 vendor_qms:fd use;
allow vendor_qms_0 vendor_qms:unix_dgram_socket write;
allow vendor_qms_0 vendor_qms:unix_stream_socket { read write };
allow vendor_qms_0 vendor_qms_exec:file execute_no_trans;
crash_dump_fallback(vendor_qms_0);
allow vendor_qms_0 self:{
qipcrtr_socket
}create_socket_perms_no_ioctl;
qesdk_access(vendor_qms_0)
allow vendor_qms_1 vendor_qms:fd use;
allow vendor_qms_1 vendor_qms:unix_dgram_socket write;
allow vendor_qms_1 vendor_qms:unix_stream_socket { read write };
allow vendor_qms_1 vendor_qms_exec:file execute_no_trans;
allow vendor_qms_1 self:{
qipcrtr_socket
}create_socket_perms_no_ioctl;
qesdk_access(vendor_qms_1)
crash_dump_fallback(vendor_qms_1);
# allow qms to access wpa_socket
allow vendor_qms vendor_wifi_vendor_data_file:dir r_dir_perms;
allow vendor_qms vendor_wifi_vendor_wpa_socket:sock_file write;
#communicating with wpa supplicant for sending commands/listening to events
unix_socket_send(vendor_qms, wpa, hal_wifi_supplicant)
allow vendor_qms wpa_data_file:dir w_dir_perms;
allow vendor_qms wpa_data_file:sock_file create_file_perms;
allow vendor_qms firmware_file:dir r_dir_perms;
allow vendor_qms firmware_file:file r_file_perms;
# Allow vendor_qms to read vendor_soc_model_prop
get_prop(vendor_qms, vendor_soc_model_prop);
#communicating with hostapd for sending commands/listening to events
allow vendor_qms hostapd_data_file:dir rw_dir_perms;
allow vendor_qms hostapd_data_file:sock_file create_file_perms;
allow vendor_qms { hal_wifi_hostapd_default }:unix_dgram_socket sendto;
add_service(vendor_qms, vendor_qms_service)
vndbinder_use(vendor_qms)
allow vendor_qms vendor_qms_service:service_manager find;
wakelock_use(vendor_qms)
#qtr_sdk_use(vendor_qms)
#allow vendor_qms vendor_qms_vndr_data_file:dir create_dir_perms;
#allow vendor_qms vendor_qms_vndr_data_file:file create_file_perms;
get_prop(vendor_qms, vendor_qms_prop)