mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
[PATCH] don't bother with aux entires for dummy context
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
d51374adf5
commit
5ac3a9c26c
@ -159,7 +159,7 @@ char * getname(const char __user * filename)
|
||||
#ifdef CONFIG_AUDITSYSCALL
|
||||
void putname(const char *name)
|
||||
{
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
audit_putname(name);
|
||||
else
|
||||
__putname(name);
|
||||
@ -1125,7 +1125,7 @@ static int fastcall do_path_lookup(int dfd, const char *name,
|
||||
retval = link_path_walk(name, nd);
|
||||
out:
|
||||
if (likely(retval == 0)) {
|
||||
if (unlikely(current->audit_context && nd && nd->dentry &&
|
||||
if (unlikely(!audit_dummy_context() && nd && nd->dentry &&
|
||||
nd->dentry->d_inode))
|
||||
audit_inode(name, nd->dentry->d_inode);
|
||||
}
|
||||
|
@ -336,21 +336,21 @@ static inline int audit_dummy_context(void)
|
||||
}
|
||||
static inline void audit_getname(const char *name)
|
||||
{
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_getname(name);
|
||||
}
|
||||
static inline void audit_inode(const char *name, const struct inode *inode) {
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_inode(name, inode);
|
||||
}
|
||||
static inline void audit_inode_child(const char *dname,
|
||||
const struct inode *inode,
|
||||
const struct inode *parent) {
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_inode_child(dname, inode, parent);
|
||||
}
|
||||
static inline void audit_inode_update(const struct inode *inode) {
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
__audit_inode_update(inode);
|
||||
}
|
||||
|
||||
@ -375,43 +375,43 @@ extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
|
||||
|
||||
static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp)
|
||||
{
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_ipc_obj(ipcp);
|
||||
return 0;
|
||||
}
|
||||
static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode)
|
||||
{
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_ipc_set_perm(qbytes, uid, gid, mode);
|
||||
return 0;
|
||||
}
|
||||
static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr)
|
||||
{
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_open(oflag, mode, u_attr);
|
||||
return 0;
|
||||
}
|
||||
static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout)
|
||||
{
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout);
|
||||
return 0;
|
||||
}
|
||||
static inline int audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout)
|
||||
{
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout);
|
||||
return 0;
|
||||
}
|
||||
static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification)
|
||||
{
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_notify(mqdes, u_notification);
|
||||
return 0;
|
||||
}
|
||||
static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat)
|
||||
{
|
||||
if (unlikely(current->audit_context))
|
||||
if (unlikely(!audit_dummy_context()))
|
||||
return __audit_mq_getsetattr(mqdes, mqstat);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1676,7 +1676,7 @@ int audit_bprm(struct linux_binprm *bprm)
|
||||
unsigned long p, next;
|
||||
void *to;
|
||||
|
||||
if (likely(!audit_enabled || !context))
|
||||
if (likely(!audit_enabled || !context || context->dummy))
|
||||
return 0;
|
||||
|
||||
ax = kmalloc(sizeof(*ax) + PAGE_SIZE * MAX_ARG_PAGES - bprm->p,
|
||||
@ -1714,7 +1714,7 @@ int audit_socketcall(int nargs, unsigned long *args)
|
||||
struct audit_aux_data_socketcall *ax;
|
||||
struct audit_context *context = current->audit_context;
|
||||
|
||||
if (likely(!context))
|
||||
if (likely(!context || context->dummy))
|
||||
return 0;
|
||||
|
||||
ax = kmalloc(sizeof(*ax) + nargs * sizeof(unsigned long), GFP_KERNEL);
|
||||
@ -1742,7 +1742,7 @@ int audit_sockaddr(int len, void *a)
|
||||
struct audit_aux_data_sockaddr *ax;
|
||||
struct audit_context *context = current->audit_context;
|
||||
|
||||
if (likely(!context))
|
||||
if (likely(!context || context->dummy))
|
||||
return 0;
|
||||
|
||||
ax = kmalloc(sizeof(*ax) + len, GFP_KERNEL);
|
||||
|
Loading…
Reference in New Issue
Block a user