diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-07-16 06:38:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2006-08-03 10:59:42 -0400 |
commit | 5ac3a9c26c1cc4861d9cdd8b293fecbfcdc81afe (patch) | |
tree | 6ca960fade3253ac358f3614e6a07361fc90d09e | |
parent | d51374adf5f2f88155a072d3d801104e3c0c3d7f (diff) |
[PATCH] don't bother with aux entires for dummy context
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 4 | ||||
-rw-r--r-- | include/linux/audit.h | 22 | ||||
-rw-r--r-- | kernel/auditsc.c | 6 |
3 files changed, 16 insertions, 16 deletions
diff --git a/fs/namei.c b/fs/namei.c index 0ab26cbdacc0..55a131230f94 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -159,7 +159,7 @@ char * getname(const char __user * filename) | |||
159 | #ifdef CONFIG_AUDITSYSCALL | 159 | #ifdef CONFIG_AUDITSYSCALL |
160 | void putname(const char *name) | 160 | void putname(const char *name) |
161 | { | 161 | { |
162 | if (unlikely(current->audit_context)) | 162 | if (unlikely(!audit_dummy_context())) |
163 | audit_putname(name); | 163 | audit_putname(name); |
164 | else | 164 | else |
165 | __putname(name); | 165 | __putname(name); |
@@ -1125,7 +1125,7 @@ static int fastcall do_path_lookup(int dfd, const char *name, | |||
1125 | retval = link_path_walk(name, nd); | 1125 | retval = link_path_walk(name, nd); |
1126 | out: | 1126 | out: |
1127 | if (likely(retval == 0)) { | 1127 | if (likely(retval == 0)) { |
1128 | if (unlikely(current->audit_context && nd && nd->dentry && | 1128 | if (unlikely(!audit_dummy_context() && nd && nd->dentry && |
1129 | nd->dentry->d_inode)) | 1129 | nd->dentry->d_inode)) |
1130 | audit_inode(name, nd->dentry->d_inode); | 1130 | audit_inode(name, nd->dentry->d_inode); |
1131 | } | 1131 | } |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 3f736d658218..64f9f9e56ac5 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -336,21 +336,21 @@ static inline int audit_dummy_context(void) | |||
336 | } | 336 | } |
337 | static inline void audit_getname(const char *name) | 337 | static inline void audit_getname(const char *name) |
338 | { | 338 | { |
339 | if (unlikely(current->audit_context)) | 339 | if (unlikely(!audit_dummy_context())) |
340 | __audit_getname(name); | 340 | __audit_getname(name); |
341 | } | 341 | } |
342 | static inline void audit_inode(const char *name, const struct inode *inode) { | 342 | static inline void audit_inode(const char *name, const struct inode *inode) { |
343 | if (unlikely(current->audit_context)) | 343 | if (unlikely(!audit_dummy_context())) |
344 | __audit_inode(name, inode); | 344 | __audit_inode(name, inode); |
345 | } | 345 | } |
346 | static inline void audit_inode_child(const char *dname, | 346 | static inline void audit_inode_child(const char *dname, |
347 | const struct inode *inode, | 347 | const struct inode *inode, |
348 | const struct inode *parent) { | 348 | const struct inode *parent) { |
349 | if (unlikely(current->audit_context)) | 349 | if (unlikely(!audit_dummy_context())) |
350 | __audit_inode_child(dname, inode, parent); | 350 | __audit_inode_child(dname, inode, parent); |
351 | } | 351 | } |
352 | static inline void audit_inode_update(const struct inode *inode) { | 352 | static inline void audit_inode_update(const struct inode *inode) { |
353 | if (unlikely(current->audit_context)) | 353 | if (unlikely(!audit_dummy_context())) |
354 | __audit_inode_update(inode); | 354 | __audit_inode_update(inode); |
355 | } | 355 | } |
356 | 356 | ||
@@ -375,43 +375,43 @@ extern int __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); | |||
375 | 375 | ||
376 | static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) | 376 | static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) |
377 | { | 377 | { |
378 | if (unlikely(current->audit_context)) | 378 | if (unlikely(!audit_dummy_context())) |
379 | return __audit_ipc_obj(ipcp); | 379 | return __audit_ipc_obj(ipcp); |
380 | return 0; | 380 | return 0; |
381 | } | 381 | } |
382 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) | 382 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) |
383 | { | 383 | { |
384 | if (unlikely(current->audit_context)) | 384 | if (unlikely(!audit_dummy_context())) |
385 | return __audit_ipc_set_perm(qbytes, uid, gid, mode); | 385 | return __audit_ipc_set_perm(qbytes, uid, gid, mode); |
386 | return 0; | 386 | return 0; |
387 | } | 387 | } |
388 | static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr) | 388 | static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr) |
389 | { | 389 | { |
390 | if (unlikely(current->audit_context)) | 390 | if (unlikely(!audit_dummy_context())) |
391 | return __audit_mq_open(oflag, mode, u_attr); | 391 | return __audit_mq_open(oflag, mode, u_attr); |
392 | return 0; | 392 | return 0; |
393 | } | 393 | } |
394 | static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout) | 394 | static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout) |
395 | { | 395 | { |
396 | if (unlikely(current->audit_context)) | 396 | if (unlikely(!audit_dummy_context())) |
397 | return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout); | 397 | return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout); |
398 | return 0; | 398 | return 0; |
399 | } | 399 | } |
400 | 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) | 400 | 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) |
401 | { | 401 | { |
402 | if (unlikely(current->audit_context)) | 402 | if (unlikely(!audit_dummy_context())) |
403 | return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout); | 403 | return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout); |
404 | return 0; | 404 | return 0; |
405 | } | 405 | } |
406 | static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) | 406 | static inline int audit_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) |
407 | { | 407 | { |
408 | if (unlikely(current->audit_context)) | 408 | if (unlikely(!audit_dummy_context())) |
409 | return __audit_mq_notify(mqdes, u_notification); | 409 | return __audit_mq_notify(mqdes, u_notification); |
410 | return 0; | 410 | return 0; |
411 | } | 411 | } |
412 | static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) | 412 | static inline int audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) |
413 | { | 413 | { |
414 | if (unlikely(current->audit_context)) | 414 | if (unlikely(!audit_dummy_context())) |
415 | return __audit_mq_getsetattr(mqdes, mqstat); | 415 | return __audit_mq_getsetattr(mqdes, mqstat); |
416 | return 0; | 416 | return 0; |
417 | } | 417 | } |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 9618d1507251..f571c7e925e6 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -1676,7 +1676,7 @@ int audit_bprm(struct linux_binprm *bprm) | |||
1676 | unsigned long p, next; | 1676 | unsigned long p, next; |
1677 | void *to; | 1677 | void *to; |
1678 | 1678 | ||
1679 | if (likely(!audit_enabled || !context)) | 1679 | if (likely(!audit_enabled || !context || context->dummy)) |
1680 | return 0; | 1680 | return 0; |
1681 | 1681 | ||
1682 | ax = kmalloc(sizeof(*ax) + PAGE_SIZE * MAX_ARG_PAGES - bprm->p, | 1682 | ax = kmalloc(sizeof(*ax) + PAGE_SIZE * MAX_ARG_PAGES - bprm->p, |
@@ -1714,7 +1714,7 @@ int audit_socketcall(int nargs, unsigned long *args) | |||
1714 | struct audit_aux_data_socketcall *ax; | 1714 | struct audit_aux_data_socketcall *ax; |
1715 | struct audit_context *context = current->audit_context; | 1715 | struct audit_context *context = current->audit_context; |
1716 | 1716 | ||
1717 | if (likely(!context)) | 1717 | if (likely(!context || context->dummy)) |
1718 | return 0; | 1718 | return 0; |
1719 | 1719 | ||
1720 | ax = kmalloc(sizeof(*ax) + nargs * sizeof(unsigned long), GFP_KERNEL); | 1720 | ax = kmalloc(sizeof(*ax) + nargs * sizeof(unsigned long), GFP_KERNEL); |
@@ -1742,7 +1742,7 @@ int audit_sockaddr(int len, void *a) | |||
1742 | struct audit_aux_data_sockaddr *ax; | 1742 | struct audit_aux_data_sockaddr *ax; |
1743 | struct audit_context *context = current->audit_context; | 1743 | struct audit_context *context = current->audit_context; |
1744 | 1744 | ||
1745 | if (likely(!context)) | 1745 | if (likely(!context || context->dummy)) |
1746 | return 0; | 1746 | return 0; |
1747 | 1747 | ||
1748 | ax = kmalloc(sizeof(*ax) + len, GFP_KERNEL); | 1748 | ax = kmalloc(sizeof(*ax) + len, GFP_KERNEL); |