From: Richard Guy Briggs <rgb@redhat.com>
To: linux-audit@redhat.com
Cc: Richard Guy Briggs <rgb@redhat.com>
Subject: [PATCH 14/14] audit: enable audit_get/put_mark()
Date: Tue, 17 Jun 2014 23:09:49 -0400 [thread overview]
Message-ID: <42425ec84afea28f141ec8ff0ef40d86246a5f32.1403060033.git.rgb@redhat.com> (raw)
In-Reply-To: <cover.1403060033.git.rgb@redhat.com>
In-Reply-To: <cover.1403060033.git.rgb@redhat.com>
---
kernel/audit.h | 2 ++
kernel/audit_fsnotify.c | 6 +++---
kernel/auditfilter.c | 10 +++++-----
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/kernel/audit.h b/kernel/audit.h
index 2093c5e..3151ae5 100644
--- a/kernel/audit.h
+++ b/kernel/audit.h
@@ -288,6 +288,8 @@ char *audit_mark_path(struct audit_fsnotify_mark *mark);
int audit_add_mark_rule(struct audit_krule *krule, struct list_head **list);
void audit_remove_mark(struct audit_fsnotify_mark *audit_mark);
int audit_mark_compare(struct audit_fsnotify_mark *mark, unsigned long ino, dev_t dev);
+void audit_get_mark(struct audit_fsnotify_mark *audit_mark);
+void audit_put_mark(struct audit_fsnotify_mark *audit_mark);
int audit_dup_exe(struct audit_krule *new, struct audit_krule *old);
int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark *mark);
diff --git a/kernel/audit_fsnotify.c b/kernel/audit_fsnotify.c
index cc4175a..f5789e1 100644
--- a/kernel/audit_fsnotify.c
+++ b/kernel/audit_fsnotify.c
@@ -65,14 +65,14 @@ static void audit_free_fsnotify_mark(struct fsnotify_mark *mark)
audit_free_mark(audit_mark);
}
-#if 0 /* not sure if we need these... */
-static void audit_get_mark(struct audit_fsnotify_mark *audit_mark)
+#if 1 /* not sure if we need these... */
+void audit_get_mark(struct audit_fsnotify_mark *audit_mark)
{
if (likely(audit_mark))
fsnotify_get_mark(&audit_mark->mark);
}
-static void audit_put_mark(struct audit_fsnotify_mark *audit_mark)
+void audit_put_mark(struct audit_fsnotify_mark *audit_mark)
{
if (likely(audit_mark))
fsnotify_put_mark(&audit_mark->mark);
diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c
index 7b6e892..3d168ca 100644
--- a/kernel/auditfilter.c
+++ b/kernel/auditfilter.c
@@ -81,7 +81,7 @@ static inline void audit_free_rule(struct audit_entry *e)
if (erule->watch)
audit_put_watch(erule->watch);
if (erule->exe)
- fsnotify_put_mark(erule->exe->mark);
+ audit_put_mark(erule->exe);
if (erule->fields)
for (i = 0; i < erule->field_count; i++) {
struct audit_field *f = &erule->fields[i];
@@ -569,7 +569,7 @@ static struct audit_entry *audit_data_to_entry(struct audit_rule_data *data,
err = PTR_ERR(audit_mark);
goto exit_free;
}
- fsnotify_get_mark(audit_mark->mark);
+ audit_get_mark(audit_mark);
entry->rule.exe = audit_mark;
break;
}
@@ -587,7 +587,7 @@ exit_free:
if (entry->rule.tree)
audit_put_tree(entry->rule.tree); /* that's the temporary one */
if (entry->rule.exe)
- fsnotify_put_mark(entry->rule.exe->mark); /* matches initial get */
+ audit_put_mark(entry->rule.exe); /* matches initial get */
audit_free_rule(entry);
return ERR_PTR(err);
}
@@ -991,7 +991,7 @@ error:
if (watch)
audit_put_watch(watch); /* tmp watch, matches initial get */
if (exe)
- fsnotify_put_mark(exe->mark); /* tmp mark, matches initial get */
+ audit_put_mark(exe); /* tmp mark, matches initial get */
return err;
}
@@ -1049,7 +1049,7 @@ out:
if (tree)
audit_put_tree(tree); /* that's the temporary one */
if (exe)
- fsnotify_put_mark(exe->mark); /* match initial get */
+ audit_put_mark(exe); /* match initial get */
return ret;
}
--
1.7.1
next prev parent reply other threads:[~2014-06-18 3:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 3:09 [PATCH 00/14] audit by executable name Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 01/14] audit: implement audit by executable Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 02/14] audit: clean simple fsnotify implementation Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 03/14] audit: convert audit_exe to audit_fsnotify Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 04/14] fixup! " Richard Guy Briggs
2014-06-18 13:38 ` Eric Paris
2014-06-18 20:18 ` Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 05/14] fixup! audit: clean simple fsnotify implementation Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 06/14] audit: avoid double copying the audit_exe path string Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 07/14] fixup! audit: convert audit_exe to audit_fsnotify Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 08/14] fixup! audit: clean simple fsnotify implementation Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 09/14] audit: put rule existence check in canonical order Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 10/14] fixup! audit: implement audit by executable Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 11/14] " Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 12/14] fixup! audit: clean simple fsnotify implementation Richard Guy Briggs
2014-06-18 3:09 ` [PATCH 13/14] audit: continue fleshing out audit by exe Richard Guy Briggs
2014-06-18 14:08 ` Eric Paris
2014-06-25 20:19 ` Richard Guy Briggs
2014-06-18 3:09 ` Richard Guy Briggs [this message]
2014-06-18 14:09 ` [PATCH 14/14] audit: enable audit_get/put_mark() Eric Paris
2014-06-18 20:21 ` Richard Guy Briggs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42425ec84afea28f141ec8ff0ef40d86246a5f32.1403060033.git.rgb@redhat.com \
--to=rgb@redhat.com \
--cc=linux-audit@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox