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:
parent
243f24944e
commit
5d6fea3b71
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user