release text vnode before releasing credentials. vnode releasing can
authorderaadt <deraadt@openbsd.org>
Wed, 22 Nov 1995 11:05:19 +0000 (11:05 +0000)
committerderaadt <deraadt@openbsd.org>
Wed, 22 Nov 1995 11:05:19 +0000 (11:05 +0000)
block, but credentials should be alive until the process is really
dead. from tegge@idt.unit.no; netbsd pr#1767

sys/kern/kern_exit.c

index 4212de8..466dd88 100644 (file)
@@ -337,6 +337,12 @@ loop:
                         */
                        (void)chgproccnt(p->p_cred->p_ruid, -1);
 
+                       /*
+                        * Release reference to text vnode
+                        */
+                       if (p->p_textvp)
+                               vrele(p->p_textvp);
+
                        /*
                         * Free up credentials.
                         */
@@ -345,12 +351,6 @@ loop:
                                FREE(p->p_cred, M_SUBPROC);
                        }
 
-                       /*
-                        * Release reference to text vnode
-                        */
-                       if (p->p_textvp)
-                               vrele(p->p_textvp);
-
                        /*
                         * Finally finished with old proc entry.
                         * Unlink it from its process group and free it.