diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-08-04 18:39:07 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-08-04 18:39:07 +0000 |
commit | 5d6fea3b71c6313cb20df290feaaed02e562239b (patch) | |
tree | 60ec854f316177c1e2a2fc45bcd2ad7e5c129066 /sys/kern | |
parent | 243f24944e31bf8264984db84728ef9b479c4a91 (diff) | |
download | FreeBSD-src-5d6fea3b71c6313cb20df290feaaed02e562239b.zip FreeBSD-src-5d6fea3b71c6313cb20df290feaaed02e562239b.tar.gz |
Assert Giant in namei(). Bugs have been reported in which, following
a sleep() call waking up in namei(), a later assertion triggers that
Giant is not held. By asserting Giant at the start of namei(), we can
know that if that assertion triggers, Giant is lost during the call to
namei(), and not before.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_lookup.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 10b49aa..1410754 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -105,6 +105,8 @@ namei(ndp) struct thread *td = cnp->cn_thread; struct proc *p = td->td_proc; + GIANT_REQUIRED; + ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_thread->td_ucred; KASSERT(cnp->cn_cred && p, ("namei: bad cred/proc")); KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0, |