diff options
author | Dave Hansen <haveblue@us.ibm.com> | 2005-04-16 18:25:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:25:49 -0400 |
commit | 1f08ad02379530e1c970d3d104343b9907b4d1b4 (patch) | |
tree | 607f1e99cefab35bccb14b5c053c0d63ff74458c /fs | |
parent | 22a685d09bb98810670ac0fb02c2138bdbf038cc (diff) |
[PATCH] undo do_readv_writev() behavior change
Bugme bug 4326: http://bugme.osdl.org/show_bug.cgi?id=4326 reports:
executing the systemcall readv with Bad argument
->len == -1) it gives out error EFAULT instead of EINVAL
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/read_write.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index 6be4b1a1956b..c4c2bee373ed 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -467,10 +467,10 @@ static ssize_t do_readv_writev(int type, struct file *file, | |||
467 | void __user *buf = iov[seg].iov_base; | 467 | void __user *buf = iov[seg].iov_base; |
468 | ssize_t len = (ssize_t)iov[seg].iov_len; | 468 | ssize_t len = (ssize_t)iov[seg].iov_len; |
469 | 469 | ||
470 | if (unlikely(!access_ok(vrfy_dir(type), buf, len))) | ||
471 | goto Efault; | ||
472 | if (len < 0) /* size_t not fitting an ssize_t .. */ | 470 | if (len < 0) /* size_t not fitting an ssize_t .. */ |
473 | goto out; | 471 | goto out; |
472 | if (unlikely(!access_ok(vrfy_dir(type), buf, len))) | ||
473 | goto Efault; | ||
474 | tot_len += len; | 474 | tot_len += len; |
475 | if ((ssize_t)tot_len < 0) /* maths overflow on the ssize_t */ | 475 | if ((ssize_t)tot_len < 0) /* maths overflow on the ssize_t */ |
476 | goto out; | 476 | goto out; |