From 0ae6682f6bcc0692374c1dc8beaf696120156238 Mon Sep 17 00:00:00 2001 From: wma Date: Wed, 17 Jan 2018 09:36:48 +0000 Subject: [PATCH] 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 Obtained from: Semihalf Sponsored by: QCM Technologies --- sys/powerpc/powerpc/copyinout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/powerpc/powerpc/copyinout.c b/sys/powerpc/powerpc/copyinout.c index c317f6498368..e44f302c9c27 100644 --- a/sys/powerpc/powerpc/copyinout.c +++ b/sys/powerpc/powerpc/copyinout.c @@ -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); }