From 142bfb6b36c6bbe79fbcbe6d5a011077aeaa568e Mon Sep 17 00:00:00 2001 From: "jamy.tseng" Date: Sat, 18 Jan 2020 10:11:44 +0800 Subject: [PATCH] [ALPS04421353] MtkCam: modify sepolicy for jpeg [Detail] add ioctl for camerahalserver jpegnode jpegnode need to control jpeg io MTK-Commit-Id: c1adc06defb2aab6e9402f45c0f2b92bcfa83a5e Change-Id: Ie8f65b38133fc46b3a46e3ed04b42d6f09ad13cc CR-Id: ALPS04421353 Feature: Cshot (Continuous Shot) --- non_plat/file.te | 1 + non_plat/genfs_contexts | 1 + non_plat/ioctl_defines | 5 +++++ non_plat/mtk_hal_camera.te | 8 ++++++++ 4 files changed, 15 insertions(+) diff --git a/non_plat/file.te b/non_plat/file.te index 2223e93..8123ca8 100644 --- a/non_plat/file.te +++ b/non_plat/file.te @@ -53,6 +53,7 @@ type proc_mtktz, fs_type, proc_type; type proc_slogger, fs_type, proc_type; type proc_lk_env, fs_type, proc_type; type proc_ged, fs_type, proc_type; +type proc_mtk_jpeg, fs_type, proc_type; type proc_perfmgr, fs_type, proc_type; type proc_wmtdbg, fs_type, proc_type; type proc_zraminfo, fs_type, proc_type; diff --git a/non_plat/genfs_contexts b/non_plat/genfs_contexts index 5fdcc6d..1540ae9 100644 --- a/non_plat/genfs_contexts +++ b/non_plat/genfs_contexts @@ -18,6 +18,7 @@ genfscon proc /driver/icusb u:object_r:proc_icusb:s0 genfscon proc /mrdump_rst u:object_r:proc_mrdump_rst:s0 genfscon proc /mtk_battery_cmd u:object_r:proc_battery_cmd:s0 genfscon proc /ged u:object_r:proc_ged:s0 +genfscon proc /mtk_jpeg u:object_r:proc_mtk_jpeg:s0 genfscon proc /perfmgr u:object_r:proc_perfmgr:s0 genfscon proc /driver/wmt_dbg u:object_r:proc_wmtdbg:s0 diff --git a/non_plat/ioctl_defines b/non_plat/ioctl_defines index 0e30532..471731d 100755 --- a/non_plat/ioctl_defines +++ b/non_plat/ioctl_defines @@ -21,3 +21,8 @@ define(`EARA_GETUSAGE', `0x6703') define(`PERFMGR_CPU_PREFER', `0x6701') define(`MMC_IOCTLCMD', `0xb300') define(`UFS_IOCTLCMD', `0x5388') +define(`JPG_BRIDGE_ENC_IO_INIT', `0x780b') +define(`JPG_BRIDGE_ENC_IO_CONFIG', `0x780c') +define(`JPG_BRIDGE_ENC_IO_WAIT', `0x780d') +define(`JPG_BRIDGE_ENC_IO_DEINIT', `0x780e') +define(`JPG_BRIDGE_ENC_IO_START', `0x780f') diff --git a/non_plat/mtk_hal_camera.te b/non_plat/mtk_hal_camera.te index 3ef66b2..0e1892c 100644 --- a/non_plat/mtk_hal_camera.te +++ b/non_plat/mtk_hal_camera.te @@ -63,6 +63,14 @@ hal_client_domain(mtk_hal_camera, hal_graphics_allocator) # Purpose: Camera-related devices (driver) # ----------------------------------- allow mtk_hal_camera proc:file { read ioctl open }; +allow mtk_hal_camera proc_mtk_jpeg:file r_file_perms; +allowxperm mtk_hal_camera proc_mtk_jpeg:file ioctl { + JPG_BRIDGE_ENC_IO_INIT + JPG_BRIDGE_ENC_IO_CONFIG + JPG_BRIDGE_ENC_IO_WAIT + JPG_BRIDGE_ENC_IO_DEINIT + JPG_BRIDGE_ENC_IO_START + }; allow mtk_hal_camera sysfs:file { read write open getattr }; allow mtk_hal_camera camera_sysram_device:chr_file r_file_perms;