summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2001-12-02 15:15:29 +0000
committerrwatson <rwatson@FreeBSD.org>2001-12-02 15:15:29 +0000
commitdbe003dc3e5c6c4c5b59ab7d32c56382449b5249 (patch)
tree108852b40e269c76a9bf7d110f1e7625bd8ee4a3 /sys/kern/kern_prot.c
parent8b2ab77900be2c35291428ccf1958fb2976833ad (diff)
downloadFreeBSD-src-dbe003dc3e5c6c4c5b59ab7d32c56382449b5249.zip
FreeBSD-src-dbe003dc3e5c6c4c5b59ab7d32c56382449b5249.tar.gz
o Remove KSE race in setuid() in which oldcred was preserved before giant
was grabbed. This was introduced in 1.101 when the giant pushdown for kern_prot.c was originally performed.
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 1787789..df0dd41 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -500,10 +500,10 @@ setuid(td, uap)
uid_t uid;
int error;
- oldcred = p->p_ucred;
uid = uap->uid;
mtx_lock(&Giant);
error = 0;
+ oldcred = p->p_ucred;
/*
* See if we have "permission" by POSIX 1003.1 rules.
*
OpenPOWER on IntegriCloud