Skip to contentSkip to conversation

linux-next: manual merge of the audit tree with the origin tree

PATCH Mark Brown 2 participants 2 messages Oct 16

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

Today's linux-next merge of the audit tree got a conflict in:

kernel/audit_tree.c

between commit:

aa650d87a4988 ("audit: fix exe mark UAF in kill_rules()")

from the origin tree and commit:

ca12826b4aac8 ("audit: Fix filter rule accounting after automatic removal")

from the audit tree. I'm really unsure about this merge, it's not clear to me if the unaccounting should go in the initial loop or the RCU free loop.

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

kernel/audit_tree.c +0 -0
diff --cc kernel/audit_tree.c
index f2e81be8265e8,2d68d2ec2b2a1..0000000000000
@@@ -573,9 -550,17 +573,10 @@@ static void kill_rules(struct audit_con
  		entry = container_of(rule, struct audit_entry, rule);
  
  		list_del_init(&rule->rlist);
 -		if (rule->tree) {
 -			/* not a half-baked one */
 -			audit_tree_log_remove_rule(context, rule);
 -			if (entry->rule.exe)
 -				audit_remove_mark(entry->rule.exe);
 -			rule->tree = NULL;
 -			list_del_rcu(&entry->list);
 -			list_del(&entry->rule.list);
 -			audit_rule_unaccount(rule);
 -			call_rcu(&entry->rcu, audit_free_rule_rcu);
 -		}
 +		if (entry->rule.exe)
 +			audit_remove_mark(entry->rule.exe);
++		audit_rule_unaccount(rule);
 +		call_rcu(&entry->rcu, audit_free_rule_rcu);
  	}
  }
  
maintainer
#1 lore raw
Quoted 19 lines · Mark Brown

Hi all,

Today's linux-next merge of the audit tree got a conflict in:

kernel/audit_tree.c

between commit:

aa650d87a4988 ("audit: fix exe mark UAF in kill_rules()")

from the origin tree and commit:

ca12826b4aac8 ("audit: Fix filter rule accounting after automatic removal")

from the audit tree. I'm really unsure about this merge, it's not clear to me if the unaccounting should go in the initial loop or the RCU free loop.

Quoted 6 lines

I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Hi Mark,

My apologies, I was preparing the audit branches for the upcoming merge window and it looks like I pushed an experiment to the next branch and never corrected it. I'm sorry about that. It should be fixed now, but of course if you see any additional problems please let me know.

In case anyone is curious, this is the merge fixup that was in the audit/next branch previously, and what is in there once again:

kernel/audit_tree.c +0 -0
index f2e81be8265e..e83b9fef048f 100644
@@ -558,6 +558,7 @@ static void kill_rules(struct audit_context *context, struct

audit_tree *tree)

                       list_del(&entry->rule.list);
                       if (entry->rule.exe)
                               need_sync = true;
+                       audit_rule_unaccount(rule);
               } else {
                       list_del_init(&rule->rlist);
               }
Signature · 1 line
paul-moore.com