From afc32a4ae3be31bf9b667ece0044d8657566abfd Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 11 Apr 2002 21:00:38 +0000 Subject: [PATCH] Use proc lock to protect p_ucred pointer while we deference it to read a few values. --- sys/compat/svr4/svr4_sysvec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c index 5292a8c76602..b6d1e2ca2c44 100644 --- a/sys/compat/svr4/svr4_sysvec.c +++ b/sys/compat/svr4/svr4_sysvec.c @@ -44,7 +44,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -213,10 +215,12 @@ svr4_fixup(register_t **stack_base, struct image_params *imgp) AUXARGS_ENTRY(pos, AT_FLAGS, args->flags); AUXARGS_ENTRY(pos, AT_ENTRY, args->entry); AUXARGS_ENTRY(pos, AT_BASE, args->base); + PROC_LOCK(imgp->proc); AUXARGS_ENTRY(pos, AT_UID, imgp->proc->p_ucred->cr_ruid); AUXARGS_ENTRY(pos, AT_EUID, imgp->proc->p_ucred->cr_svuid); AUXARGS_ENTRY(pos, AT_GID, imgp->proc->p_ucred->cr_rgid); AUXARGS_ENTRY(pos, AT_EGID, imgp->proc->p_ucred->cr_svgid); + PROC_UNLOCK(imgp->proc); AUXARGS_ENTRY(pos, AT_NULL, 0); free(imgp->auxargs, M_TEMP);