From owner-cvs-all@FreeBSD.ORG Fri May 30 11:13:30 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FDC71065671; Fri, 30 May 2008 11:13:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 453ED8FC0C; Fri, 30 May 2008 11:13:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4UBDUpv097885; Fri, 30 May 2008 11:13:30 GMT (envelope-from kib@repoman.freebsd.org) Received: (from kib@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4UBDUMg097884; Fri, 30 May 2008 11:13:30 GMT (envelope-from kib) Message-Id: <200805301113.m4UBDUMg097884@repoman.freebsd.org> From: Konstantin Belousov Date: Fri, 30 May 2008 11:13:30 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_7 Cc: Subject: cvs commit: src/sys/kern tty.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2008 11:13:30 -0000 kib 2008-05-30 11:13:30 UTC FreeBSD src repository Modified files: (Branch: RELENG_7) sys/kern tty.c Log: MFC rev. 1.280: Rev. 1.274 put the ttyrel() call before the destroy_dev() in the ttyfree(), freeing the tty. Since destroy_dev() may call d_purge() cdevsw method, that is the ttypurge() for the tty, the code ends up accessing freed tty structure. Put the ttyrel() after destroy_dev() in the ttyfree. To prevent the panic the rev. 1.274 provided fix for, check the TS_GONE in sysctl handler and refuse to provide information on such tty. Revision Changes Path 1.273.2.4 +5 -2 src/sys/kern/tty.c