Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Protect not only proc::p_flag but also lwp::l_ctxli...



details:   https://anonhg.NetBSD.org/src/rev/1e4bc1d8f1fd
branches:  trunk
changeset: 328641:1e4bc1d8f1fd
user:      uebayasi <uebayasi%NetBSD.org@localhost>
date:      Fri Apr 11 11:21:29 2014 +0000

description:
Protect not only proc::p_flag but also lwp::l_ctxlink and proc::p_acflag with
proc:p_lock.

diffstat:

 sys/kern/kern_exec.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r e82a3be18934 -r 1e4bc1d8f1fd sys/kern/kern_exec.c
--- a/sys/kern/kern_exec.c      Fri Apr 11 11:11:06 2014 +0000
+++ b/sys/kern/kern_exec.c      Fri Apr 11 11:21:29 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exec.c,v 1.379 2014/04/11 11:11:06 uebayasi Exp $ */
+/*     $NetBSD: kern_exec.c,v 1.380 2014/04/11 11:21:29 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.379 2014/04/11 11:11:06 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.380 2014/04/11 11:21:29 uebayasi Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -1193,11 +1193,9 @@
 
        execsigs(p);            /* reset catched signals */
 
+       mutex_enter(p->p_lock);
        l->l_ctxlink = NULL;    /* reset ucontext link */
-
-
        p->p_acflag &= ~AFORK;
-       mutex_enter(p->p_lock);
        p->p_flag |= PK_EXEC;
        mutex_exit(p->p_lock);
 



Home | Main Index | Thread Index | Old Index