@@ -202,6 +202,7 @@ struct ima_namespace {
bool frozen;
struct ima_policy_data *policy_data;
struct integrity_iint_tree *iint_tree;
+ struct list_head *measurements;
} __randomize_layout;
extern struct ima_namespace init_ima_ns;
@@ -35,6 +35,7 @@ struct ima_namespace init_ima_ns = {
.frozen = true,
.policy_data = &init_policy_data,
.iint_tree = &init_iint_tree,
+ .measurements = &ima_measurements,
};
EXPORT_SYMBOL(init_ima_ns);
@@ -293,6 +293,11 @@ static int imans_activate(struct ima_namespace *ima_ns)
ima_ns->frozen = true;
+ /* Set current last element as list's head */
+ rcu_read_lock();
+ ima_ns->measurements = list_tail_rcu(&ima_measurements);
+ rcu_read_unlock();
+
down_write(&ima_ns_list_lock);
list_add_tail(&ima_ns->list, &ima_ns_list);
up_write(&ima_ns_list_lock);