From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Guy Briggs Subject: [PATCH 04/12] [V3] fixup! audit: clean simple fsnotify implementation Date: Wed, 2 Jul 2014 14:05:12 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: In-Reply-To: References: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-audit-bounces@redhat.com Errors-To: linux-audit-bounces@redhat.com To: linux-audit@redhat.com Cc: Richard Guy Briggs List-Id: linux-audit@redhat.com Move the access to the entry for audit_match_signal() to the beginning of the function in case the entry found is the same one passed in. This will enable it to be used by audit_remove_mark_rule(). Signed-off-by: Richard Guy Briggs --- This might benefit from a flag to tell it to delete the entry handed it rather than searching for an identical one. --- kernel/auditfilter.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c index 30091ce..9b2db56 100644 --- a/kernel/auditfilter.c +++ b/kernel/auditfilter.c @@ -990,6 +990,7 @@ int audit_del_rule(struct audit_entry *entry) int ret = 0; #ifdef CONFIG_AUDITSYSCALL int dont_count = 0; + int match = audit_match_signal(entry); /* If either of these, don't count towards total */ if (entry->rule.listnr == AUDIT_FILTER_USER || @@ -1021,7 +1022,7 @@ int audit_del_rule(struct audit_entry *entry) if (!dont_count) audit_n_rules--; - if (!audit_match_signal(entry)) + if (!match) audit_signals--; #endif mutex_unlock(&audit_filter_mutex); -- 1.7.1