svn commit: r335076 - head/sys/i386/i386

Ryan Libby rlibby at FreeBSD.org
Wed Jun 13 19:57:05 UTC 2018


Author: rlibby
Date: Wed Jun 13 19:57:03 2018
New Revision: 335076
URL: https://svnweb.freebsd.org/changeset/base/335076

Log:
  i386: copyin/copyout error is EFAULT
  
  Discussed with:	kib
  MFC with:	r332489
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/i386/i386/copyout.c

Modified: head/sys/i386/i386/copyout.c
==============================================================================
--- head/sys/i386/i386/copyout.c	Wed Jun 13 18:58:36 2018	(r335075)
+++ head/sys/i386/i386/copyout.c	Wed Jun 13 19:57:03 2018	(r335076)
@@ -226,7 +226,7 @@ copyin(const void *udaddr, void *kaddr, size_t len)
 
 	if ((uintptr_t)udaddr + len < (uintptr_t)udaddr ||
 	    (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS)
-		return (-1);
+		return (EFAULT);
 	if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ &&
 	    copyin_fast_tramp(udaddr, kaddr, len, KCR3) == 0))
 		return (0);
@@ -261,7 +261,7 @@ copyout(const void *kaddr, void *udaddr, size_t len)
 
 	if ((uintptr_t)udaddr + len < (uintptr_t)udaddr ||
 	    (uintptr_t)udaddr + len > VM_MAXUSER_ADDRESS)
-		return (-1);
+		return (EFAULT);
 	if (len == 0 || (fast_copyout && len <= TRAMP_COPYOUT_SZ &&
 	    copyout_fast_tramp(kaddr, udaddr, len, KCR3) == 0))
 		return (0);


More information about the svn-src-head mailing list