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.
This commit is contained in:
rwatson 2004-08-04 18:39:07 +00:00
parent 243f24944e
commit 5d6fea3b71

View File

@ -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,