Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm If we need to set the PK_CHKNOSYSCALL flag in struct...



details:   https://anonhg.NetBSD.org/src/rev/512a098f0f20
branches:  trunk
changeset: 772150:512a098f0f20
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Tue Dec 20 19:49:36 2011 +0000

description:
If we need to set the PK_CHKNOSYSCALL flag in struct proc be so nice to first
take the mutex. Tnx for pointing it out to me.

diffstat:

 sys/uvm/uvm_mmap.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r ebdc1de43946 -r 512a098f0f20 sys/uvm/uvm_mmap.c
--- a/sys/uvm/uvm_mmap.c        Tue Dec 20 17:09:04 2011 +0000
+++ b/sys/uvm/uvm_mmap.c        Tue Dec 20 19:49:36 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_mmap.c,v 1.140 2011/12/20 15:39:35 reinoud Exp $   */
+/*     $NetBSD: uvm_mmap.c,v 1.141 2011/12/20 19:49:36 reinoud Exp $   */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.140 2011/12/20 15:39:35 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.141 2011/12/20 19:49:36 reinoud Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_pax.h"
@@ -560,8 +560,12 @@
                                panic("uvm_setattr failed?");
                }
                /* record if we need optimization for system call checking */
-               if (flags & MAP_NOSYSCALLS)
+               if ((flags & MAP_NOSYSCALLS) &&
+                               ((p->p_flag & PK_CHKNOSYSCALL) == 0)) {
+                       mutex_enter(p->p_lock);
                        p->p_flag |= PK_CHKNOSYSCALL;
+                       mutex_exit(p->p_lock);
+               }
        }
 
        if (fp != NULL)



Home | Main Index | Thread Index | Old Index