* [PATCH 2/3] raw1394: __copy_from_user check
@ 2004-11-14 3:37 Daniel Drake
0 siblings, 0 replies; only message in thread
From: Daniel Drake @ 2004-11-14 3:37 UTC (permalink / raw)
To: bcollins; +Cc: linux1394-devel, linux-kernel
[-- 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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-11-14 21:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-14 3:37 [PATCH 2/3] raw1394: __copy_from_user check Daniel Drake
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome