diff options
author | Davide Garberi <dade.garberi@gmail.com> | 2019-03-02 13:23:14 +0100 |
---|---|---|
committer | Davide Garberi <dade.garberi@gmail.com> | 2019-03-02 13:56:05 +0100 |
commit | 95f4617bec43046ca6d418b606175978eea22be2 (patch) | |
tree | b9706466e41c6c85131d25696b7f7abf74c763ab /sepolicy | |
parent | 56a0d4e8bca5cb53407e9d615ed5566e87f34c2b (diff) |
msm8996-common: Set the hardware wlan mac using wcg_mac_tool
* Bin extracted from ZUI
* Add init.wlan.sh to check if the mac address in wlan_mac.bin is already correct, if not correct it
* Run both the bins on boot completed as wcg can't run earlier
* Label both the bins and address their denials
Change-Id: I7a8001465ec9c3d69bd228efa57dddfdd8e3c6f3
Diffstat (limited to 'sepolicy')
-rw-r--r-- | sepolicy/file_contexts | 4 | ||||
-rw-r--r-- | sepolicy/property.te | 1 | ||||
-rw-r--r-- | sepolicy/property_contexts | 16 | ||||
-rw-r--r-- | sepolicy/qti_init_shell.te | 6 | ||||
-rw-r--r-- | sepolicy/shell.te | 1 | ||||
-rw-r--r-- | sepolicy/wcg_mac.te | 10 |
6 files changed, 38 insertions, 0 deletions
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index f4b765f..12e3edd 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -1,6 +1,10 @@ # Partitions /dev/block/platform/soc/(624000\.ufshc|7464900\.sdhci)/by-name/persist u:object_r:persist_block_device:s0 +# Binaries +/vendor/bin/wcg_mac_tool u:object_r:wcg_mac_exec:s0 +/vendor/bin/init.wlan.sh u:object_r:qti_init_shell_exec:s0 + # Devices /dev/fpc1020 u:object_r:fpc1020_device:s0 /dev/tfa9890 u:object_r:audio_device:s0 diff --git a/sepolicy/property.te b/sepolicy/property.te new file mode 100644 index 0000000..550baf9 --- /dev/null +++ b/sepolicy/property.te @@ -0,0 +1 @@ +type wcg_prop, property_type; diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts index ecce687..bc0c909 100644 --- a/sepolicy/property_contexts +++ b/sepolicy/property_contexts @@ -13,3 +13,19 @@ ro.min_freq_4 u:object_r:freq_prop:s0 # Qseecomd sys.listeners.registered u:object_r:vendor_tee_listener_prop:s0 + +# WCG +sys.wifimac u:object_r:wcg_prop:s0 +sys.bt.address u:object_r:wcg_prop:s0 +persist.bt.max.hs.connections u:object_r:wcg_prop:s0 +gsm.sn1 u:object_r:wcg_prop:s0 +sys.customsn.showcode u:object_r:wcg_prop:s0 +cdma.meid u:object_r:wcg_prop:s0 +gsm.imei1 u:object_r:wcg_prop:s0 +gsm.imei2 u:object_r:wcg_prop:s0 +persist.cdma.meid u:object_r:wcg_prop:s0 +persist.gsm.imei1 u:object_r:wcg_prop:s0 +persist.gsm.imei2 u:object_r:wcg_prop:s0 +gsm.hwid u:object_r:wcg_prop:s0 +gsm.station u:object_r:wcg_prop:s0 +persist.gsm.qlogd.on u:object_r:wcg_prop:s0 diff --git a/sepolicy/qti_init_shell.te b/sepolicy/qti_init_shell.te index 1841019..64ab2bc 100644 --- a/sepolicy/qti_init_shell.te +++ b/sepolicy/qti_init_shell.te @@ -3,3 +3,9 @@ allow qti_init_shell vendor_radio_data_file:dir { getattr open read search setat allow qti_init_shell vfat:file { getattr open read setattr }; allow qti_init_shell vfat:dir { open read search }; allow qti_init_shell file_contexts_file:file { getattr open read }; + +# Allow qti_init_shell to fully access wlan_mac.bin persist file +allow qti_init_shell mnt_vendor_file:dir rw_dir_perms; +allow qti_init_shell mnt_vendor_file:file create_file_perms; + +get_prop(qti_init_shell, wcg_prop) diff --git a/sepolicy/shell.te b/sepolicy/shell.te new file mode 100644 index 0000000..df6b670 --- /dev/null +++ b/sepolicy/shell.te @@ -0,0 +1 @@ +get_prop(shell, wcg_prop) diff --git a/sepolicy/wcg_mac.te b/sepolicy/wcg_mac.te new file mode 100644 index 0000000..2e8ec94 --- /dev/null +++ b/sepolicy/wcg_mac.te @@ -0,0 +1,10 @@ +type wcg_mac, domain; +type wcg_mac_exec, exec_type, vendor_file_type, file_type; + +# Allow for transition from init domain to wcg_mac +init_daemon_domain(wcg_mac) + +# Allow wcg_mac to set sys.wifimac +set_prop(wcg_mac, wcg_prop) + +allow wcg_mac proc:file { open read }; |