2004-11-14 21:14:53

by Daniel Drake

[permalink] [raw]
Subject: [PATCH 2/3] raw1394: __copy_from_user check

--- 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);
}


Attachments:
raw1394-02-check-copy-from-user.patch (481.00 B)