aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/auditfilter.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 7f347c360876..a3a32752f973 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -69,7 +69,7 @@ static inline int audit_copy_rule(struct audit_rule *d, struct audit_rule *s)
69/* Check to see if two rules are identical. It is called from 69/* Check to see if two rules are identical. It is called from
70 * audit_add_rule during AUDIT_ADD and 70 * audit_add_rule during AUDIT_ADD and
71 * audit_del_rule during AUDIT_DEL. */ 71 * audit_del_rule during AUDIT_DEL. */
72static inline int audit_compare_rule(struct audit_rule *a, struct audit_rule *b) 72static int audit_compare_rule(struct audit_rule *a, struct audit_rule *b)
73{ 73{
74 int i; 74 int i;
75 75
@@ -107,19 +107,18 @@ static inline int audit_add_rule(struct audit_rule *rule,
107 /* Do not use the _rcu iterator here, since this is the only 107 /* Do not use the _rcu iterator here, since this is the only
108 * addition routine. */ 108 * addition routine. */
109 list_for_each_entry(entry, list, list) { 109 list_for_each_entry(entry, list, list) {
110 if (!audit_compare_rule(rule, &entry->rule)) { 110 if (!audit_compare_rule(rule, &entry->rule))
111 return -EEXIST; 111 return -EEXIST;
112 }
113 } 112 }
114 113
115 for (i = 0; i < rule->field_count; i++) { 114 for (i = 0; i < rule->field_count; i++) {
116 if (rule->fields[i] & AUDIT_UNUSED_BITS) 115 if (rule->fields[i] & AUDIT_UNUSED_BITS)
117 return -EINVAL; 116 return -EINVAL;
118 if ( rule->fields[i] & AUDIT_NEGATE ) 117 if ( rule->fields[i] & AUDIT_NEGATE)
119 rule->fields[i] |= AUDIT_NOT_EQUAL; 118 rule->fields[i] |= AUDIT_NOT_EQUAL;
120 else if ( (rule->fields[i] & AUDIT_OPERATORS) == 0 ) 119 else if ( (rule->fields[i] & AUDIT_OPERATORS) == 0 )
121 rule->fields[i] |= AUDIT_EQUAL; 120 rule->fields[i] |= AUDIT_EQUAL;
122 rule->fields[i] &= (~AUDIT_NEGATE); 121 rule->fields[i] &= ~AUDIT_NEGATE;
123 } 122 }
124 123
125 if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL))) 124 if (!(entry = kmalloc(sizeof(*entry), GFP_KERNEL)))
@@ -374,5 +373,3 @@ unlock_and_return:
374 rcu_read_unlock(); 373 rcu_read_unlock();
375 return result; 374 return result;
376} 375}
377
378