Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jul 2009 18:54:38 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195509 - head/sys/kern
Message-ID:  <200907091854.n69IscOQ094059@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu Jul  9 18:54:38 2009
New Revision: 195509
URL: http://svn.freebsd.org/changeset/base/195509

Log:
  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

Modified:
  head/sys/kern/kern_exit.c

Modified: head/sys/kern/kern_exit.c
==============================================================================
--- head/sys/kern/kern_exit.c	Thu Jul  9 18:49:26 2009	(r195508)
+++ head/sys/kern/kern_exit.c	Thu Jul  9 18:54:38 2009	(r195509)
@@ -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);
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907091854.n69IscOQ094059>