> On Sat, Sep 09, 2017 at 04:31:47PM -0700, Philip Guenther wrote:
> > Currently on amd64, the copyin(9) family of calls will pass through the
> > return value of uvm_fault() and thus return not just EFAULT but possibly
> > EACCES, ENOMEM, and EIO. Since the return value of those functions is
> > usually passed through to userspace, that's a Bad Thing IMO and we need to
> > fix them to always return EFAULT when uvm_fault() fails.
>
> Personally I prefer to see the real error number in user land. It
> makes it easier to track down the cause of problems if you know the
> original errno.
But that would change the errno return values from a vast number of
system calls. That feels like a huge departure from historical Unix.
For instance, open(2) says:
[EFAULT] path points outside the process's allocated address
space.
I think copyout should only return EFAULT, like it always did, so that
the return values remain from such failures remain unchanged.
If I understand Philip, the occurance of other error numbers are just
an artifacts of in-kernel implementation choices.