On Fri, Mar 03, 2006 at 02:32:21AM -0800, akpm(a)osdl.org wrote:
The patch titled
git-audit-master build fix
has been added to the -mm tree. Its filename is
git-audit-master-build-fix.patch
See
http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this
From: Andrew Morton <akpm(a)osdl.org>
CONFIG_AUDIT=y, CONFIG_AUDITSYSCALL=n:
kernel/auditfilter.c: In function `audit_add_rule':
kernel/auditfilter.c:329: error: invalid lvalue in increment
kernel/auditfilter.c: In function `audit_del_rule':
kernel/auditfilter.c:348: error: invalid lvalue in increment
kernel/auditfilter.c:350: error: invalid lvalue in decrement
possibly-hacky-fix:
No, that defeats the purpose of that thing. It's increments and
decrements that should be conditional. Patch below should fix
that; it, or better will be folded into Jason's patch at the next
rebase.
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index aeaba84..f31e6b6 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -334,7 +334,9 @@ static inline int audit_add_rule(struct
struct list_head *list)
{
struct audit_entry *e;
+#ifdef CONFIG_AUDITSYSCALL
int dont_count = 0;
+#endif
/* Do not use the _rcu iterator here, since this is the only
* addition routine. */
@@ -344,16 +346,20 @@ static inline int audit_add_rule(struct
}
/* If either of these, don't count towards total */
+#ifdef CONFIG_AUDITSYSCALL
if (entry->rule.listnr == AUDIT_FILTER_USER ||
entry->rule.listnr == AUDIT_FILTER_TYPE)
dont_count = 1;
+#endif
if (entry->rule.flags & AUDIT_FILTER_PREPEND) {
list_add_rcu(&entry->list, list);
} else {
list_add_tail_rcu(&entry->list, list);
}
+#ifdef CONFIG_AUDITSYSCALL
if (!dont_count)
audit_n_rules++;
+#endif
return 0;
}
@@ -370,11 +376,15 @@ static inline int audit_del_rule(struct
list_for_each_entry(e, list, list) {
if (!audit_compare_rule(&entry->rule, &e->rule)) {
list_del_rcu(&e->list);
+#ifdef CONFIG_AUDITSYSCALL
if (entry->rule.listnr == AUDIT_FILTER_USER ||
entry->rule.listnr == AUDIT_FILTER_TYPE)
audit_n_rules++;
+#endif
call_rcu(&e->rcu, audit_free_rule_rcu);
+#ifdef CONFIG_AUDITSYSCALL
audit_n_rules--;
+#endif
return 0;
}
}