Date: Wed, 17 Jan 2018 09:36:48 +0000 (UTC) From: Wojciech Macek <wma@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328079 - head/sys/powerpc/powerpc Message-ID: <201801170936.w0H9amI3086002@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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@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); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801170936.w0H9amI3086002>