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
0be8ad5fbc
commit
7a36e1d6c7
@ -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…
Reference in New Issue
Block a user