Skip to content

Commit

Permalink
compat: return -EFAULT on error in waitid()
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Dan Carpenter authored and torvalds committed Feb 22, 2013
1 parent 9a8ab1c commit bffea77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bffea77

Please sign in to comment.