From owner-svn-src-all@FreeBSD.ORG Mon Feb 9 12:22:49 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7DBD106566C; Mon, 9 Feb 2009 12:22:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4FDD8FC0C; Mon, 9 Feb 2009 12:22:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n19CMnbR059847; Mon, 9 Feb 2009 12:22:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n19CMnfR059846; Mon, 9 Feb 2009 12:22:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200902091222.n19CMnfR059846@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 9 Feb 2009 12:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188389 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb fs/fifofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2009 12:22:50 -0000 Author: kib Date: Mon Feb 9 12:22:49 2009 New Revision: 188389 URL: http://svn.freebsd.org/changeset/base/188389 Log: MFC r187715: The kernel may do unbalanced calls to fifo_close() for fifo vnode, without corresponding number of fifo_open(). This causes assertion failure in fifo_close() due to vp->v_fifoinfo being NULL for kernel with INVARIANTS, or NULL pointer dereference otherwise. In fact, we may ignore excess calls to fifo_close() without bad consequences. Turn KASSERT() into the return, and print warning for now. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/fs/fifofs/fifo_vnops.c Modified: stable/7/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- stable/7/sys/fs/fifofs/fifo_vnops.c Mon Feb 9 11:42:23 2009 (r188388) +++ stable/7/sys/fs/fifofs/fifo_vnops.c Mon Feb 9 12:22:49 2009 (r188389) @@ -424,7 +424,10 @@ fifo_close(ap) struct fifoinfo *fip = vp->v_fifoinfo; ASSERT_VOP_LOCKED(vp, "fifo_close"); - KASSERT(fip != NULL, ("fifo_close: no v_fifoinfo")); + if (fip == NULL) { + printf("fifo_close: no v_fifoinfo %p\n", vp); + return (0); + } if (ap->a_fflag & FREAD) { fip->fi_readers--; if (fip->fi_readers == 0)