diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-03-21 19:29:06 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-09 00:02:26 -0400 |
commit | da18428498fb24438a23d982259461fe22bc1f46 (patch) | |
tree | 37efb94c71802ac8aa9ebf4c443b63aefc809479 /net/compat.c | |
parent | 602bd0e90e14c0b50246b361290dbbbe551ada98 (diff) |
net: switch importing msghdr from userland to {compat_,}import_iovec()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/compat.c')
-rw-r--r-- | net/compat.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/net/compat.c b/net/compat.c index c4b6b0f43d5d..5cfd26a0006f 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -31,10 +31,10 @@ | |||
31 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
32 | #include <net/compat.h> | 32 | #include <net/compat.h> |
33 | 33 | ||
34 | ssize_t get_compat_msghdr(struct msghdr *kmsg, | 34 | int get_compat_msghdr(struct msghdr *kmsg, |
35 | struct compat_msghdr __user *umsg, | 35 | struct compat_msghdr __user *umsg, |
36 | struct sockaddr __user **save_addr, | 36 | struct sockaddr __user **save_addr, |
37 | struct iovec **iov) | 37 | struct iovec **iov) |
38 | { | 38 | { |
39 | compat_uptr_t uaddr, uiov, tmp3; | 39 | compat_uptr_t uaddr, uiov, tmp3; |
40 | compat_size_t nr_segs; | 40 | compat_size_t nr_segs; |
@@ -81,13 +81,9 @@ ssize_t get_compat_msghdr(struct msghdr *kmsg, | |||
81 | 81 | ||
82 | kmsg->msg_iocb = NULL; | 82 | kmsg->msg_iocb = NULL; |
83 | 83 | ||
84 | err = compat_rw_copy_check_uvector(save_addr ? READ : WRITE, | 84 | return compat_import_iovec(save_addr ? READ : WRITE, |
85 | compat_ptr(uiov), nr_segs, | 85 | compat_ptr(uiov), nr_segs, |
86 | UIO_FASTIOV, *iov, iov); | 86 | UIO_FASTIOV, iov, &kmsg->msg_iter); |
87 | if (err >= 0) | ||
88 | iov_iter_init(&kmsg->msg_iter, save_addr ? READ : WRITE, | ||
89 | *iov, nr_segs, err); | ||
90 | return err; | ||
91 | } | 87 | } |
92 | 88 | ||
93 | /* Bleech... */ | 89 | /* Bleech... */ |