Added device sepolicy rules for NN HAL data files for kona
Change-Id: I8d5daa58201fd72a5a88670f7c97e8e681ad2bf3
This commit is contained in:
		
				
					committed by
					
						
						Gerrit - the friendly Code Review server
					
				
			
			
				
	
			
			
			
						parent
						
							3e26c96aa7
						
					
				
				
					commit
					00f64065c3
				
			
							
								
								
									
										3
									
								
								generic/vendor/kona/file_contexts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								generic/vendor/kona/file_contexts
									
									
									
									
										vendored
									
									
								
							@@ -89,6 +89,9 @@
 | 
			
		||||
# Block devices for the drive that holds the xbl_a and xbl_b partitions.
 | 
			
		||||
/dev/block/platform/soc/1d84000.ufshc/sd[bc]                        u:object_r:xbl_block_device:s0
 | 
			
		||||
 | 
			
		||||
#Android NN Driver
 | 
			
		||||
/vendor/bin/hw/android\.hardware\.neuralnetworks@1\.2-service-qti   u:object_r:hal_neuralnetworks_default_exec:s0
 | 
			
		||||
 | 
			
		||||
# Same process file
 | 
			
		||||
/vendor/lib(64)?/hw/gralloc\.kona\.so                               u:object_r:same_process_hal_file:s0
 | 
			
		||||
/vendor/lib(64)?/hw/vulkan\.kona\.so                                u:object_r:same_process_hal_file:s0
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										45
									
								
								generic/vendor/kona/hal_neuralnetworks.te
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								generic/vendor/kona/hal_neuralnetworks.te
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
# Copyright (c) 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
 | 
			
		||||
# 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 hal_neuralnetworks_default, domain;
 | 
			
		||||
hal_server_domain(hal_neuralnetworks_default, hal_neuralnetworks)
 | 
			
		||||
 | 
			
		||||
type hal_neuralnetworks_default_exec, exec_type, vendor_file_type, file_type;
 | 
			
		||||
init_daemon_domain(hal_neuralnetworks_default)
 | 
			
		||||
 | 
			
		||||
allow hal_neuralnetworks_default fwk_sensor_hwservice:hwservice_manager find;
 | 
			
		||||
allow hal_neuralnetworks_default qdsp_device:chr_file r_file_perms;
 | 
			
		||||
allow hal_neuralnetworks_default xdsp_device:chr_file r_file_perms;
 | 
			
		||||
allow hal_neuralnetworks_default ion_device:chr_file r_file_perms;
 | 
			
		||||
 | 
			
		||||
allow hal_neuralnetworks_default app_data_file:file { read getattr map };
 | 
			
		||||
allow hal_neuralnetworks_default shell_data_file:file { read getattr map };
 | 
			
		||||
allow hal_neuralnetworks_default hal_neuralnetworks_data_file:dir create_dir_perms;
 | 
			
		||||
allow hal_neuralnetworks_default hal_neuralnetworks_data_file:{ file fifo_file } create_file_perms;
 | 
			
		||||
allow hal_neuralnetworks_default gpu_device:chr_file rw_file_perms;
 | 
			
		||||
 | 
			
		||||
r_dir_file(hal_neuralnetworks_default, adsprpcd_file)
 | 
			
		||||
		Reference in New Issue
	
	Block a user