Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/mach Don't send Mach exceptions to dying processes



details:   https://anonhg.NetBSD.org/src/rev/87b0ac95ae9a
branches:  trunk
changeset: 556041:87b0ac95ae9a
user:      manu <manu%NetBSD.org@localhost>
date:      Sat Dec 06 15:16:38 2003 +0000

description:
Don't send Mach exceptions to dying processes

diffstat:

 sys/compat/mach/mach_notify.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 7c66825a4633 -r 87b0ac95ae9a sys/compat/mach/mach_notify.c
--- a/sys/compat/mach/mach_notify.c     Sat Dec 06 15:16:10 2003 +0000
+++ b/sys/compat/mach/mach_notify.c     Sat Dec 06 15:16:38 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_notify.c,v 1.10 2003/12/03 18:40:07 manu Exp $ */
+/*     $NetBSD: mach_notify.c,v 1.11 2003/12/06 15:16:38 manu Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_notify.c,v 1.10 2003/12/03 18:40:07 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_notify.c,v 1.11 2003/12/06 15:16:38 manu Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_compat_mach.h" /* For COMPAT_MACH in <sys/ktrace.h> */
@@ -272,6 +272,10 @@
        struct mach_port *exc_port;
        int error;
 
+#ifdef DEBUG_MACH
+       printf("mach_exception: pid %d, exc %d, code (%d, %d)\n",
+           l->l_proc->p_pid, exc, code[0], code[1]);
+#endif
        /* 
         * No exception if there is no exception port or if it has no receiver
         */
@@ -280,6 +284,12 @@
            (exc_port->mp_recv == NULL))
                return EINVAL;
 
+       /*
+        * Don't send exceptions to dying processes
+        */
+       if (P_ZOMBIE(exc_port->mp_recv->mr_lwp->l_proc))
+               return EINVAL;
+
        /* 
         * XXX Avoid a nasty deadlock because process in TX state 
         * (traced and suspended) are invulnerable to kill -9. 



Home | Main Index | Thread Index | Old Index