diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-14 03:46:48 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-01-04 15:14:40 -0500 |
commit | c32c8af43b9adde8d6f938d8e6328c13b8de79ac (patch) | |
tree | 6377079bba7530d2aa8a688ebf9ba3e09ae085a7 /include/linux/audit.h | |
parent | 20114f71b27cafeb7c7e41d2b0f0b68c3fbb022b (diff) |
sanitize AUDIT_MQ_SENDRECV
* logging the original value of *msg_prio in mq_timedreceive(2)
is insane - the argument is write-only (i.e. syscall always
ignores the original value and only overwrites it).
* merge __audit_mq_timed{send,receive}
* don't do copy_from_user() twice
* don't mess with allocations in auditsc part
* ... and don't bother checking !audit_enabled and !context in there -
we'd already checked for audit_dummy_context().
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/audit.h')
-rw-r--r-- | include/linux/audit.h | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 8101d2c4a995..67f0cdd991ba 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -451,8 +451,7 @@ extern int audit_sockaddr(int len, void *addr); | |||
451 | extern int __audit_fd_pair(int fd1, int fd2); | 451 | extern int __audit_fd_pair(int fd1, int fd2); |
452 | extern int audit_set_macxattr(const char *name); | 452 | extern int audit_set_macxattr(const char *name); |
453 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); | 453 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); |
454 | extern int __audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout); | 454 | extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout); |
455 | extern int __audit_mq_timedreceive(mqd_t mqdes, size_t msg_len, unsigned int __user *u_msg_prio, const struct timespec __user *u_abs_timeout); | ||
456 | extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); | 455 | extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); |
457 | extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); | 456 | extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat); |
458 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, | 457 | extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, |
@@ -482,17 +481,10 @@ static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u | |||
482 | return __audit_mq_open(oflag, mode, u_attr); | 481 | return __audit_mq_open(oflag, mode, u_attr); |
483 | return 0; | 482 | return 0; |
484 | } | 483 | } |
485 | static inline int audit_mq_timedsend(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec __user *u_abs_timeout) | 484 | static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout) |
486 | { | 485 | { |
487 | if (unlikely(!audit_dummy_context())) | 486 | if (unlikely(!audit_dummy_context())) |
488 | return __audit_mq_timedsend(mqdes, msg_len, msg_prio, u_abs_timeout); | 487 | __audit_mq_sendrecv(mqdes, msg_len, msg_prio, abs_timeout); |
489 | return 0; | ||
490 | } | ||
491 | 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) | ||
492 | { | ||
493 | if (unlikely(!audit_dummy_context())) | ||
494 | return __audit_mq_timedreceive(mqdes, msg_len, u_msg_prio, u_abs_timeout); | ||
495 | return 0; | ||
496 | } | 488 | } |
497 | static inline void audit_mq_notify(mqd_t mqdes, const struct sigevent *notification) | 489 | static inline void audit_mq_notify(mqd_t mqdes, const struct sigevent *notification) |
498 | { | 490 | { |
@@ -550,8 +542,7 @@ extern int audit_signals; | |||
550 | #define audit_sockaddr(len, addr) ({ 0; }) | 542 | #define audit_sockaddr(len, addr) ({ 0; }) |
551 | #define audit_set_macxattr(n) do { ; } while (0) | 543 | #define audit_set_macxattr(n) do { ; } while (0) |
552 | #define audit_mq_open(o,m,a) ({ 0; }) | 544 | #define audit_mq_open(o,m,a) ({ 0; }) |
553 | #define audit_mq_timedsend(d,l,p,t) ({ 0; }) | 545 | #define audit_mq_sendrecv(d,l,p,t) ((void)0) |
554 | #define audit_mq_timedreceive(d,l,p,t) ({ 0; }) | ||
555 | #define audit_mq_notify(d,n) ((void)0) | 546 | #define audit_mq_notify(d,n) ((void)0) |
556 | #define audit_mq_getsetattr(d,s) ((void)0) | 547 | #define audit_mq_getsetattr(d,s) ((void)0) |
557 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) | 548 | #define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) |