Sepolicy: Add legacy sepolicy rule for BT
- Remove vendor_bluetooth_prop rule for unused wcnss_filter & hal_audio - Add persist.vendor.qcom.bluetooth. & vendor.qcom.bluetooth. into vendor_bluetooth_prop context. - Add SE policy for BT configstore. - set vendor BT properties from vendor_init. Change-Id: I9bb5277554363f981c7a639dc00c93b609423acb
This commit is contained in:
		
				
					committed by
					
						
						Gerrit - the friendly Code Review server
					
				
			
			
				
	
			
			
			
						parent
						
							73edc0e71e
						
					
				
				
					commit
					c062eb63f9
				
			
							
								
								
									
										3
									
								
								generic/vendor/common/vendor_init.te
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								generic/vendor/common/vendor_init.te
									
									
									
									
										vendored
									
									
								
							@@ -93,3 +93,6 @@ set_prop(vendor_init, public_vendor_default_prop)
 | 
			
		||||
 | 
			
		||||
# Allow timezone to be overrided by vendor
 | 
			
		||||
set_prop(vendor_init, exported_system_prop)
 | 
			
		||||
 | 
			
		||||
#Access vendor bluetooth properties
 | 
			
		||||
set_prop(vendor_init, vendor_bluetooth_prop)
 | 
			
		||||
							
								
								
									
										1
									
								
								legacy/vendor/common/file_contexts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								legacy/vendor/common/file_contexts
									
									
									
									
										vendored
									
									
								
							@@ -302,7 +302,6 @@
 | 
			
		||||
/(vendor|system/vendor)/bin/btnvtool            u:object_r:btnvtool_exec:s0
 | 
			
		||||
/(vendor|system/vendor)/bin/btsnoop                             u:object_r:btsnoop_exec:s0
 | 
			
		||||
/(vendor|system/vendor)/bin/wifidisplayhalservice               u:object_r:wifidisplayhalservice_qti_exec:s0
 | 
			
		||||
/(vendor|system/vendor)/bin/wcnss_filter        u:object_r:wcnss_filter_exec:s0
 | 
			
		||||
/(vendor|system/vendor)/bin/fmhal_service                       u:object_r:fmhal_service_exec:s0
 | 
			
		||||
/(vendor|system/vendor)/bin/usf_epos            u:object_r:usf_exec:s0
 | 
			
		||||
/(vendor|system/vendor)/bin/usf_gesture         u:object_r:usf_exec:s0
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								legacy/vendor/common/hal_audio.te
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								legacy/vendor/common/hal_audio.te
									
									
									
									
										vendored
									
									
								
							@@ -55,9 +55,6 @@ binder_call(hal_audio,bluetooth)
 | 
			
		||||
# audio properties
 | 
			
		||||
get_prop(hal_audio, vendor_audio_prop)
 | 
			
		||||
 | 
			
		||||
#to read bt props
 | 
			
		||||
get_prop(hal_audio, vendor_bluetooth_prop)
 | 
			
		||||
 | 
			
		||||
#for perf hal call
 | 
			
		||||
hal_client_domain(hal_audio_default, hal_perf)
 | 
			
		||||
hal_client_domain(hal_audio_default, hal_power)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								legacy/vendor/common/hwservice_contexts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								legacy/vendor/common/hwservice_contexts
									
									
									
									
										vendored
									
									
								
							@@ -47,6 +47,7 @@ vendor.qti.hardware.improvetouch.blobmanager::IBlobManager             u:object_
 | 
			
		||||
com.qualcomm.qti.dpm.api::IdpmQmi                            u:object_r:hal_dpmqmi_hwservice:s0
 | 
			
		||||
vendor.qti.imsrtpservice::IRTPService                        u:object_r:hal_imsrtp_hwservice:s0
 | 
			
		||||
com.qualcomm.qti.bluetooth_audio::IBluetoothAudio            u:object_r:hal_audio_hwservice:s0
 | 
			
		||||
vendor.qti.hardware.btconfigstore::IBTConfigStore            u:object_r:hal_bluetooth_hwservice:s0
 | 
			
		||||
com.qualcomm.qti.ant::IAntHci                                u:object_r:hal_bluetooth_hwservice:s0
 | 
			
		||||
vendor.qti.hardware.wipower::IWipower                        u:object_r:hal_bluetooth_hwservice:s0
 | 
			
		||||
vendor.qti.hardware.perf::IPerf                              u:object_r:hal_perf_hwservice:s0
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								legacy/vendor/common/property_contexts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								legacy/vendor/common/property_contexts
									
									
									
									
										vendored
									
									
								
							@@ -28,6 +28,8 @@
 | 
			
		||||
persist.vendor.service.bdroid.      u:object_r:vendor_bluetooth_prop:s0
 | 
			
		||||
persist.vendor.bt.soc.scram_freqs   u:object_r:vendor_bluetooth_prop:s0
 | 
			
		||||
persist.vendor.bluetooth.a2dp.      u:object_r:vendor_bluetooth_prop:s0
 | 
			
		||||
persist.vendor.qcom.bluetooth.      u:object_r:vendor_bluetooth_prop:s0
 | 
			
		||||
vendor.qcom.bluetooth.              u:object_r:vendor_bluetooth_prop:s0
 | 
			
		||||
vendor.wc_transport.       u:object_r:vendor_bluetooth_prop:s0
 | 
			
		||||
ro.vendor.bluetooth.       u:object_r:vendor_bluetooth_prop:s0
 | 
			
		||||
vendor.ims.                u:object_r:qcom_ims_prop:s0
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								legacy/vendor/common/vendor_init.te
									
									
									
									
										vendored
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										3
									
								
								legacy/vendor/common/vendor_init.te
									
									
									
									
										vendored
									
									
										
										
										Executable file → Normal file
									
								
							@@ -102,3 +102,6 @@ set_prop(vendor_init, hvdcp_opti_prop)
 | 
			
		||||
 | 
			
		||||
# Allow timezone to be overrided by vendor
 | 
			
		||||
set_prop(vendor_init, exported_system_prop)
 | 
			
		||||
 | 
			
		||||
#Acess vendor bluetooth properties
 | 
			
		||||
set_prop(vendor_init, vendor_bluetooth_prop)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										56
									
								
								legacy/vendor/common/wcnss_filter.te
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										56
									
								
								legacy/vendor/common/wcnss_filter.te
									
									
									
									
										vendored
									
									
								
							@@ -1,56 +0,0 @@
 | 
			
		||||
# Copyright (c) 2016, 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 wcnss_filter, domain;
 | 
			
		||||
type wcnss_filter_exec, exec_type, vendor_file_type, file_type;
 | 
			
		||||
 | 
			
		||||
init_daemon_domain(wcnss_filter)
 | 
			
		||||
net_domain(wcnss_filter)
 | 
			
		||||
 | 
			
		||||
userdebug_or_eng(`
 | 
			
		||||
allow wcnss_filter proc_sysrq:file { open write };
 | 
			
		||||
')
 | 
			
		||||
allow wcnss_filter sysfs_msmuart_file:file rw_file_perms;
 | 
			
		||||
allow wcnss_filter {
 | 
			
		||||
    serial_device
 | 
			
		||||
}:chr_file rw_file_perms;
 | 
			
		||||
 | 
			
		||||
#wakelock policy
 | 
			
		||||
wakelock_use(wcnss_filter);
 | 
			
		||||
set_prop(wcnss_filter, vendor_bluetooth_prop);
 | 
			
		||||
 | 
			
		||||
#For bluetooth firmware
 | 
			
		||||
r_dir_file(wcnss_filter, bt_firmware_file)
 | 
			
		||||
 | 
			
		||||
allow wcnss_filter persist_bluetooth_file:dir r_dir_perms;
 | 
			
		||||
allow wcnss_filter persist_bluetooth_file:file r_file_perms;
 | 
			
		||||
allow wcnss_filter mnt_vendor_file:dir r_dir_perms;
 | 
			
		||||
 | 
			
		||||
#diag
 | 
			
		||||
userdebug_or_eng(`
 | 
			
		||||
    diag_use(wcnss_filter)
 | 
			
		||||
')
 | 
			
		||||
		Reference in New Issue
	
	Block a user