23 #ifndef _LINUX_AUDIT_H_
24 #define _LINUX_AUDIT_H_
26 #include <linux/sched.h>
80 #define AUDIT_TYPE_UNKNOWN 0
81 #define AUDIT_TYPE_NORMAL 1
82 #define AUDIT_TYPE_PARENT 2
83 #define AUDIT_TYPE_CHILD_DELETE 3
84 #define AUDIT_TYPE_CHILD_CREATE 4
88 #ifdef CONFIG_AUDITSYSCALL
94 int major,
unsigned long a0,
unsigned long a1,
95 unsigned long a2,
unsigned long a3);
101 unsigned int parent);
104 const unsigned char type);
108 static inline int audit_dummy_context(
void)
111 return !p || *(
int *)p;
118 static inline void audit_syscall_entry(
int arch,
int major,
unsigned long a0,
119 unsigned long a1,
unsigned long a2,
122 if (
unlikely(!audit_dummy_context()))
125 static inline void audit_syscall_exit(
void *
pt_regs)
134 static inline struct filename *audit_reusename(
const __user
char *
name)
136 if (
unlikely(!audit_dummy_context()))
140 static inline void audit_getname(
struct filename *name)
142 if (
unlikely(!audit_dummy_context()))
146 unsigned int parent) {
147 if (
unlikely(!audit_dummy_context()))
150 static inline void audit_inode_child(
const struct inode *parent,
151 const struct dentry *dentry,
152 const unsigned char type) {
153 if (
unlikely(!audit_dummy_context()))
158 static inline void audit_seccomp(
unsigned long syscall,
long signr,
int code)
160 if (
unlikely(!audit_dummy_context()))
166 if (
unlikely(!audit_dummy_context()))
178 return tsk->loginuid;
181 static inline int audit_get_sessionid(
struct task_struct *tsk)
183 return tsk->sessionid;
199 const struct cred *
new,
200 const struct cred *old);
206 if (
unlikely(!audit_dummy_context()))
209 static inline void audit_fd_pair(
int fd1,
int fd2)
211 if (
unlikely(!audit_dummy_context()))
216 if (
unlikely(!audit_dummy_context()))
221 if (
unlikely(!audit_dummy_context()))
225 static inline void audit_socketcall(
int nargs,
unsigned long *args)
227 if (
unlikely(!audit_dummy_context()))
230 static inline int audit_sockaddr(
int len,
void *
addr)
232 if (
unlikely(!audit_dummy_context()))
238 if (
unlikely(!audit_dummy_context()))
241 static inline void audit_mq_sendrecv(
mqd_t mqdes,
size_t msg_len,
unsigned int msg_prio,
const struct timespec *abs_timeout)
243 if (
unlikely(!audit_dummy_context()))
248 if (
unlikely(!audit_dummy_context()))
251 static inline void audit_mq_getsetattr(
mqd_t mqdes,
struct mq_attr *mqstat)
253 if (
unlikely(!audit_dummy_context()))
257 static inline int audit_log_bprm_fcaps(
struct linux_binprm *bprm,
258 const struct cred *
new,
259 const struct cred *old)
261 if (
unlikely(!audit_dummy_context()))
266 static inline void audit_log_capset(
pid_t pid,
const struct cred *
new,
267 const struct cred *old)
269 if (
unlikely(!audit_dummy_context()))
273 static inline void audit_mmap_fd(
int fd,
int flags)
275 if (
unlikely(!audit_dummy_context()))
286 static inline void audit_free(
struct task_struct *task)
288 static inline void audit_syscall_entry(
int arch,
int major,
unsigned long a0,
289 unsigned long a1,
unsigned long a2,
292 static inline void audit_syscall_exit(
void *pt_regs)
294 static inline int audit_dummy_context(
void)
298 static inline struct filename *audit_reusename(
const __user
char *name)
302 static inline void audit_getname(
struct filename *name)
307 const struct dentry *dentry,
311 const struct dentry *dentry,
312 const unsigned char type)
314 static inline void audit_inode(
struct filename *name,
315 const struct dentry *dentry,
318 static inline void audit_inode_child(
const struct inode *parent,
319 const struct dentry *dentry,
320 const unsigned char type)
324 static inline void __audit_seccomp(
unsigned long syscall,
long signr,
int code)
326 static inline void audit_seccomp(
unsigned long syscall,
long signr,
int code)
337 static inline int audit_get_sessionid(
struct task_struct *tsk)
348 static inline void audit_ipc_set_perm(
unsigned long qbytes,
uid_t uid,
355 static inline void audit_socketcall(
int nargs,
unsigned long *args)
357 static inline void audit_fd_pair(
int fd1,
int fd2)
359 static inline int audit_sockaddr(
int len,
void *addr)
363 static inline void audit_mq_open(
int oflag,
umode_t mode,
struct mq_attr *attr)
365 static inline void audit_mq_sendrecv(
mqd_t mqdes,
size_t msg_len,
366 unsigned int msg_prio,
369 static inline void audit_mq_notify(
mqd_t mqdes,
370 const struct sigevent *notification)
372 static inline void audit_mq_getsetattr(
mqd_t mqdes,
struct mq_attr *mqstat)
374 static inline int audit_log_bprm_fcaps(
struct linux_binprm *bprm,
375 const struct cred *
new,
376 const struct cred *old)
380 static inline void audit_log_capset(
pid_t pid,
const struct cred *
new,
381 const struct cred *old)
383 static inline void audit_mmap_fd(
int fd,
int flags)
385 static inline void audit_ptrace(
struct task_struct *t)
387 #define audit_n_rules 0
388 #define audit_signals 0
423 #ifdef CONFIG_SECURITY
426 static inline void audit_log_secctx(
struct audit_buffer *ab,
u32 secid)
442 const char *fmt, ...)
445 gfp_t gfp_mask,
int type)
455 const unsigned char *buf,
size_t len)
458 const char *buf,
size_t n)
461 const char *
string,
size_t n)
468 const struct path *path)
473 const struct path *link)
475 static inline void audit_log_secctx(
struct audit_buffer *ab,
u32 secid)
477 #define audit_enabled 0
479 static inline void audit_log_string(
struct audit_buffer *ab,
const char *buf)