Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Paranoia... keep vmspace reference while doing pmap...



details:   https://anonhg.NetBSD.org/src/rev/fded96612a24
branches:  trunk
changeset: 823120:fded96612a24
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Apr 13 07:58:45 2017 +0000

description:
Paranoia... keep vmspace reference while doing pmap_procwr

diffstat:

 sys/kern/sys_process.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r 42c5a7abaa6e -r fded96612a24 sys/kern/sys_process.c
--- a/sys/kern/sys_process.c    Thu Apr 13 07:49:52 2017 +0000
+++ b/sys/kern/sys_process.c    Thu Apr 13 07:58:45 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_process.c,v 1.178 2017/03/24 17:40:44 christos Exp $       */
+/*     $NetBSD: sys_process.c,v 1.179 2017/04/13 07:58:45 skrll Exp $  */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.178 2017/03/24 17:40:44 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.179 2017/04/13 07:58:45 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -177,12 +177,13 @@
        if (error != 0)
                return error;
        error = uvm_io(&vm->vm_map, uio, pax_mprotect_prot(l));
-       uvmspace_free(vm);
 
 #ifdef PMAP_NEED_PROCWR
        if (error == 0 && uio->uio_rw == UIO_WRITE)
                pmap_procwr(p, addr, len);
 #endif
+       uvmspace_free(vm);
+
        return error;
 }
 #endif /* KTRACE || PTRACE_HOOKS */



Home | Main Index | Thread Index | Old Index