tree 7ec30344667b228aa8d81bb096f2dda767ccecf1
parent 3056f30d23047d7d30cfac4d0b2da4d84601cff7
author Dave Hansen <[EMAIL PROTECTED]> Tue Apr 12 08:26:17 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:26:17 2005

[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 <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 read_write.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: fs/read_write.c
===================================================================
--- c1ee2a54b89d471dc7087be83a4030ab2656becd/fs/read_write.c  (mode:100644 
sha1:ae3ad80d575129c069c39629d4c7e327c2abc178)
+++ 7ec30344667b228aa8d81bb096f2dda767ccecf1/fs/read_write.c  (mode:100644 
sha1:74abfe853ecc6ad8cf953c484d9faa3464ec1214)
@@ -467,10 +467,10 @@
                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;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to