Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Nov 2011 13:17:37 +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-8@freebsd.org
Subject:   svn commit: r227212 - stable/8/sys/fs/devfs
Message-ID:  <201111061317.pA6DHb4t022986@svn.freebsd.org>

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

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/8/sys/fs/devfs/devfs_vnops.c
Directory Properties:
  stable/8/sys/   (props changed)

Modified: stable/8/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- stable/8/sys/fs/devfs/devfs_vnops.c	Sun Nov  6 13:06:31 2011	(r227211)
+++ stable/8/sys/fs/devfs/devfs_vnops.c	Sun Nov  6 13:17:37 2011	(r227212)
@@ -982,6 +982,10 @@ devfs_open(struct vop_open_args *ap)
 	dsw = dev_refthread(dev, &ref);
 	if (dsw == NULL)
 		return (ENXIO);
+	if (fp == NULL && dsw->d_fdopen != NULL) {
+		dev_relthread(dev, ref);
+		return (ENXIO);
+	}
 
 	vlocked = VOP_ISLOCKED(vp);
 	VOP_UNLOCK(vp, 0);



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