Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154223
b: refs/heads/master
c: cfcad62
h: refs/heads/master
i:
  154221: 661bb5a
  154219: 3759bf3
  154215: 481e185
  154207: 25a0816
v: v3
  • Loading branch information
Eric Paris authored and Al Viro committed Jun 24, 2009
1 parent 233d894 commit 59b8192
Show file tree
Hide file tree
Showing 7 changed files with 573 additions and 507 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: ea7ae60bfe39aeedfb29571c47280bf0067ee5f3
refs/heads/master: cfcad62c74abfef83762dc05a556d21bdf3980a2
2 changes: 1 addition & 1 deletion trunk/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ obj-$(CONFIG_RESOURCE_COUNTERS) += res_counter.o
obj-$(CONFIG_STOP_MACHINE) += stop_machine.o
obj-$(CONFIG_KPROBES_SANITY_TEST) += test_kprobes.o
obj-$(CONFIG_AUDIT) += audit.o auditfilter.o
obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
obj-$(CONFIG_AUDITSYSCALL) += auditsc.o audit_watch.o
obj-$(CONFIG_GCOV_KERNEL) += gcov/
obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
obj-$(CONFIG_KPROBES) += kprobes.o
Expand Down
16 changes: 0 additions & 16 deletions trunk/kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ static atomic_t audit_lost = ATOMIC_INIT(0);
/* The netlink socket. */
static struct sock *audit_sock;

/* Inotify handle. */
struct inotify_handle *audit_ih;

/* Hash for inode-based rules */
struct list_head audit_inode_hash[AUDIT_INODE_BUCKETS];

Expand Down Expand Up @@ -971,13 +968,6 @@ static void audit_receive(struct sk_buff *skb)
mutex_unlock(&audit_cmd_mutex);
}

#ifdef CONFIG_AUDITSYSCALL
static const struct inotify_operations audit_inotify_ops = {
.handle_event = audit_handle_ievent,
.destroy_watch = audit_free_parent,
};
#endif

/* Initialize audit support at boot time. */
static int __init audit_init(void)
{
Expand All @@ -1003,12 +993,6 @@ static int __init audit_init(void)

audit_log(NULL, GFP_KERNEL, AUDIT_KERNEL, "initialized");

#ifdef CONFIG_AUDITSYSCALL
audit_ih = inotify_init(&audit_inotify_ops);
if (IS_ERR(audit_ih))
audit_panic("cannot initialize inotify handle");
#endif

for (i = 0; i < AUDIT_INODE_BUCKETS; i++)
INIT_LIST_HEAD(&audit_inode_hash[i]);

Expand Down
39 changes: 20 additions & 19 deletions trunk/kernel/audit.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,7 @@ enum audit_state {
};

/* Rule lists */
struct audit_parent;

struct audit_watch {
atomic_t count; /* reference count */
char *path; /* insertion path */
dev_t dev; /* associated superblock device */
unsigned long ino; /* associated inode number */
struct audit_parent *parent; /* associated parent */
struct list_head wlist; /* entry in parent->watches list */
struct list_head rules; /* associated rules */
};

struct audit_watch;
struct audit_tree;
struct audit_chunk;

Expand Down Expand Up @@ -108,19 +97,31 @@ struct audit_netlink_list {

int audit_send_list(void *);

struct inotify_watch;
/* Inotify handle */
extern struct inotify_handle *audit_ih;

extern void audit_free_parent(struct inotify_watch *);
extern void audit_handle_ievent(struct inotify_watch *, u32, u32, u32,
const char *, struct inode *);
extern int selinux_audit_rule_update(void);

extern struct mutex audit_filter_mutex;
extern void audit_free_rule_rcu(struct rcu_head *);
extern struct list_head audit_filter_list[];

/* audit watch functions */
extern unsigned long audit_watch_inode(struct audit_watch *watch);
extern dev_t audit_watch_dev(struct audit_watch *watch);
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_get_nd(char *path, struct nameidata **ndp, struct nameidata **ndw);
extern void audit_put_nd(struct nameidata *ndp, struct nameidata *ndw);
extern int audit_add_watch(struct audit_krule *krule, struct nameidata *ndp,
struct nameidata *ndw);
extern void audit_remove_watch(struct audit_watch *watch);
extern void audit_remove_watch_rule(struct audit_krule *krule, struct list_head *list);
extern void audit_inotify_unregister(struct list_head *in_list);
extern char *audit_watch_path(struct audit_watch *watch);
extern struct list_head *audit_watch_rules(struct audit_watch *watch);

extern struct audit_entry *audit_dupe_rule(struct audit_krule *old,
struct audit_watch *watch);

#ifdef CONFIG_AUDIT_TREE
extern struct audit_chunk *audit_tree_lookup(const struct inode *);
extern void audit_put_chunk(struct audit_chunk *);
Expand Down
Loading

0 comments on commit 59b8192

Please sign in to comment.