The control terminal revocation at the session leader exit does not

correctly checks for reclaimed vnode, possibly calling VOP_REVOKE for
such vnode. If the terminal is already revoked, or devfs mount was
forcibly unmounted, the revocation of doomed ctty vnode causes panic.

Reported and tested by:	lstewart
Approved by:	re (kensmith)
MFC after:	2 weeks
This commit is contained in:
Konstantin Belousov 2009-07-09 18:54:38 +00:00
parent 1d587edb3a
commit 7c6d401c75

View File

@ -334,10 +334,11 @@ exit1(struct thread *td, int rv)
tty_unlock(tp);
}
if (ttyvp != NULL && ttyvp->v_type != VBAD) {
if (ttyvp != NULL) {
sx_xunlock(&proctree_lock);
VOP_LOCK(ttyvp, LK_EXCLUSIVE);
VOP_REVOKE(ttyvp, REVOKEALL);
vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY);
if (ttyvp->v_type != VBAD)
VOP_REVOKE(ttyvp, REVOKEALL);
VOP_UNLOCK(ttyvp, 0);
sx_xlock(&proctree_lock);
}