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@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          QCM Technologies
This commit is contained in:
wma 2018-01-17 09:36:48 +00:00
parent 225d71d135
commit 0ae6682f6b

View File

@ -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);
}