diff options
author | Petr Vandrovec <petr@vandrovec.name> | 2007-05-06 22:14:47 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-07-09 18:07:37 -0400 |
commit | ee9be425961c3ccf75553c83a73bf1f707e66d91 (patch) | |
tree | 0ffcc2409744d3e3710478594b1e04e406bd6eb2 /drivers | |
parent | 6552731a058a4facefd921b0b45a9a5392baa5ea (diff) |
ieee1394: raw1394: Fix read() for 32bit userland on 64bit kernel
read() always failed with -EFAULT. This was happening due to
raw1394_compat_read copying data to wrong location - access_ok always
failed as 'r' is kernel address, not user. Whole function just tried to
copy data from 'r' to 'r', which is not good.
Signed-off-by: Petr Vandrovec <petr@vandrovec.name>
Acked-by: Dan Dennedy <dan@dennedy.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (split into 3 patches)
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ieee1394/raw1394.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c index f1d05eeb9f51..858fd9ba0143 100644 --- a/drivers/ieee1394/raw1394.c +++ b/drivers/ieee1394/raw1394.c | |||
@@ -459,7 +459,7 @@ static const char __user *raw1394_compat_write(const char __user *buf) | |||
459 | static int | 459 | static int |
460 | raw1394_compat_read(const char __user *buf, struct raw1394_request *r) | 460 | raw1394_compat_read(const char __user *buf, struct raw1394_request *r) |
461 | { | 461 | { |
462 | struct compat_raw1394_req __user *cr = (typeof(cr)) r; | 462 | struct compat_raw1394_req __user *cr = (typeof(cr)) buf; |
463 | if (!access_ok(VERIFY_WRITE, cr, sizeof(struct compat_raw1394_req)) || | 463 | if (!access_ok(VERIFY_WRITE, cr, sizeof(struct compat_raw1394_req)) || |
464 | P(type) || | 464 | P(type) || |
465 | P(error) || | 465 | P(error) || |