From 246e5b505704f705144b48e79ace948c2323cbbd Mon Sep 17 00:00:00 2001 From: Stephen Chen Date: Sat, 18 Jan 2020 10:05:34 +0800 Subject: [PATCH] [ALPS03738758] Audio: Add Hifi3 adsp device info [Detail] Add sepolicy access right for Hifi3 adsp device. Mobilelog and AED will need these access right. MTK-Commit-Id: 06ac39d7cebbab2bcb3468fcf14f19b7e1489819 Change-Id: Ic834ac687b4423500ef6036824a6d6f75e57ccb3 CR-Id: ALPS03738758 Feature: [Module]Audio OpenDSP --- non_plat/aee_aedv.te | 4 ++++ non_plat/device.te | 1 + non_plat/file.te | 1 + non_plat/file_contexts | 1 + non_plat/mobile_log_d.te | 5 +++++ 5 files changed, 12 insertions(+) diff --git a/non_plat/aee_aedv.te b/non_plat/aee_aedv.te index 825a422..5455fdc 100644 --- a/non_plat/aee_aedv.te +++ b/non_plat/aee_aedv.te @@ -321,6 +321,10 @@ allow aee_aedv sysfs_lowmemorykiller:file r_file_perms; allow aee_aedv sysfs_scp:dir r_dir_perms; allow aee_aedv sysfs_scp:file r_file_perms; +# Purpose: Allow aee read /sys/class/misc/adsp/adsp_dump +allow aee_aedv sysfs_adsp:dir r_dir_perms; +allow aee_aedv sysfs_adsp:file r_file_perms; + # Purpose: allow aee_aedv self to fsetid/sys_nice/chown/fowner/kill allow aee_aedv self:capability { fsetid sys_nice chown fowner kill }; diff --git a/non_plat/device.te b/non_plat/device.te index a1d3e79..bdda192 100644 --- a/non_plat/device.te +++ b/non_plat/device.te @@ -159,6 +159,7 @@ type geo_device, dev_type; type mdlog_device, dev_type; type md32_device, dev_type; type scp_device, dev_type; +type adsp_device, dev_type; type sspm_device, dev_type; type etb_device, dev_type; type MT_pmic_adc_cali_device, dev_type; diff --git a/non_plat/file.te b/non_plat/file.te index cd94b3b..30215b4 100644 --- a/non_plat/file.te +++ b/non_plat/file.te @@ -77,6 +77,7 @@ type sysfs_ssw, fs_type,sysfs_type; type sysfs_vcorefs_pwrctrl, fs_type, sysfs_type; type sysfs_md32, fs_type, sysfs_type; type sysfs_scp, fs_type, sysfs_type; +type sysfs_adsp, fs_type, sysfs_type; type sysfs_sspm, fs_type, sysfs_type; type sysfs_devinfo, fs_type, sysfs_type, mlstrustedobject; type sysfs_dcm, fs_type, sysfs_type; diff --git a/non_plat/file_contexts b/non_plat/file_contexts index 2ee2624..10df5f4 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -476,6 +476,7 @@ /sys/devices/virtual/misc/scp(/.*)? u:object_r:sysfs_scp:s0 /sys/devices/virtual/misc/scp_B(/.*)? u:object_r:sysfs_scp:s0 /sys/devices/virtual/misc/sspm(/.*)? u:object_r:sysfs_sspm:s0 +/sys/devices/virtual/misc/adsp(/.*)? u:object_r:sysfs_adsp:s0 /sys/kernel/ccci(/.*)? u:object_r:sysfs_ccci:s0 /sys/mtk_ssw(/.*)? u:object_r:sysfs_ssw:s0 /sys/bus/platform/drivers/dev_info/dev_info u:object_r:sysfs_devinfo:s0 diff --git a/non_plat/mobile_log_d.te b/non_plat/mobile_log_d.te index 8d2363f..109a671 100644 --- a/non_plat/mobile_log_d.te +++ b/non_plat/mobile_log_d.te @@ -16,6 +16,11 @@ allow mobile_log_d sysfs_scp:file { open write }; allow mobile_log_d sysfs_scp:dir search; 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 }; + #sspm allow mobile_log_d sysfs_sspm:file { open write }; allow mobile_log_d sysfs_sspm:dir search;