Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern PR# kern/45330: ptrace: signals can alter syscall r...
details: https://anonhg.NetBSD.org/src/rev/f06541f1cafb
branches: trunk
changeset: 769309:f06541f1cafb
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Tue Sep 06 11:22:42 2011 +0000
description:
PR# kern/45330: ptrace: signals can alter syscall return values
process_stoptrace: defer signal processing to userret, ok christos@
diffstat:
sys/kern/sys_process.c | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
diffs (47 lines):
diff -r b87b975b4fc0 -r f06541f1cafb sys/kern/sys_process.c
--- a/sys/kern/sys_process.c Tue Sep 06 11:14:17 2011 +0000
+++ b/sys/kern/sys_process.c Tue Sep 06 11:22:42 2011 +0000
@@ -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 */
Home |
Main Index |
Thread Index |
Old Index