Commit ee9be425 authored by Petr Vandrovec's avatar Petr Vandrovec Committed by Stefan Richter

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: default avatarPetr Vandrovec <petr@vandrovec.name>
Acked-by: default avatarDan Dennedy <dan@dennedy.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (split into 3 patches)
parent 6552731a
...@@ -459,7 +459,7 @@ static const char __user *raw1394_compat_write(const char __user *buf) ...@@ -459,7 +459,7 @@ static const char __user *raw1394_compat_write(const char __user *buf)
static int static int
raw1394_compat_read(const char __user *buf, struct raw1394_request *r) raw1394_compat_read(const char __user *buf, struct raw1394_request *r)
{ {
struct compat_raw1394_req __user *cr = (typeof(cr)) r; struct compat_raw1394_req __user *cr = (typeof(cr)) buf;
if (!access_ok(VERIFY_WRITE, cr, sizeof(struct compat_raw1394_req)) || if (!access_ok(VERIFY_WRITE, cr, sizeof(struct compat_raw1394_req)) ||
P(type) || P(type) ||
P(error) || P(error) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment