summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-04-11 21:00:38 +0000
committerjhb <jhb@FreeBSD.org>2002-04-11 21:00:38 +0000
commitafc32a4ae3be31bf9b667ece0044d8657566abfd (patch)
treee53fd9bece7d8a057640a4490c89766bd146777a /sys
parentb129a4a7ca85e377255fb9c2b89490d5059f4f5d (diff)
downloadFreeBSD-src-afc32a4ae3be31bf9b667ece0044d8657566abfd.zip
FreeBSD-src-afc32a4ae3be31bf9b667ece0044d8657566abfd.tar.gz
Use proc lock to protect p_ucred pointer while we deference it to read a
few values.
Diffstat (limited to 'sys')
-rw-r--r--sys/compat/svr4/svr4_sysvec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/compat/svr4/svr4_sysvec.c b/sys/compat/svr4/svr4_sysvec.c
index 5292a8c..b6d1e2c 100644
--- a/sys/compat/svr4/svr4_sysvec.c
+++ b/sys/compat/svr4/svr4_sysvec.c
@@ -44,7 +44,9 @@
#include <sys/imgact.h>
#include <sys/imgact_elf.h>
#include <sys/socket.h>
+#include <sys/lock.h>
#include <sys/malloc.h>
+#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/vnode.h>
#include <sys/module.h>
@@ -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);
OpenPOWER on IntegriCloud