mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: akpm@osdl.org
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, haveblue@us.ibm.com
Subject: [patch 135/198] undo do_readv_writev() behavior change
Date: Tue, 12 Apr 2005 03:32:41 -0700	[thread overview]
Message-ID: <200504121032.j3CAWlHD005680@shell0.pdx.osdl.net> (raw)


From: Dave Hansen <haveblue@us.ibm.com>

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>
---

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

diff -puN fs/read_write.c~undo-do_readv_writev-behavior-change fs/read_write.c
--- 25/fs/read_write.c~undo-do_readv_writev-behavior-change	2005-04-12 03:21:36.081651656 -0700
+++ 25-akpm/fs/read_write.c	2005-04-12 03:21:36.084651200 -0700
@@ -467,10 +467,10 @@ static ssize_t do_readv_writev(int type,
 		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;
_

                 reply	other threads:[~2005-04-12 18:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504121032.j3CAWlHD005680@shell0.pdx.osdl.net \
    --to=akpm@osdl.org \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®