Skip to content

Commit bffea77

Browse files
Dan Carpentertorvalds
authored andcommitted
compat: return -EFAULT on error in waitid()
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]>
1 parent 9a8ab1c commit bffea77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/compat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ COMPAT_SYSCALL_DEFINE5(waitid,
593593
else
594594
ret = put_compat_rusage(&ru, uru);
595595
if (ret)
596-
return ret;
596+
return -EFAULT;
597597
}
598598

599599
BUG_ON(info.si_code & __SI_MASK);

0 commit comments

Comments
 (0)