Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Nov 2011 13:35:56 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r227213 - stable/7/sys/fs/devfs
Message-ID:  <201111061335.pA6DZuDv023650@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Nov  6 13:35:55 2011
New Revision: 227213
URL: http://svn.freebsd.org/changeset/base/227213

Log:
  MFC r227062:
  Fix kernel panic when d_fdopen csw method is called for NULL fp.
  This may happen when kernel consumer calls VOP_OPEN().

Modified:
  stable/7/sys/fs/devfs/devfs_vnops.c
Directory Properties:
  stable/7/sys/   (props changed)

Modified: stable/7/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- stable/7/sys/fs/devfs/devfs_vnops.c	Sun Nov  6 13:17:37 2011	(r227212)
+++ stable/7/sys/fs/devfs/devfs_vnops.c	Sun Nov  6 13:35:55 2011	(r227213)
@@ -887,6 +887,10 @@ devfs_open(struct vop_open_args *ap)
 	dsw = dev_refthread(dev);
 	if (dsw == NULL)
 		return (ENXIO);
+	if (fp == NULL && dsw->d_fdopen != NULL) {
+		dev_relthread(dev);
+		return (ENXIO);
+	}
 
 	/* XXX: Special casing of ttys for deadfs.  Probably redundant. */
 	if (dsw->d_flags & D_TTY)



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