Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jun 2018 19:57:04 +0000 (UTC)
From:      Ryan Libby <rlibby@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335076 - head/sys/i386/i386
Message-ID:  <201806131957.w5DJv46i035208@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806131957.w5DJv46i035208>