From 409cd433a050f10788d7c20ae1ff7e3e5a817c88 Mon Sep 17 00:00:00 2001 From: SagarMakhar Date: Sat, 20 Jul 2019 10:16:00 +0000 Subject: [PATCH] sdm660-common: Add sepolicy for kcal Signed-off-by: bablusss --- sepolicy/vendor/file.te | 3 +++ sepolicy/vendor/file_contexts | 4 ++++ sepolicy/vendor/system_app.te | 4 +++- sepolicy/vendor/ueventd.te | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 sepolicy/vendor/ueventd.te diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index 4cec4141..64e7df33 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -17,6 +17,9 @@ type sysfs_fingerprint, sysfs_type, fs_type; # Input files type idc_file, file_type, vendor_file_type; +# Kcal +type kcal_dev, sysfs_type, fs_type; + # Keylayout type vendor_keylayout_file, file_type, vendor_file_type; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index bea35743..00684d15 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -25,6 +25,10 @@ # IR /dev/spidev7.1 u:object_r:spidev_device:s0 +# Kcal +/sys/devices/platform/kcal_ctrl.0(/.*)? u:object_r:kcal_dev:s0 +/sys/bus/platform/drivers/kcal_ctrl(/.*)? u:object_r:kcal_dev:s0 + # Keylayout /vendor/usr/idc(/.*)? u:object_r:idc_file:s0 /vendor/usr/keylayout(/.*)? u:object_r:vendor_keylayout_file:s0 diff --git a/sepolicy/vendor/system_app.te b/sepolicy/vendor/system_app.te index fcea8539..de37ca00 100644 --- a/sepolicy/vendor/system_app.te +++ b/sepolicy/vendor/system_app.te @@ -1,4 +1,6 @@ allow system_app vendor_default_prop:file { getattr open read }; allow system_app wificond:binder call; allow system_app hal_mlipay_hwservice:hwservice_manager find; -allow system_app hal_mlipay_default:binder call; \ No newline at end of file +allow system_app hal_mlipay_default:binder call; +allow system_app kcal_dev:file rw_file_perms; +allow system_app kcal_dev:dir search; diff --git a/sepolicy/vendor/ueventd.te b/sepolicy/vendor/ueventd.te new file mode 100644 index 00000000..02dd489c --- /dev/null +++ b/sepolicy/vendor/ueventd.te @@ -0,0 +1,3 @@ +allow ueventd kcal_dev:dir r_dir_perms; +allow ueventd kcal_dev:file rw_file_perms; +allow ueventd kcal_dev:lnk_file r_file_perms;