From owner-cvs-src@FreeBSD.ORG Fri May 23 16:47:55 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 722491065672; Fri, 23 May 2008 16:47:55 +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 3B8D28FC26; Fri, 23 May 2008 16:47:55 +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 m4NGltR1009813; Fri, 23 May 2008 16:47:55 GMT (envelope-from kib@repoman.freebsd.org) Received: (from kib@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4NGltnh009812; Fri, 23 May 2008 16:47:55 GMT (envelope-from kib) Message-Id: <200805231647.m4NGltnh009812@repoman.freebsd.org> From: Konstantin Belousov Date: Fri, 23 May 2008 16:47:55 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern tty.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2008 16:47:55 -0000 kib 2008-05-23 16:47:55 UTC FreeBSD src repository Modified files: sys/kern tty.c Log: 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. Reported, debugging help and tested by: pho DIscussed with and reviewed by: jhb MFC after: 1 week Revision Changes Path 1.280 +5 -2 src/sys/kern/tty.c