diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-14 04:02:26 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-01-04 15:14:41 -0500 |
commit | 564f6993ffef656aebaf46cf2f1f6cb4f5c97207 (patch) | |
tree | 0bf1ee553ab1241338fe522ffbaed8cd48e10c99 /include/linux/audit.h | |
parent | c32c8af43b9adde8d6f938d8e6328c13b8de79ac (diff) |
sanitize audit_mq_open()
* don't bother with allocations
* don't do double copy_from_user()
* don't duplicate parts of check 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 | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/include/linux/audit.h b/include/linux/audit.h index 67f0cdd991ba..54978bdd2bd4 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -450,7 +450,7 @@ extern void audit_socketcall(int nargs, unsigned long *args); | |||
450 | extern int audit_sockaddr(int len, void *addr); | 450 | 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 void __audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr); |
454 | extern void __audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *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 void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); | 455 | extern void __audit_mq_notify(mqd_t mqdes, const struct sigevent *notification); |
456 | 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); |
@@ -475,11 +475,10 @@ static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid | |||
475 | if (unlikely(!audit_dummy_context())) | 475 | if (unlikely(!audit_dummy_context())) |
476 | __audit_ipc_set_perm(qbytes, uid, gid, mode); | 476 | __audit_ipc_set_perm(qbytes, uid, gid, mode); |
477 | } | 477 | } |
478 | static inline int audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr) | 478 | static inline void audit_mq_open(int oflag, mode_t mode, struct mq_attr *attr) |
479 | { | 479 | { |
480 | if (unlikely(!audit_dummy_context())) | 480 | if (unlikely(!audit_dummy_context())) |
481 | return __audit_mq_open(oflag, mode, u_attr); | 481 | __audit_mq_open(oflag, mode, attr); |
482 | return 0; | ||
483 | } | 482 | } |
484 | static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout) | 483 | static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, unsigned int msg_prio, const struct timespec *abs_timeout) |
485 | { | 484 | { |
@@ -541,7 +540,7 @@ extern int audit_signals; | |||
541 | #define audit_fd_pair(n,a) ({ 0; }) | 540 | #define audit_fd_pair(n,a) ({ 0; }) |
542 | #define audit_sockaddr(len, addr) ({ 0; }) | 541 | #define audit_sockaddr(len, addr) ({ 0; }) |
543 | #define audit_set_macxattr(n) do { ; } while (0) | 542 | #define audit_set_macxattr(n) do { ; } while (0) |
544 | #define audit_mq_open(o,m,a) ({ 0; }) | 543 | #define audit_mq_open(o,m,a) ((void)0) |
545 | #define audit_mq_sendrecv(d,l,p,t) ((void)0) | 544 | #define audit_mq_sendrecv(d,l,p,t) ((void)0) |
546 | #define audit_mq_notify(d,n) ((void)0) | 545 | #define audit_mq_notify(d,n) ((void)0) |
547 | #define audit_mq_getsetattr(d,s) ((void)0) | 546 | #define audit_mq_getsetattr(d,s) ((void)0) |