diff options
Diffstat (limited to 'kernel/audit.h')
-rw-r--r-- | kernel/audit.h | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/kernel/audit.h b/kernel/audit.h index 16f18cac661b..91e7071c4d2c 100644 --- a/kernel/audit.h +++ b/kernel/audit.h | |||
@@ -53,18 +53,7 @@ enum audit_state { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | /* Rule lists */ | 55 | /* Rule lists */ |
56 | struct audit_parent; | 56 | struct audit_watch; |
57 | |||
58 | struct audit_watch { | ||
59 | atomic_t count; /* reference count */ | ||
60 | char *path; /* insertion path */ | ||
61 | dev_t dev; /* associated superblock device */ | ||
62 | unsigned long ino; /* associated inode number */ | ||
63 | struct audit_parent *parent; /* associated parent */ | ||
64 | struct list_head wlist; /* entry in parent->watches list */ | ||
65 | struct list_head rules; /* associated rules */ | ||
66 | }; | ||
67 | |||
68 | struct audit_tree; | 57 | struct audit_tree; |
69 | struct audit_chunk; | 58 | struct audit_chunk; |
70 | 59 | ||
@@ -95,10 +84,7 @@ extern int audit_compare_dname_path(const char *dname, const char *path, | |||
95 | int *dirlen); | 84 | int *dirlen); |
96 | extern struct sk_buff * audit_make_reply(int pid, int seq, int type, | 85 | extern struct sk_buff * audit_make_reply(int pid, int seq, int type, |
97 | int done, int multi, | 86 | int done, int multi, |
98 | void *payload, int size); | 87 | const void *payload, int size); |
99 | extern void audit_send_reply(int pid, int seq, int type, | ||
100 | int done, int multi, | ||
101 | void *payload, int size); | ||
102 | extern void audit_panic(const char *message); | 88 | extern void audit_panic(const char *message); |
103 | 89 | ||
104 | struct audit_netlink_list { | 90 | struct audit_netlink_list { |
@@ -108,19 +94,34 @@ struct audit_netlink_list { | |||
108 | 94 | ||
109 | int audit_send_list(void *); | 95 | int audit_send_list(void *); |
110 | 96 | ||
111 | struct inotify_watch; | ||
112 | /* Inotify handle */ | ||
113 | extern struct inotify_handle *audit_ih; | ||
114 | |||
115 | extern void audit_free_parent(struct inotify_watch *); | ||
116 | extern void audit_handle_ievent(struct inotify_watch *, u32, u32, u32, | ||
117 | const char *, struct inode *); | ||
118 | extern int selinux_audit_rule_update(void); | 97 | extern int selinux_audit_rule_update(void); |
119 | 98 | ||
120 | extern struct mutex audit_filter_mutex; | 99 | extern struct mutex audit_filter_mutex; |
121 | extern void audit_free_rule_rcu(struct rcu_head *); | 100 | extern void audit_free_rule_rcu(struct rcu_head *); |
122 | extern struct list_head audit_filter_list[]; | 101 | extern struct list_head audit_filter_list[]; |
123 | 102 | ||
103 | extern struct audit_entry *audit_dupe_rule(struct audit_krule *old); | ||
104 | |||
105 | /* audit watch functions */ | ||
106 | #ifdef CONFIG_AUDIT_WATCH | ||
107 | extern void audit_put_watch(struct audit_watch *watch); | ||
108 | extern void audit_get_watch(struct audit_watch *watch); | ||
109 | extern int audit_to_watch(struct audit_krule *krule, char *path, int len, u32 op); | ||
110 | extern int audit_add_watch(struct audit_krule *krule, struct list_head **list); | ||
111 | extern void audit_remove_watch_rule(struct audit_krule *krule); | ||
112 | extern char *audit_watch_path(struct audit_watch *watch); | ||
113 | extern int audit_watch_compare(struct audit_watch *watch, unsigned long ino, dev_t dev); | ||
114 | #else | ||
115 | #define audit_put_watch(w) {} | ||
116 | #define audit_get_watch(w) {} | ||
117 | #define audit_to_watch(k, p, l, o) (-EINVAL) | ||
118 | #define audit_add_watch(k, l) (-EINVAL) | ||
119 | #define audit_remove_watch_rule(k) BUG() | ||
120 | #define audit_watch_path(w) "" | ||
121 | #define audit_watch_compare(w, i, d) 0 | ||
122 | |||
123 | #endif /* CONFIG_AUDIT_WATCH */ | ||
124 | |||
124 | #ifdef CONFIG_AUDIT_TREE | 125 | #ifdef CONFIG_AUDIT_TREE |
125 | extern struct audit_chunk *audit_tree_lookup(const struct inode *); | 126 | extern struct audit_chunk *audit_tree_lookup(const struct inode *); |
126 | extern void audit_put_chunk(struct audit_chunk *); | 127 | extern void audit_put_chunk(struct audit_chunk *); |
@@ -130,10 +131,9 @@ extern int audit_add_tree_rule(struct audit_krule *); | |||
130 | extern int audit_remove_tree_rule(struct audit_krule *); | 131 | extern int audit_remove_tree_rule(struct audit_krule *); |
131 | extern void audit_trim_trees(void); | 132 | extern void audit_trim_trees(void); |
132 | extern int audit_tag_tree(char *old, char *new); | 133 | extern int audit_tag_tree(char *old, char *new); |
133 | extern void audit_schedule_prune(void); | ||
134 | extern void audit_prune_trees(void); | ||
135 | extern const char *audit_tree_path(struct audit_tree *); | 134 | extern const char *audit_tree_path(struct audit_tree *); |
136 | extern void audit_put_tree(struct audit_tree *); | 135 | extern void audit_put_tree(struct audit_tree *); |
136 | extern void audit_kill_trees(struct list_head *); | ||
137 | #else | 137 | #else |
138 | #define audit_remove_tree_rule(rule) BUG() | 138 | #define audit_remove_tree_rule(rule) BUG() |
139 | #define audit_add_tree_rule(rule) -EINVAL | 139 | #define audit_add_tree_rule(rule) -EINVAL |
@@ -142,6 +142,7 @@ extern void audit_put_tree(struct audit_tree *); | |||
142 | #define audit_put_tree(tree) (void)0 | 142 | #define audit_put_tree(tree) (void)0 |
143 | #define audit_tag_tree(old, new) -EINVAL | 143 | #define audit_tag_tree(old, new) -EINVAL |
144 | #define audit_tree_path(rule) "" /* never called */ | 144 | #define audit_tree_path(rule) "" /* never called */ |
145 | #define audit_kill_trees(list) BUG() | ||
145 | #endif | 146 | #endif |
146 | 147 | ||
147 | extern char *audit_unpack_string(void **, size_t *, size_t); | 148 | extern char *audit_unpack_string(void **, size_t *, size_t); |
@@ -160,7 +161,10 @@ static inline int audit_signal_info(int sig, struct task_struct *t) | |||
160 | return 0; | 161 | return 0; |
161 | } | 162 | } |
162 | extern void audit_filter_inodes(struct task_struct *, struct audit_context *); | 163 | extern void audit_filter_inodes(struct task_struct *, struct audit_context *); |
164 | extern struct list_head *audit_killed_trees(void); | ||
163 | #else | 165 | #else |
164 | #define audit_signal_info(s,t) AUDIT_DISABLED | 166 | #define audit_signal_info(s,t) AUDIT_DISABLED |
165 | #define audit_filter_inodes(t,c) AUDIT_DISABLED | 167 | #define audit_filter_inodes(t,c) AUDIT_DISABLED |
166 | #endif | 168 | #endif |
169 | |||
170 | extern struct mutex audit_cmd_mutex; | ||