diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-12-29 16:12:28 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-12-29 16:12:28 -0500 |
commit | 14544d7690f674ce2b7aa9dc6531c244cc861d19 (patch) | |
tree | ccae0ed95da033b82a88017884ea984e93dd75bf | |
parent | 3d46d7108dd3ff8b1d477bc2b7b061b12690e83c (diff) |
vme_user: don't use __copy_..._user()
Saving access_ok() is not worth the trouble; yes, the callers of ->read()
and ->write() will have done the right checks, but it's much too long
(and varied) call chains to rely upon.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | drivers/staging/vme/devices/vme_user.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index a3d4610fbdbe..4c8c6fa0a79f 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c | |||
@@ -134,7 +134,7 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, | |||
134 | if (copied < 0) | 134 | if (copied < 0) |
135 | return (int)copied; | 135 | return (int)copied; |
136 | 136 | ||
137 | if (__copy_to_user(buf, image[minor].kern_buf, (unsigned long)copied)) | 137 | if (copy_to_user(buf, image[minor].kern_buf, (unsigned long)copied)) |
138 | return -EFAULT; | 138 | return -EFAULT; |
139 | 139 | ||
140 | return copied; | 140 | return copied; |
@@ -146,7 +146,7 @@ static ssize_t resource_from_user(unsigned int minor, const char __user *buf, | |||
146 | if (count > image[minor].size_buf) | 146 | if (count > image[minor].size_buf) |
147 | count = image[minor].size_buf; | 147 | count = image[minor].size_buf; |
148 | 148 | ||
149 | if (__copy_from_user(image[minor].kern_buf, buf, (unsigned long)count)) | 149 | if (copy_from_user(image[minor].kern_buf, buf, (unsigned long)count)) |
150 | return -EFAULT; | 150 | return -EFAULT; |
151 | 151 | ||
152 | return vme_master_write(image[minor].resource, image[minor].kern_buf, | 152 | return vme_master_write(image[minor].resource, image[minor].kern_buf, |
@@ -159,7 +159,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf, | |||
159 | void *image_ptr; | 159 | void *image_ptr; |
160 | 160 | ||
161 | image_ptr = image[minor].kern_buf + *ppos; | 161 | image_ptr = image[minor].kern_buf + *ppos; |
162 | if (__copy_to_user(buf, image_ptr, (unsigned long)count)) | 162 | if (copy_to_user(buf, image_ptr, (unsigned long)count)) |
163 | return -EFAULT; | 163 | return -EFAULT; |
164 | 164 | ||
165 | return count; | 165 | return count; |
@@ -171,7 +171,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char __user *buf, | |||
171 | void *image_ptr; | 171 | void *image_ptr; |
172 | 172 | ||
173 | image_ptr = image[minor].kern_buf + *ppos; | 173 | image_ptr = image[minor].kern_buf + *ppos; |
174 | if (__copy_from_user(image_ptr, buf, (unsigned long)count)) | 174 | if (copy_from_user(image_ptr, buf, (unsigned long)count)) |
175 | return -EFAULT; | 175 | return -EFAULT; |
176 | 176 | ||
177 | return count; | 177 | return count; |