From 723628ecbd55d8ad411dc74e6df7f0518b61fd44 Mon Sep 17 00:00:00 2001 From: chien-wei hsu Date: Sat, 18 Jan 2020 10:16:14 +0800 Subject: [PATCH] [ALPS04286398] adsp: add adsp permission [detail] add device adsp permission MTK-Commit-Id: e4e95de61164b584c97b949d2aa57ed17dd3120e Change-Id: I691cb90e40034357d6a320bb0749db497b76a9e7 CR-Id: ALPS04286398 Feature: [Module]Audio OpenDSP --- non_plat/factory.te | 3 +++ non_plat/file_contexts | 1 + non_plat/meta_tst.te | 5 +++++ non_plat/mobile_log_d.te | 2 +- non_plat/mtk_hal_audio.te | 5 +++++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/non_plat/factory.te b/non_plat/factory.te index 6aecbdb..8fcf118 100644 --- a/non_plat/factory.te +++ b/non_plat/factory.te @@ -385,6 +385,9 @@ allow factory proc_version:file {read open getattr}; # Allow to use persist.radio.multisim.config allow factory exported3_radio_prop:file { read open getattr }; +# Purpose : adsp +allow factory adsp_device:chr_file rw_file_perms; + # Purpose : NFC allow factory vendor_nfc_socket:dir { write add_name remove_name search }; allow factory vendor_nfc_socket:sock_file { create write unlink setattr }; diff --git a/non_plat/file_contexts b/non_plat/file_contexts index 5cc01e5..0ae4894 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -334,6 +334,7 @@ /dev/ancservice(/.*)? u:object_r:ancservice_device:s0 /dev/offloadservice(/.*)? u:object_r:offloadservice_device:s0 /dev/audio_ipi(/.*)? u:object_r:audio_ipi_device:s0 +/dev/adsp(/.*)? u:object_r:adsp_device:s0 /dev/audio_scp(/.*)? u:object_r:audio_scp_device:s0 /dev/irtx u:object_r:irtx_device:s0 /dev/spm(/.*)? u:object_r:spm_device:s0 diff --git a/non_plat/meta_tst.te b/non_plat/meta_tst.te index 39d19de..3e1858c 100644 --- a/non_plat/meta_tst.te +++ b/non_plat/meta_tst.te @@ -410,6 +410,11 @@ allow meta_tst fwmarkd_socket:sock_file write; # Purpose : Add ATM meta mvram sepolicy allow meta_tst mnt_vendor_file:dir search; +# Date : WK18.44 +# Operation: P migration +# Purpose : adsp +allow meta_tst adsp_device:chr_file rw_file_perms; + # Date : WK19.08 # Operation: P migration # Purpose : audio scp recovery diff --git a/non_plat/mobile_log_d.te b/non_plat/mobile_log_d.te index a779673..f6c22ff 100644 --- a/non_plat/mobile_log_d.te +++ b/non_plat/mobile_log_d.te @@ -19,7 +19,7 @@ allow mobile_log_d scp_device:chr_file { read open }; #adsp allow mobile_log_d sysfs_adsp:file { open write }; allow mobile_log_d sysfs_adsp:dir search; -allow mobile_log_d adsp_device:chr_file { read open }; +allow mobile_log_d adsp_device:chr_file r_file_perms; #sspm allow mobile_log_d sysfs_sspm:file { open write }; diff --git a/non_plat/mtk_hal_audio.te b/non_plat/mtk_hal_audio.te index 860c243..5627c80 100644 --- a/non_plat/mtk_hal_audio.te +++ b/non_plat/mtk_hal_audio.te @@ -230,3 +230,8 @@ allow mtk_hal_audio mnt_vendor_file:dir search; allow mtk_hal_audio audioserver:fifo_file w_file_perms; allow mtk_hal_audio sysfs_boot_mode:file r_file_perms; allow mtk_hal_audio sysfs_dt_firmware_android:dir search; + +# Date : WK18.44 +# Operation: adsp +allow mtk_hal_audio adsp_device:file rw_file_perms; +allow mtk_hal_audio adsp_device:chr_file rw_file_perms;