Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1200310
| From | Paul Moore <pmoore@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V4 (was V6)] audit: save signal match info in case entry passed in is the one deleted |
| Date | 2015-08-05 01:10 +0200 |
| Message-ID | <pTTvk-8pp-37@gated-at.bofh.it> (permalink) |
| References | <pSKX7-5YK-1@gated-at.bofh.it> <pSKX8-5YK-17@gated-at.bofh.it> |
| Organization | Red Hat |
On Saturday, August 01, 2015 03:44:01 PM Richard Guy Briggs wrote: > 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 <rgb@redhat.com> > --- > kernel/auditfilter.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c > index 4cb9b44..afb63b3 100644 > --- a/kernel/auditfilter.c > +++ b/kernel/auditfilter.c > @@ -943,6 +943,7 @@ static inline int audit_del_rule(struct audit_entry > *entry) int ret = 0; > #ifdef CONFIG_AUDITSYSCALL > int dont_count = 0; > + int match_signal = !audit_match_signal(entry); > > /* If either of these, don't count towards total */ > if (entry->rule.listnr == AUDIT_FILTER_USER || > @@ -972,7 +973,7 @@ static inline int audit_del_rule(struct audit_entry > *entry) if (!dont_count) > audit_n_rules--; > > - if (!audit_match_signal(entry)) > + if (match_signal) > audit_signals--; > #endif > mutex_unlock(&audit_filter_mutex); Why not simply move this second CONFIG_AUDITSYSCALL above the list_del() calls? Am I missing something? Also, while we're fixing up audit_del_rule(), why not also move the mutex_unlock() call to after the "out" jump target and then drop the mutex_unlock() call in the audit_find_rule() error case? Not your fault, but the code seems silly as-is. -- paul moore security @ redhat -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH V4 (was V6)] audit: save signal match info in case entry passed in is the one deleted Paul Moore <pmoore@redhat.com> - 2015-08-05 01:10 +0200 Re: [PATCH V4 (was V6)] audit: save signal match info in case entry passed in is the one deleted Richard Guy Briggs <rgb@redhat.com> - 2015-08-05 11:30 +0200
csiph-web