Merge tag 'trace-v5.15-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[linux-2.6-microblaze.git] / security / selinux / selinuxfs.c
index fff6bab..e4cd7cb 100644 (file)
@@ -41,6 +41,7 @@
 #include "security.h"
 #include "objsec.h"
 #include "conditional.h"
+#include "ima.h"
 
 enum sel_inos {
        SEL_ROOT_INO = 2,
@@ -182,6 +183,8 @@ static ssize_t sel_write_enforce(struct file *file, const char __user *buf,
                selinux_status_update_setenforce(state, new_value);
                if (!new_value)
                        call_blocking_lsm_notifier(LSM_POLICY_CHANGE, NULL);
+
+               selinux_ima_measure_state(state);
        }
        length = count;
 out:
@@ -758,6 +761,9 @@ static ssize_t sel_write_checkreqprot(struct file *file, const char __user *buf,
 
        checkreqprot_set(fsi->state, (new_value ? 1 : 0));
        length = count;
+
+       selinux_ima_measure_state(fsi->state);
+
 out:
        kfree(page);
        return length;