All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Drake <dsd@gentoo.org>
To: bcollins@debian.org
Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] raw1394: __copy_from_user check
Date: Sun, 14 Nov 2004 03:37:28 +0000	[thread overview]
Message-ID: <4196D2F8.3020203@gentoo.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 143 bytes --]

Add a check for the return value of __copy_to_user
Depends on the previous whitespace fix patch.

Signed-off-by: Daniel Drake <dsd@gentoo.org>

[-- Attachment #2: raw1394-02-check-copy-from-user.patch --]
[-- Type: text/plain, Size: 481 bytes --]

--- linux/drivers/ieee1394/raw1394.c.orig	2004-11-14 03:02:30.000000000 +0000
+++ linux/drivers/ieee1394/raw1394.c	2004-11-14 03:12:12.928827600 +0000
@@ -447,9 +447,12 @@ static ssize_t raw1394_read(struct file 
 			req->req.error = RAW1394_ERROR_MEMFAULT;
 		}
 	}
-	__copy_to_user(buffer, &req->req, sizeof(req->req));
 
 	free_pending_request(req);
+
+	if (__copy_to_user(buffer, &req->req, sizeof(req->req)))
+		return -EFAULT;
+
 	return sizeof(struct raw1394_request);
 }
 

                 reply	other threads:[~2004-11-14 21:14 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=4196D2F8.3020203@gentoo.org \
    --to=dsd@gentoo.org \
    --cc=bcollins@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.