summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-08-07 17:53:31 +0000
committerrwatson <rwatson@FreeBSD.org>2002-08-07 17:53:31 +0000
commit647037845a4bbcd2f89e86402e910c887ead5ddb (patch)
treef55015983236f13ec803a92b304e05e6b0a8d4bd /sys/kern
parent8714facb13d40f5f55b7c9903063c8ebfac07f51 (diff)
downloadFreeBSD-src-647037845a4bbcd2f89e86402e910c887ead5ddb.zip
FreeBSD-src-647037845a4bbcd2f89e86402e910c887ead5ddb.tar.gz
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
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/init_main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 7c0f13c..b01e0c7 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -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);
OpenPOWER on IntegriCloud