Module Name: src Committed By: jmcneill Date: Tue Sep 6 11:22:43 UTC 2011
Modified Files: src/sys/kern: sys_process.c Log Message: PR# kern/45330: ptrace: signals can alter syscall return values process_stoptrace: defer signal processing to userret, ok christos@ To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/kern/sys_process.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/sys_process.c diff -u src/sys/kern/sys_process.c:1.161 src/sys/kern/sys_process.c:1.162 --- src/sys/kern/sys_process.c:1.161 Fri Sep 2 20:07:41 2011 +++ src/sys/kern/sys_process.c Tue Sep 6 11:22:42 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_process.c,v 1.161 2011/09/02 20:07:41 christos Exp $ */ +/* $NetBSD: sys_process.c,v 1.162 2011/09/06 11:22:42 jmcneill 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.161 2011/09/02 20:07:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.162 2011/09/06 11:22:42 jmcneill Exp $"); #include "opt_ptrace.h" #include "opt_ktrace.h" @@ -1102,7 +1102,6 @@ { struct lwp *l = curlwp; struct proc *p = l->l_proc, *pp; - int sig; mutex_enter(proc_lock); mutex_enter(p->p_lock); @@ -1118,15 +1117,11 @@ proc_stop(p, 1, SIGSTOP); mutex_exit(proc_lock); - /* - * Call issignal() once only, to have it take care of the - * pending stop. Signal processing will take place as usual - * from userret(). - */ - KERNEL_UNLOCK_ALL(l, &l->l_biglocks); - if ((sig = issignal(l)) != 0) - postsig(sig); + if (sigispending(l, 0)) { + lwp_lock(l); + l->l_flag |= LW_PENDSIG; + lwp_unlock(l); + } mutex_exit(p->p_lock); - KERNEL_LOCK(l->l_biglocks, l); } #endif /* KTRACE || PTRACE */