diff options
| author | Richard Guy Briggs <rgb@redhat.com> | 2019-01-22 17:07:41 -0500 |
|---|---|---|
| committer | Paul Moore <paul@paul-moore.com> | 2019-01-25 16:48:10 -0500 |
| commit | 05c7a9cb2727cd3c3d8e767f48e5cd18486a8d16 (patch) | |
| tree | 2bed19398c58104eb6668c90be33b7af227e8d1b /kernel | |
| parent | a252f56a3c922197ef40dce8f8cc258ae75e0193 (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.h | 64 |
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, | |||
| 268 | extern struct tty_struct *audit_get_tty(void); | 268 | extern struct tty_struct *audit_get_tty(void); |
| 269 | extern void audit_put_tty(struct tty_struct *tty); | 269 | extern 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 |
| 273 | extern void audit_put_watch(struct audit_watch *watch); | 273 | extern void audit_put_watch(struct audit_watch *watch); |
| 274 | extern void audit_get_watch(struct audit_watch *watch); | 274 | extern void audit_get_watch(struct audit_watch *watch); |
| 275 | extern int audit_to_watch(struct audit_krule *krule, char *path, int len, u32 op); | 275 | extern int audit_to_watch(struct audit_krule *krule, char *path, int len, |
| 276 | u32 op); | ||
| 276 | extern int audit_add_watch(struct audit_krule *krule, struct list_head **list); | 277 | extern int audit_add_watch(struct audit_krule *krule, struct list_head **list); |
| 277 | extern void audit_remove_watch_rule(struct audit_krule *krule); | 278 | extern void audit_remove_watch_rule(struct audit_krule *krule); |
| 278 | extern char *audit_watch_path(struct audit_watch *watch); | 279 | extern char *audit_watch_path(struct audit_watch *watch); |
| 279 | extern int audit_watch_compare(struct audit_watch *watch, unsigned long ino, dev_t dev); | 280 | extern int audit_watch_compare(struct audit_watch *watch, unsigned long ino, |
| 281 | dev_t dev); | ||
| 280 | 282 | ||
| 281 | extern struct audit_fsnotify_mark *audit_alloc_mark(struct audit_krule *krule, char *pathname, int len); | 283 | extern struct audit_fsnotify_mark *audit_alloc_mark(struct audit_krule *krule, |
| 284 | char *pathname, int len); | ||
| 282 | extern char *audit_mark_path(struct audit_fsnotify_mark *mark); | 285 | extern char *audit_mark_path(struct audit_fsnotify_mark *mark); |
| 283 | extern void audit_remove_mark(struct audit_fsnotify_mark *audit_mark); | 286 | extern void audit_remove_mark(struct audit_fsnotify_mark *audit_mark); |
| 284 | extern void audit_remove_mark_rule(struct audit_krule *krule); | 287 | extern void audit_remove_mark_rule(struct audit_krule *krule); |
| 285 | extern int audit_mark_compare(struct audit_fsnotify_mark *mark, unsigned long ino, dev_t dev); | 288 | extern int audit_mark_compare(struct audit_fsnotify_mark *mark, |
| 289 | unsigned long ino, dev_t dev); | ||
| 286 | extern int audit_dupe_exe(struct audit_krule *new, struct audit_krule *old); | 290 | extern int audit_dupe_exe(struct audit_krule *new, struct audit_krule *old); |
| 287 | extern int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark *mark); | 291 | extern int audit_exe_compare(struct task_struct *tsk, |
| 292 | struct audit_fsnotify_mark *mark); | ||
| 288 | 293 | ||
| 289 | #else | 294 | extern struct audit_chunk *audit_tree_lookup(const struct inode *inode); |
| 295 | extern void audit_put_chunk(struct audit_chunk *chunk); | ||
| 296 | extern bool audit_tree_match(struct audit_chunk *chunk, | ||
| 297 | struct audit_tree *tree); | ||
| 298 | extern int audit_make_tree(struct audit_krule *rule, char *pathname, u32 op); | ||
| 299 | extern int audit_add_tree_rule(struct audit_krule *rule); | ||
| 300 | extern int audit_remove_tree_rule(struct audit_krule *rule); | ||
| 301 | extern void audit_trim_trees(void); | ||
| 302 | extern int audit_tag_tree(char *old, char *new); | ||
| 303 | extern const char *audit_tree_path(struct audit_tree *tree); | ||
| 304 | extern void audit_put_tree(struct audit_tree *tree); | ||
| 305 | extern void audit_kill_trees(struct audit_context *context); | ||
| 306 | |||
| 307 | extern int audit_signal_info(int sig, struct task_struct *t); | ||
| 308 | extern void audit_filter_inodes(struct task_struct *tsk, | ||
| 309 | struct audit_context *ctx); | ||
| 310 | extern 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 | ||
| 308 | extern struct audit_chunk *audit_tree_lookup(const struct inode *inode); | ||
| 309 | extern void audit_put_chunk(struct audit_chunk *chunk); | ||
| 310 | extern bool audit_tree_match(struct audit_chunk *chunk, struct audit_tree *tree); | ||
| 311 | extern int audit_make_tree(struct audit_krule *rule, char *pathname, u32 op); | ||
| 312 | extern int audit_add_tree_rule(struct audit_krule *rule); | ||
| 313 | extern int audit_remove_tree_rule(struct audit_krule *rule); | ||
| 314 | extern void audit_trim_trees(void); | ||
| 315 | extern int audit_tag_tree(char *old, char *new); | ||
| 316 | extern const char *audit_tree_path(struct audit_tree *tree); | ||
| 317 | extern void audit_put_tree(struct audit_tree *tree); | ||
| 318 | extern 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 | ||
| 330 | extern char *audit_unpack_string(void **bufp, size_t *remain, size_t len); | 341 | extern 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 | ||
| 336 | extern int audit_filter(int msgtype, unsigned int listtype); | 347 | extern int audit_filter(int msgtype, unsigned int listtype); |
| 337 | 348 | ||
| 338 | #ifdef CONFIG_AUDITSYSCALL | ||
| 339 | extern int audit_signal_info(int sig, struct task_struct *t); | ||
| 340 | extern void audit_filter_inodes(struct task_struct *tsk, struct audit_context *ctx); | ||
| 341 | extern 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 | |||
| 347 | extern void audit_ctl_lock(void); | 349 | extern void audit_ctl_lock(void); |
| 348 | extern void audit_ctl_unlock(void); | 350 | extern void audit_ctl_unlock(void); |
