提交 53b626f9 编写于 作者: P Petko Manolov 提交者: Mimi Zohar

IMA: use list_splice_tail_init_rcu() instead of its open coded variant

Use list_splice_tail_init_rcu() to extend the existing custom IMA policy
with additional IMA policy rules.
Signed-off-by: NPetko Manolov <petko.manolov@konsulko.com>
Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
上级 b4df8608
...@@ -527,22 +527,9 @@ int ima_check_policy(void) ...@@ -527,22 +527,9 @@ int ima_check_policy(void)
*/ */
void ima_update_policy(void) void ima_update_policy(void)
{ {
struct list_head *first, *last, *policy; struct list_head *policy = &ima_policy_rules;
/* append current policy with the new rules */ list_splice_tail_init_rcu(&ima_temp_rules, policy, synchronize_rcu);
first = (&ima_temp_rules)->next;
last = (&ima_temp_rules)->prev;
policy = &ima_policy_rules;
synchronize_rcu();
last->next = policy;
rcu_assign_pointer(list_next_rcu(policy->prev), first);
first->prev = policy->prev;
policy->prev = last;
/* prepare for the next policy rules addition */
INIT_LIST_HEAD(&ima_temp_rules);
if (ima_rules != policy) { if (ima_rules != policy) {
ima_policy_flag = 0; ima_policy_flag = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册