Refresh the credential on the first initproc thread following divorcing

the initproc credential from the proc0 credential.  Otherwise, the
proc0 credential is used instead of initproc's credentil when authorizing
start_init() activities prior to initproc hitting userland for the
first time.  This could result in the incorrect credential being used
to authorize mounting of the root file system, which could in turn cause
problems for NFS when used in combination with uid/gid ipfw rules, or
with MAC.

Discussed with:	julian
This commit is contained in:
rwatson 2002-08-07 17:53:31 +00:00
parent 8714facb13
commit 647037845a

View File

@ -671,6 +671,7 @@ create_init(const void *udata __unused)
initproc->p_ucred = newcred;
PROC_UNLOCK(initproc);
crfree(oldcred);
cred_update_thread(FIRST_THREAD_IN_PROC(initproc));
mtx_lock_spin(&sched_lock);
initproc->p_sflag |= PS_INMEM;
mtx_unlock_spin(&sched_lock);