]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/kern/kern_exit.c
xnu-3789.70.16.tar.gz
[apple/xnu.git] / bsd / kern / kern_exit.c
index a03d9b87a7f01b87156d87541384fac2cf221aaa..4442c7ff49754cf161da65a2ab77806db92eb9af 100644 (file)
@@ -642,7 +642,8 @@ exit_with_reason(proc_t p, int rv, int *retval, boolean_t thread_can_terminate,
         */
 
         ut = get_bsdthread_info(self);
-        if (ut->uu_flag & UT_VFORK) {
+        if ((p == current_proc()) &&
+            (ut->uu_flag & UT_VFORK)) {
                os_reason_free(exit_reason);
                if (!thread_can_terminate) {
                        return EINVAL;
@@ -667,6 +668,10 @@ exit_with_reason(proc_t p, int rv, int *retval, boolean_t thread_can_terminate,
         * what the return value is.
         */
        AUDIT_ARG(exit, WEXITSTATUS(rv), 0);
+       /*
+        * TODO: what to audit here when jetsam calls exit and the uthread,
+        * 'ut' does not belong to the proc, 'p'.
+        */
        AUDIT_SYSCALL_EXIT(SYS_exit, p, ut, 0); /* Exit is always successfull */
 
        DTRACE_PROC1(exit, int, CLD_EXITED);