summaryrefslogtreecommitdiff
path: root/ipc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2008-12-10 15:16:12 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2009-01-04 23:14:40 +0300
commit20114f71b27cafeb7c7e41d2b0f0b68c3fbb022b (patch)
treefcbb481cfec8c11f103ba07dbb08819de3822d80 /ipc
parent7392906ea915b9a2c14dea32b3604b4e178f82f7 (diff)
downloadlinux-20114f71b27cafeb7c7e41d2b0f0b68c3fbb022b.tar.xz
sanitize audit_mq_notify()
* don't copy_from_user() twice * don't bother with allocations * don't duplicate parts of audit_dummy_context() * make it return void Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc')
-rw-r--r--ipc/mqueue.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 7563611c6615..e7b2f68f8d77 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -1003,17 +1003,17 @@ asmlinkage long sys_mq_notify(mqd_t mqdes,
struct mqueue_inode_info *info;
struct sk_buff *nc;
- ret = audit_mq_notify(mqdes, u_notification);
- if (ret != 0)
- return ret;
-
- nc = NULL;
- sock = NULL;
- if (u_notification != NULL) {
+ if (u_notification) {
if (copy_from_user(&notification, u_notification,
sizeof(struct sigevent)))
return -EFAULT;
+ }
+
+ audit_mq_notify(mqdes, u_notification ? &notification : NULL);
+ nc = NULL;
+ sock = NULL;
+ if (u_notification != NULL) {
if (unlikely(notification.sigev_notify != SIGEV_NONE &&
notification.sigev_notify != SIGEV_SIGNAL &&
notification.sigev_notify != SIGEV_THREAD))