security: update selinux
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / security / selinux / selinuxfs.c
index a96bed4db3e8aa04dc637372be6dff175309d295..e94a8d8313bc2aaff262dbd963752fed9e088b0a 100644 (file)
 #include "objsec.h"
 #include "conditional.h"
 
 #include "objsec.h"
 #include "conditional.h"
 
+#if defined(CONFIG_TZ_ICCC)
+#include <linux/security/Iccc_Interface.h>
+#endif
+
 /* Policy capability filenames */
 static char *policycap_names[] = {
        "network_peer_controls",
 /* Policy capability filenames */
 static char *policycap_names[] = {
        "network_peer_controls",
@@ -183,6 +187,20 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf,
                selinux_status_update_setenforce(selinux_enforcing);
        }
        length = count;
                selinux_status_update_setenforce(selinux_enforcing);
        }
        length = count;
+       
+#if defined(CONFIG_TZ_ICCC)
+       if (selinux_enabled && selinux_enforcing) {
+               if (0 != Iccc_SaveData_Kernel(SELINUX_STATUS,0x0)) {
+                       printk(KERN_ERR "%s: Iccc_SaveData_Kernel failed, type = %x, value =%x\n", __func__,SELINUX_STATUS,0x0);
+               }
+       }
+       else {
+               if (0 != Iccc_SaveData_Kernel(SELINUX_STATUS,0x1)) {
+                       printk(KERN_ERR "%s: Iccc_SaveData_Kernel failed, type = %x, value =%x\n", __func__,SELINUX_STATUS,0x1);
+               }
+       }
+#endif
+
 out:
        free_page((unsigned long) page);
        return length;
 out:
        free_page((unsigned long) page);
        return length;