svn commit: r328079 - head/sys/powerpc/powerpc

Wojciech Macek wma at FreeBSD.org
Wed Jan 17 09:36:50 UTC 2018


Author: wma
Date: Wed Jan 17 09:36:48 2018
New Revision: 328079
URL: https://svnweb.freebsd.org/changeset/base/328079

Log:
  PPC64: fix copyinout ranges
  
  Use current userspace address for segment mapping. Previously,
  there was a bug which made the funciton constantly using the userspace
  base address which could cause data integrity issues.
  
  Created by:            Wojciech Macek <wma at semihalf.com>
  Obtained from:         Semihalf
  Sponsored by:          QCM Technologies

Modified:
  head/sys/powerpc/powerpc/copyinout.c

Modified: head/sys/powerpc/powerpc/copyinout.c
==============================================================================
--- head/sys/powerpc/powerpc/copyinout.c	Wed Jan 17 09:33:16 2018	(r328078)
+++ head/sys/powerpc/powerpc/copyinout.c	Wed Jan 17 09:36:48 2018	(r328079)
@@ -94,7 +94,7 @@ copyout(const void *kaddr, void *udaddr, size_t len)
 	up = udaddr;
 
 	while (len > 0) {
-		if (pmap_map_user_ptr(pm, udaddr, (void **)&p, len, &l)) {
+		if (pmap_map_user_ptr(pm, up, (void **)&p, len, &l)) {
 			td->td_pcb->pcb_onfault = NULL;
 			return (EFAULT);
 		}
@@ -133,7 +133,7 @@ copyin(const void *udaddr, void *kaddr, size_t len)
 	up = udaddr;
 
 	while (len > 0) {
-		if (pmap_map_user_ptr(pm, udaddr, (void **)&p, len, &l)) {
+		if (pmap_map_user_ptr(pm, up, (void **)&p, len, &l)) {
 			td->td_pcb->pcb_onfault = NULL;
 			return (EFAULT);
 		}


More information about the svn-src-head mailing list