Use proc lock to protect p_ucred pointer while we deference it to read a
few values.
This commit is contained in:
parent
b129a4a7ca
commit
afc32a4ae3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user