Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207607
b: refs/heads/master
c: a05fb6c
h: refs/heads/master
i:
  207605: 54c9692
  207603: 6f72ce2
  207599: 1786822
v: v3
  • Loading branch information
Eric Paris committed Jul 28, 2010
1 parent 7adb548 commit 6320d0a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e118e9c5638bbe877aa26b5cd2fd223cc24cdc8a
refs/heads/master: a05fb6cc573130915380e00d182a4c6571cec6b2
3 changes: 1 addition & 2 deletions trunk/kernel/audit.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ extern void audit_put_watch(struct audit_watch *watch);
extern void audit_get_watch(struct audit_watch *watch);
extern int audit_to_watch(struct audit_krule *krule, char *path, int len, u32 op);
extern int audit_add_watch(struct audit_krule *krule, struct list_head **list);
extern void audit_remove_watch_rule(struct audit_krule *krule, struct list_head *list);
extern void audit_watch_inotify_unregister(struct list_head *in_list);
extern void audit_remove_watch_rule(struct audit_krule *krule);
extern char *audit_watch_path(struct audit_watch *watch);
extern int audit_watch_compare(struct audit_watch *watch, unsigned long ino, dev_t dev);
extern struct audit_entry *audit_dupe_rule(struct audit_krule *old);
Expand Down
27 changes: 3 additions & 24 deletions trunk/kernel/audit_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ struct audit_watch {
};

struct audit_parent {
struct list_head ilist; /* tmp list used to free parents */
struct list_head watches; /* anchor for audit_watch->wlist */
struct fsnotify_mark_entry mark; /* fsnotify mark on the inode */
};
Expand Down Expand Up @@ -356,20 +355,6 @@ static void audit_remove_parent_watches(struct audit_parent *parent)
fsnotify_destroy_mark_by_entry(&parent->mark);
}

/* Unregister inotify watches for parents on in_list.
* Generates an FS_IGNORED event. */
void audit_watch_inotify_unregister(struct list_head *in_list)
{
struct audit_parent *p, *n;

list_for_each_entry_safe(p, n, in_list, ilist) {
list_del(&p->ilist);
fsnotify_destroy_mark_by_entry(&p->mark);
/* matches the get in audit_remove_watch_rule() */
audit_put_parent(p);
}
}

/* Get path information necessary for adding watches. */
static int audit_get_nd(char *path, struct nameidata **ndp, struct nameidata **ndw)
{
Expand Down Expand Up @@ -502,7 +487,7 @@ int audit_add_watch(struct audit_krule *krule, struct list_head **list)

}

void audit_remove_watch_rule(struct audit_krule *krule, struct list_head *list)
void audit_remove_watch_rule(struct audit_krule *krule)
{
struct audit_watch *watch = krule->watch;
struct audit_parent *parent = watch->parent;
Expand All @@ -513,15 +498,9 @@ void audit_remove_watch_rule(struct audit_krule *krule, struct list_head *list)
audit_remove_watch(watch);

if (list_empty(&parent->watches)) {
/* Put parent on the un-registration list.
* Grab a reference before releasing
* audit_filter_mutex, to be released in
* audit_watch_inotify_unregister().
* If filesystem is going away, just leave
* the sucker alone, eviction will take
* care of it. */
audit_get_parent(parent);
list_add(&parent->ilist, list);
fsnotify_destroy_mark_by_entry(&parent->mark);
audit_put_parent(parent);
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions trunk/kernel/auditfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -945,7 +945,6 @@ static inline int audit_del_rule(struct audit_entry *entry)
struct audit_watch *watch = entry->rule.watch;
struct audit_tree *tree = entry->rule.tree;
struct list_head *list;
LIST_HEAD(inotify_unregister_list);
int ret = 0;
#ifdef CONFIG_AUDITSYSCALL
int dont_count = 0;
Expand All @@ -965,7 +964,7 @@ static inline int audit_del_rule(struct audit_entry *entry)
}

if (e->rule.watch)
audit_remove_watch_rule(&e->rule, &inotify_unregister_list);
audit_remove_watch_rule(&e->rule);

if (e->rule.tree)
audit_remove_tree_rule(&e->rule);
Expand All @@ -983,9 +982,6 @@ static inline int audit_del_rule(struct audit_entry *entry)
#endif
mutex_unlock(&audit_filter_mutex);

if (!list_empty(&inotify_unregister_list))
audit_watch_inotify_unregister(&inotify_unregister_list);

out:
if (watch)
audit_put_watch(watch); /* match initial get */
Expand Down

0 comments on commit 6320d0a

Please sign in to comment.