1# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14attribute cap_violator_binder_hmc;
15
16allow hdfdomain vendor_bin_file:file { entrypoint execute map read };
17
18#neverallow
19# let every hdf_host join hdf_domain
20neverallow { domain -hdfdomain -sadomain -init -hap_domain developer_only(`-input_isolate_debug_hap') -input_isolate_hap } hdf_devmgr:binder call;
21
22neverallow { domain -hdfdomain -sadomain -hap_domain -binder_call_hdfdomain_violators developer_only(`-input_isolate_debug_hap') -input_isolate_hap } hdfdomain:binder call;
23
24neverallow { hap_domain } { hdfdomain -allocator_host -violator_hdfdomain_binder_call -codec_host -usb_host -input_user_host -cap_violator_binder_hmc }:binder call;
25
26neverallow { input_isolate_debug_hap -input_isolate_hap } { hdfdomain -allocator_host }:binder call;
27
28neverallow hap_domain { hdf_service_attr -hdf_hid_ddk_service -hdf_usb_ddk_service debug_only(`-hdf_usb_interface_service') -hdf_allocator_service -hdf_codec_image_service -violator_hdf_devmgr_class_get -hdf_codec_component_manager_service -hdf_usbfn_mtp_interface_service -cap_violator_binder_hmc }:hdf_devmgr_class { get };
29
30neverallow { hap_domain -medialibrary_hap } { hdf_usbfn_mtp_interface_service }:hdf_devmgr_class { get };
31