aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/audit.h
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2012-01-03 14:23:07 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-17 16:16:57 -0500
commit07c49417877f8658a6aa0ad9b4e21e4fd4df11b6 (patch)
tree59a64b96c9f35b8559db4c46b5a43d2d9510c190 /include/linux/audit.h
parent56179a6ec65a56e0279a58e35cb450d38f061b94 (diff)
audit: inline checks for not needing to collect aux records
A number of audit hooks make function calls before they determine that auxilary records do not need to be collected. Do those checks as static inlines since the most common case is going to be that records are not needed and we can skip the function call overhead. Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'include/linux/audit.h')
-rw-r--r--include/linux/audit.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h
index f56ce2669b83..cf16faff6b8a 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -489,9 +489,9 @@ extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
489extern void audit_log_task_context(struct audit_buffer *ab); 489extern void audit_log_task_context(struct audit_buffer *ab);
490extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp); 490extern void __audit_ipc_obj(struct kern_ipc_perm *ipcp);
491extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode); 491extern void __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, umode_t mode);
492extern int audit_bprm(struct linux_binprm *bprm); 492extern int __audit_bprm(struct linux_binprm *bprm);
493extern void audit_socketcall(int nargs, unsigned long *args); 493extern void __audit_socketcall(int nargs, unsigned long *args);
494extern int audit_sockaddr(int len, void *addr); 494extern int __audit_sockaddr(int len, void *addr);
495extern void __audit_fd_pair(int fd1, int fd2); 495extern void __audit_fd_pair(int fd1, int fd2);
496extern int audit_set_macxattr(const char *name); 496extern int audit_set_macxattr(const char *name);
497extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr); 497extern void __audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr);
@@ -519,6 +519,23 @@ static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid
519 if (unlikely(!audit_dummy_context())) 519 if (unlikely(!audit_dummy_context()))
520 __audit_ipc_set_perm(qbytes, uid, gid, mode); 520 __audit_ipc_set_perm(qbytes, uid, gid, mode);
521} 521}
522static inline int audit_bprm(struct linux_binprm *bprm)
523{
524 if (unlikely(!audit_dummy_context()))
525 return __audit_bprm(bprm);
526 return 0;
527}
528static inline void audit_socketcall(int nargs, unsigned long *args)
529{
530 if (unlikely(!audit_dummy_context()))
531 __audit_socketcall(nargs, args);
532}
533static inline int audit_sockaddr(int len, void *addr)
534{
535 if (unlikely(!audit_dummy_context()))
536 return __audit_sockaddr(len, addr);
537 return 0;
538}
522static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) 539static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr)
523{ 540{
524 if (unlikely(!audit_dummy_context())) 541 if (unlikely(!audit_dummy_context()))