aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRichard Guy Briggs <rgb@redhat.com>2019-01-22 17:07:41 -0500
committerPaul Moore <paul@paul-moore.com>2019-01-25 16:48:10 -0500
commit05c7a9cb2727cd3c3d8e767f48e5cd18486a8d16 (patch)
tree2bed19398c58104eb6668c90be33b7af227e8d1b /kernel
parenta252f56a3c922197ef40dce8f8cc258ae75e0193 (diff)
audit: clean up AUDITSYSCALL prototypes and stubs
Pull together all the audit syscall watch, mark and tree prototypes and stubs into the same ifdef. Signed-off-by: Richard Guy Briggs <rgb@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.h64
1 files changed, 33 insertions, 31 deletions
diff --git a/kernel/audit.h b/kernel/audit.h
index deefdbe61a47..9acb8691ed87 100644
--- a/kernel/audit.h
+++ b/kernel/audit.h
@@ -268,25 +268,47 @@ extern void audit_log_d_path_exe(struct audit_buffer *ab,
268extern struct tty_struct *audit_get_tty(void); 268extern struct tty_struct *audit_get_tty(void);
269extern void audit_put_tty(struct tty_struct *tty); 269extern void audit_put_tty(struct tty_struct *tty);
270 270
271/* audit watch functions */ 271/* audit watch/mark/tree functions */
272#ifdef CONFIG_AUDITSYSCALL 272#ifdef CONFIG_AUDITSYSCALL
273extern void audit_put_watch(struct audit_watch *watch); 273extern void audit_put_watch(struct audit_watch *watch);
274extern void audit_get_watch(struct audit_watch *watch); 274extern void audit_get_watch(struct audit_watch *watch);
275extern int audit_to_watch(struct audit_krule *krule, char *path, int len, u32 op); 275extern int audit_to_watch(struct audit_krule *krule, char *path, int len,
276 u32 op);
276extern int audit_add_watch(struct audit_krule *krule, struct list_head **list); 277extern int audit_add_watch(struct audit_krule *krule, struct list_head **list);
277extern void audit_remove_watch_rule(struct audit_krule *krule); 278extern void audit_remove_watch_rule(struct audit_krule *krule);
278extern char *audit_watch_path(struct audit_watch *watch); 279extern char *audit_watch_path(struct audit_watch *watch);
279extern int audit_watch_compare(struct audit_watch *watch, unsigned long ino, dev_t dev); 280extern int audit_watch_compare(struct audit_watch *watch, unsigned long ino,
281 dev_t dev);
280 282
281extern struct audit_fsnotify_mark *audit_alloc_mark(struct audit_krule *krule, char *pathname, int len); 283extern struct audit_fsnotify_mark *audit_alloc_mark(struct audit_krule *krule,
284 char *pathname, int len);
282extern char *audit_mark_path(struct audit_fsnotify_mark *mark); 285extern char *audit_mark_path(struct audit_fsnotify_mark *mark);
283extern void audit_remove_mark(struct audit_fsnotify_mark *audit_mark); 286extern void audit_remove_mark(struct audit_fsnotify_mark *audit_mark);
284extern void audit_remove_mark_rule(struct audit_krule *krule); 287extern void audit_remove_mark_rule(struct audit_krule *krule);
285extern int audit_mark_compare(struct audit_fsnotify_mark *mark, unsigned long ino, dev_t dev); 288extern int audit_mark_compare(struct audit_fsnotify_mark *mark,
289 unsigned long ino, dev_t dev);
286extern int audit_dupe_exe(struct audit_krule *new, struct audit_krule *old); 290extern int audit_dupe_exe(struct audit_krule *new, struct audit_krule *old);
287extern int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark *mark); 291extern int audit_exe_compare(struct task_struct *tsk,
292 struct audit_fsnotify_mark *mark);
288 293
289#else 294extern struct audit_chunk *audit_tree_lookup(const struct inode *inode);
295extern void audit_put_chunk(struct audit_chunk *chunk);
296extern bool audit_tree_match(struct audit_chunk *chunk,
297 struct audit_tree *tree);
298extern int audit_make_tree(struct audit_krule *rule, char *pathname, u32 op);
299extern int audit_add_tree_rule(struct audit_krule *rule);
300extern int audit_remove_tree_rule(struct audit_krule *rule);
301extern void audit_trim_trees(void);
302extern int audit_tag_tree(char *old, char *new);
303extern const char *audit_tree_path(struct audit_tree *tree);
304extern void audit_put_tree(struct audit_tree *tree);
305extern void audit_kill_trees(struct audit_context *context);
306
307extern int audit_signal_info(int sig, struct task_struct *t);
308extern void audit_filter_inodes(struct task_struct *tsk,
309 struct audit_context *ctx);
310extern struct list_head *audit_killed_trees(void);
311#else /* CONFIG_AUDITSYSCALL */
290#define audit_put_watch(w) {} 312#define audit_put_watch(w) {}
291#define audit_get_watch(w) {} 313#define audit_get_watch(w) {}
292#define audit_to_watch(k, p, l, o) (-EINVAL) 314#define audit_to_watch(k, p, l, o) (-EINVAL)
@@ -302,21 +324,7 @@ extern int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark
302#define audit_mark_compare(m, i, d) 0 324#define audit_mark_compare(m, i, d) 0
303#define audit_exe_compare(t, m) (-EINVAL) 325#define audit_exe_compare(t, m) (-EINVAL)
304#define audit_dupe_exe(n, o) (-EINVAL) 326#define audit_dupe_exe(n, o) (-EINVAL)
305#endif /* CONFIG_AUDITSYSCALL */
306 327
307#ifdef CONFIG_AUDITSYSCALL
308extern struct audit_chunk *audit_tree_lookup(const struct inode *inode);
309extern void audit_put_chunk(struct audit_chunk *chunk);
310extern bool audit_tree_match(struct audit_chunk *chunk, struct audit_tree *tree);
311extern int audit_make_tree(struct audit_krule *rule, char *pathname, u32 op);
312extern int audit_add_tree_rule(struct audit_krule *rule);
313extern int audit_remove_tree_rule(struct audit_krule *rule);
314extern void audit_trim_trees(void);
315extern int audit_tag_tree(char *old, char *new);
316extern const char *audit_tree_path(struct audit_tree *tree);
317extern void audit_put_tree(struct audit_tree *tree);
318extern void audit_kill_trees(struct audit_context *context);
319#else
320#define audit_remove_tree_rule(rule) BUG() 328#define audit_remove_tree_rule(rule) BUG()
321#define audit_add_tree_rule(rule) -EINVAL 329#define audit_add_tree_rule(rule) -EINVAL
322#define audit_make_tree(rule, str, op) -EINVAL 330#define audit_make_tree(rule, str, op) -EINVAL
@@ -325,7 +333,10 @@ extern void audit_kill_trees(struct audit_context *context);
325#define audit_tag_tree(old, new) -EINVAL 333#define audit_tag_tree(old, new) -EINVAL
326#define audit_tree_path(rule) "" /* never called */ 334#define audit_tree_path(rule) "" /* never called */
327#define audit_kill_trees(context) BUG() 335#define audit_kill_trees(context) BUG()
328#endif 336
337#define audit_signal_info(s, t) AUDIT_DISABLED
338#define audit_filter_inodes(t, c) AUDIT_DISABLED
339#endif /* CONFIG_AUDITSYSCALL */
329 340
330extern char *audit_unpack_string(void **bufp, size_t *remain, size_t len); 341extern char *audit_unpack_string(void **bufp, size_t *remain, size_t len);
331 342
@@ -335,14 +346,5 @@ extern u32 audit_sig_sid;
335 346
336extern int audit_filter(int msgtype, unsigned int listtype); 347extern int audit_filter(int msgtype, unsigned int listtype);
337 348
338#ifdef CONFIG_AUDITSYSCALL
339extern int audit_signal_info(int sig, struct task_struct *t);
340extern void audit_filter_inodes(struct task_struct *tsk, struct audit_context *ctx);
341extern struct list_head *audit_killed_trees(void);
342#else
343#define audit_signal_info(s,t) AUDIT_DISABLED
344#define audit_filter_inodes(t,c) AUDIT_DISABLED
345#endif
346
347extern void audit_ctl_lock(void); 349extern void audit_ctl_lock(void);
348extern void audit_ctl_unlock(void); 350extern void audit_ctl_unlock(void);