sm7250-common: Make fastrpc_shell_3 publicly available

* Used by GCAM for DSP-accelerated HDR processing
 * Arguably we should label /vendor/dsp/cdsp/fastrpc_shell_3 to
   same_process_hal_file like Pixels, but the partition is prebuilt thus
   we're unable to relabel it.
 * Copy the file to writable tmpfs, setup attributes and bind mount back
   to workaround the limitation.

[ghostrider-reborn]:
Allow adsp/cdsprpcd and neuralnetworks HAL to access fastrpc_shell_3

[kras edit:
 1. rename some contexts as per qva/kona
 2. extend to allow camera HAL and VPP service to access it as well]

Co-authored-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
Change-Id: Ide90e5c7307d413db5ece736e859559f06679545
This commit is contained in:
dianlujitao 2020-05-07 00:10:55 +08:00 committed by xSylla
parent ee24b40ef9
commit 09bb619041
10 changed files with 22 additions and 0 deletions

View File

@ -84,6 +84,11 @@ on init
on post-fs
chmod 0755 /sys/kernel/debug/tracing
mkdir /mnt/vendor/dsp 0770 root root
copy /vendor/dsp/cdsp/fastrpc_shell_3 /mnt/vendor/dsp/fastrpc_shell_3
chmod 0644 /mnt/vendor/dsp/fastrpc_shell_3
mount none /mnt/vendor/dsp/fastrpc_shell_3 /vendor/dsp/cdsp/fastrpc_shell_3 bind
on early-boot
# set RLIMIT_MEMLOCK to 64MB
setrlimit 8 67108864 67108864

View File

@ -1 +1,2 @@
r_dir_file(vendor_adsprpcd, public_adsprpcd_file)
r_dir_file(vendor_adsprpcd, vendor_sysfs_graphics)

View File

@ -1,2 +1,5 @@
allow { appdomain -isolated_app } adsprpcd_file:dir r_dir_perms;
allow { appdomain -isolated_app } public_adsprpcd_file:file r_file_perms;
get_prop({ appdomain -isolated_app }, vendor_fp_prop)
get_prop({ appdomain -isolated_app }, vendor_tee_listener_prop)

1
sepolicy/vendor/cdsprpcd.te vendored Normal file
View File

@ -0,0 +1 @@
r_dir_file(vendor_cdsprpcd, public_adsprpcd_file)

View File

@ -13,6 +13,7 @@ type thermal_data_file, file_type, data_file_type;
type camera_persist_file, file_type, vendor_persist_type;
type audio_socket, file_type;
type public_adsprpcd_file, file_type;
type ultrasound_device, dev_type;

View File

@ -35,6 +35,11 @@
# Fingerprint - FOD
/sys/devices/platform/soc/soc:qcom,dsi-display-primary/fod_ui u:object_r:sysfs_fod:s0
# Hexagon DSP-side executable needed for Halide operation
# This is labeled as public_adsprpcd_file as it needs to be read by apps
# (e.g. Google Camera App)
/mnt/vendor/dsp/fastrpc_shell_3 u:object_r:public_adsprpcd_file:s0
# Graphics nodes
/sys/devices/platform/soc/[a-z0-9]+.qcom,mdss_mdp/drm/card([0-3])+/card([0-3])+-DSI-1/panel_info u:object_r:vendor_sysfs_graphics:s0
/sys/devices/platform/soc/[a-z0-9]+.qcom,mdss_mdp/drm/card([0-3])+/card([0-3])+-DSI-1/disp_param u:object_r:vendor_sysfs_graphics:s0

View File

@ -17,3 +17,5 @@ set_prop(hal_camera_default, vendor_camera_prop)
allow hal_camera_default socket_device:sock_file write;
allow hal_camera_default proc_stat:file { open };
allow hal_camera_default public_adsprpcd_file:file r_file_perms;

View File

@ -0,0 +1 @@
r_dir_file(vendor_hal_neuralnetworks_default, public_adsprpcd_file)

View File

@ -7,3 +7,5 @@ allow init proc_last_kmsg:file {
r_file_perms
setattr
};
allow init adsprpcd_file:file mounton;

1
sepolicy/vendor/vppservice.te vendored Normal file
View File

@ -0,0 +1 @@
r_dir_file(vendor_vppservice, public_adsprpcd_file)