diff options
| author | Eric Paris <eparis@redhat.com> | 2013-04-30 15:30:32 -0400 |
|---|---|---|
| committer | Eric Paris <eparis@redhat.com> | 2013-04-30 15:31:28 -0400 |
| commit | b24a30a7305418ff138ff51776fc555ec57c011a (patch) | |
| tree | 2c64cff75b758c3fb407118ab473167fb5bec3fa /include/linux | |
| parent | 7173c54e3a9deb491a586e7e107375109ee48bcb (diff) | |
audit: fix event coverage of AUDIT_ANOM_LINK
The userspace audit tools didn't like the existing formatting of the
AUDIT_ANOM_LINK event. It needed to be expanded to emit an AUDIT_PATH
event as well, so this implements the change. The bulk of the patch is
moving code out of auditsc.c into audit.c and audit.h for general use.
It expands audit_log_name to include an optional "struct path" argument
for the simple case of just needing to report a pathname. This also
makes
audit_log_task_info available when syscall auditing is not enabled,
since
it is needed in either case for process details.
Signed-off-by: Kees Cook <keescook@chromium.org>
Reported-by: Steve Grubb <sgrubb@redhat.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/audit.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index b76bfc8efc25..469d11755e46 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
| @@ -190,8 +190,6 @@ static inline int audit_get_sessionid(struct task_struct *tsk) | |||
| 190 | return tsk->sessionid; | 190 | return tsk->sessionid; |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | extern int audit_log_task_context(struct audit_buffer *ab); | ||
| 194 | extern void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk); | ||
| 195 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); | 193 | extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); |
| 196 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); | 194 | extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); |
| 197 | extern int __audit_bprm(struct linux_binprm *bprm); | 195 | extern int __audit_bprm(struct linux_binprm *bprm); |
| @@ -346,13 +344,6 @@ static inline int audit_get_sessionid(struct task_struct *tsk) | |||
| 346 | { | 344 | { |
| 347 | return -1; | 345 | return -1; |
| 348 | } | 346 | } |
| 349 | static int void audit_log_task_context(struct audit_buffer *ab) | ||
| 350 | { | ||
| 351 | return 0; | ||
| 352 | } | ||
| 353 | static inline void audit_log_task_info(struct audit_buffer *ab, | ||
| 354 | struct task_struct *tsk) | ||
| 355 | { } | ||
| 356 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) | 347 | static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) |
| 357 | { } | 348 | { } |
| 358 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, | 349 | static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, |
| @@ -439,6 +430,10 @@ static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid) | |||
| 439 | { } | 430 | { } |
| 440 | #endif | 431 | #endif |
| 441 | 432 | ||
| 433 | extern int audit_log_task_context(struct audit_buffer *ab); | ||
| 434 | extern void audit_log_task_info(struct audit_buffer *ab, | ||
| 435 | struct task_struct *tsk); | ||
| 436 | |||
| 442 | extern int audit_update_lsm_rules(void); | 437 | extern int audit_update_lsm_rules(void); |
| 443 | 438 | ||
| 444 | /* Private API (for audit.c only) */ | 439 | /* Private API (for audit.c only) */ |
| @@ -485,6 +480,13 @@ static inline void audit_log_link_denied(const char *string, | |||
| 485 | { } | 480 | { } |
| 486 | static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid) | 481 | static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid) |
| 487 | { } | 482 | { } |
| 483 | static inline int audit_log_task_context(struct audit_buffer *ab) | ||
| 484 | { | ||
| 485 | return 0; | ||
| 486 | } | ||
| 487 | static inline void audit_log_task_info(struct audit_buffer *ab, | ||
| 488 | struct task_struct *tsk) | ||
| 489 | { } | ||
| 488 | #define audit_enabled 0 | 490 | #define audit_enabled 0 |
| 489 | #endif /* CONFIG_AUDIT */ | 491 | #endif /* CONFIG_AUDIT */ |
| 490 | static inline void audit_log_string(struct audit_buffer *ab, const char *buf) | 492 | static inline void audit_log_string(struct audit_buffer *ab, const char *buf) |
