Skip to contentSkip to conversation

Patch "ima: cleanup ima_init_policy() a little" has been added to the 4.1-stable tree

PATCH [email protected] 1 participant 1 message Jul 30, 2015

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ima: cleanup ima_init_policy() a little

to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ima-cleanup-ima_init_policy-a-little.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 5577857f8e26e9027271f10daf96361640907300 Mon Sep 17 00:00:00 2001

From: Dan Carpenter <[email protected]>
Date: Tue, 7 Apr 2015 12:22:11 +0300
Subject: ima: cleanup ima_init_policy() a little

From: Dan Carpenter <[email protected]>

commit 5577857f8e26e9027271f10daf96361640907300 upstream.

It's a bit easier to read this if we split it up into two for loops.

---
 security/integrity/ima/ima_policy.c |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
security/integrity/ima/ima_policy.c +5 -9
@@ -340,16 +340,12 @@ void __init ima_init_policy(void)
 	appraise_entries = ima_use_appraise_tcb ?
 			 ARRAY_SIZE(default_appraise_rules) : 0;
 
-	for (i = 0; i < measure_entries + appraise_entries; i++) {
-		if (i < measure_entries)
-			list_add_tail(&default_rules[i].list,
-				      &ima_default_rules);
-		else {
-			int j = i - measure_entries;
+	for (i = 0; i < measure_entries; i++)
+		list_add_tail(&default_rules[i].list, &ima_default_rules);
 
-			list_add_tail(&default_appraise_rules[j].list,
-				      &ima_default_rules);
-		}
+	for (i = 0; i < appraise_entries; i++) {
+		list_add_tail(&default_appraise_rules[i].list,
+			      &ima_default_rules);
 	}
 
 	ima_rules = &ima_default_rules;

Patches currently in stable-queue which might be from [email protected] are

queue-4.1/ima-cleanup-ima_init_policy-a-little.patch queue-4.1/usb-devio-fix-a-condition-in-async_completed.patch queue-4.1/asoc-imx-wm8962-add-a-missing-error-check.patch queue-4.1/ath9k_htc-memory-corruption-calling-set_bit.patch