diff options
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r-- | sys/kern/kern_fork.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 2d1ce60..28f0970 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -472,6 +472,7 @@ again: */ PROC_LOCK(p1); p2->p_ucred = crhold(p1->p_ucred); + p2->p_thread.td_ucred = crhold(p2->p_ucred); /* XXXKSE */ if (p2->p_args) p2->p_args->ar_ref++; @@ -797,6 +798,10 @@ fork_exit(callout, arg, frame) kthread_exit(0); } PROC_UNLOCK(p); + mtx_lock(&Giant); + crfree(td->td_ucred); + mtx_unlock(&Giant); + td->td_ucred = NULL; mtx_assert(&Giant, MA_NOTOWNED); } |