From 8700268780de8cafc8e2f662eecaebdf29d351e5 Mon Sep 17 00:00:00 2001 From: chun-yi lin Date: Sat, 18 Jan 2020 10:14:46 +0800 Subject: [PATCH] [ALPS04331131] Wlan: wlan_assistant selinux For Meta mode, we use the property to notify meta tool that NVRAM has read. Set the selinux rule for this property. MTK-Commit-Id: 0cafb33d13392e6a676930814e3df3ba27fb146b Change-Id: I62ca6e004861720eb43b90ace6f5fff85da49298 Signed-off-by: Facer Pei CR-Id: ALPS04331131 Feature: [Module]Wi-Fi Driver (cherry picked from commit bf9cdf5f2598cecdc0b5f4fd1b1016b9fd77dfd6) (cherry picked from commit a846ce17a1eedc26d31b6c82b2583f58cd8e53f5) (cherry picked from commit 8f6643f055c69d5b45e17048ce9a76311d6fdd92) --- non_plat/property.te | 4 ++++ non_plat/property_contexts | 4 ++++ non_plat/wlan_assistant.te | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/non_plat/property.te b/non_plat/property.te index e44a99c..a18ca12 100644 --- a/non_plat/property.te +++ b/non_plat/property.te @@ -310,3 +310,7 @@ type mtk_bt_sap_enable_prop, property_type, mtk_core_property_type; #=============MTK powerhal property================ type mtk_powerhal_prop, property_type; + +#=============MTK Wifi wlan_assistant property============= +type mtk_nvram_ready_prop, property_type, mtk_core_property_type; + diff --git a/non_plat/property_contexts b/non_plat/property_contexts index de71167..0dc25d3 100644 --- a/non_plat/property_contexts +++ b/non_plat/property_contexts @@ -344,3 +344,7 @@ ro.lmk.swap_free_low_percentage u:object_r:exported3_default_prop:s0 exact int #=============allow processes to change powerhal config================ persist.vendor.powerhal. u:object_r:mtk_powerhal_prop:s0 vendor.powerhal. u:object_r:mtk_powerhal_prop:s0 + +#=============MTK Wifi wlan_assistant property============= +vendor.mtk.nvram.ready u:object_r:mtk_nvram_ready_prop:s0 + diff --git a/non_plat/wlan_assistant.te b/non_plat/wlan_assistant.te index ac67722..f5aa5c2 100644 --- a/non_plat/wlan_assistant.te +++ b/non_plat/wlan_assistant.te @@ -42,3 +42,7 @@ allow wlan_assistant vendor_data_file:dir { search read getattr open }; allow wlan_assistant vendor_data_file:file { read getattr open }; allow wlan_assistant mnt_vendor_file :dir search; +allow wlan_assistant init:unix_stream_socket connectto; +allow wlan_assistant property_socket:sock_file write; + +set_prop(wlan_assistant, mtk_nvram_ready_prop)