From owner-cvs-src@FreeBSD.ORG Fri May 23 16:46:27 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 C26351065670; Fri, 23 May 2008 16:46:27 +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 A79F58FC24; Fri, 23 May 2008 16:46:27 +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 m4NGkRlI000568; Fri, 23 May 2008 16:46:27 GMT (envelope-from kib@repoman.freebsd.org) Received: (from kib@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4NGkRlG000567; Fri, 23 May 2008 16:46:27 GMT (envelope-from kib) Message-Id: <200805231646.m4NGkRlG000567@repoman.freebsd.org> From: Konstantin Belousov Date: Fri, 23 May 2008 16:46:27 +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:46:27 -0000 kib 2008-05-23 16:46:27 UTC FreeBSD src repository Modified files: sys/kern tty.c Log: The dev_refthread() in the tty_gettp() may fail, because Giant is taken in the giant_trick routines after the dev_refthread increments the si_threadcount. Remove assert, do not perform dev_relthread() for failed dev_refthread(), and handle failure in the tty_gettp() callers (cdevsw tty methods). Before kern_conf.c 1.210 and 1.211, the kernel usually paniced in the giant_trick routines dereferencing NULL cdevsw, not taking this fault. Reported by: Vince Hoffman Debugging help and tested by: pho Reviewed by: jhb MFC after: 1 week Revision Changes Path 1.279 +6 -5 src/sys/kern/tty.c