Skip to content

Commit

Permalink
[PATCH] undo do_readv_writev() behavior change
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
hansendc authored and Linus Torvalds committed Apr 16, 2005
1 parent 22a685d commit 1f08ad0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/read_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ static ssize_t do_readv_writev(int type, struct file *file,
void __user *buf = iov[seg].iov_base;
ssize_t len = (ssize_t)iov[seg].iov_len;

if (unlikely(!access_ok(vrfy_dir(type), buf, len)))
goto Efault;
if (len < 0) /* size_t not fitting an ssize_t .. */
goto out;
if (unlikely(!access_ok(vrfy_dir(type), buf, len)))
goto Efault;
tot_len += len;
if ((ssize_t)tot_len < 0) /* maths overflow on the ssize_t */
goto out;
Expand Down

0 comments on commit 1f08ad0

Please sign in to comment.