diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-10 07:16:12 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-01-04 15:14:40 -0500 |
commit | 20114f71b27cafeb7c7e41d2b0f0b68c3fbb022b (patch) | |
tree | fcbb481cfec8c11f103ba07dbb08819de3822d80 /ipc/mqueue.c | |
parent | 7392906ea915b9a2c14dea32b3604b4e178f82f7 (diff) |
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/mqueue.c')
-rw-r--r-- | ipc/mqueue.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ipc/mqueue.c b/ipc/mqueue.c index 7563611c661..e7b2f68f8d7 100644 --- a/ipc/mqueue.c +++ b/ipc/mqueue.c | |||
@@ -1003,17 +1003,17 @@ asmlinkage long sys_mq_notify(mqd_t mqdes, | |||
1003 | struct mqueue_inode_info *info; | 1003 | struct mqueue_inode_info *info; |
1004 | struct sk_buff *nc; | 1004 | struct sk_buff *nc; |
1005 | 1005 | ||
1006 | ret = audit_mq_notify(mqdes, u_notification); | 1006 | if (u_notification) { |
1007 | if (ret != 0) | ||
1008 | return ret; | ||
1009 | |||
1010 | nc = NULL; | ||
1011 | sock = NULL; | ||
1012 | if (u_notification != NULL) { | ||
1013 | if (copy_from_user(¬ification, u_notification, | 1007 | if (copy_from_user(¬ification, u_notification, |
1014 | sizeof(struct sigevent))) | 1008 | sizeof(struct sigevent))) |
1015 | return -EFAULT; | 1009 | return -EFAULT; |
1010 | } | ||
1011 | |||
1012 | audit_mq_notify(mqdes, u_notification ? ¬ification : NULL); | ||
1016 | 1013 | ||
1014 | nc = NULL; | ||
1015 | sock = NULL; | ||
1016 | if (u_notification != NULL) { | ||
1017 | if (unlikely(notification.sigev_notify != SIGEV_NONE && | 1017 | if (unlikely(notification.sigev_notify != SIGEV_NONE && |
1018 | notification.sigev_notify != SIGEV_SIGNAL && | 1018 | notification.sigev_notify != SIGEV_SIGNAL && |
1019 | notification.sigev_notify != SIGEV_THREAD)) | 1019 | notification.sigev_notify != SIGEV_THREAD)) |