compat: return -EFAULT on error in waitid()
authorDan Carpenter <[email protected]>
Fri, 22 Feb 2013 00:41:57 +0000 (16:41 -0800)
committerLinus Torvalds <[email protected]>
Fri, 22 Feb 2013 01:22:16 +0000 (17:22 -0800)
The copy_to_user() call returns the number of bytes remaining but we
want to return -EFAULT on error.

Fixes "x32: fix waitid()"

Signed-off-by: Dan Carpenter <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/compat.c

index 36700e9e2be9125f976963cb1fca4316460dee00..f4bddb90018614b878ae67ac8775ba0295e46cd1 100644 (file)
@@ -593,7 +593,7 @@ COMPAT_SYSCALL_DEFINE5(waitid,
                else
                        ret = put_compat_rusage(&ru, uru);
                if (ret)
-                       return ret;
+                       return -EFAULT;
        }
 
        BUG_ON(info.si_code & __SI_MASK);