Module Name: src
Committed By: snj
Date: Sat Feb 6 20:55:12 UTC 2016
Modified Files:
src/sys/nfs [netbsd-7-0]: nfs_vnops.c
Log Message:
Pull up following revision(s) (requested by hannken in ticket #1094):
sys/nfs/nfs_vnops.c: revision 1.309
Return an error if NFSPROC_LOOKUP returns the file handle of the current
directory. Treating it as DOT lookup would put garbage into the name
cache and could panic on future lookups.
Seen with ZFS file system exported from OmniOS, an OpenSolaris derivative.
Fixes PR kern/50664 "cd .." over NFS/ZFS can panic kernel
To generate a diff of this commit:
cvs rdiff -u -r1.306.2.1 -r1.306.2.1.2.1 src/sys/nfs/nfs_vnops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/nfs/nfs_vnops.c
diff -u src/sys/nfs/nfs_vnops.c:1.306.2.1 src/sys/nfs/nfs_vnops.c:1.306.2.1.2.1
--- src/sys/nfs/nfs_vnops.c:1.306.2.1 Tue May 19 04:56:45 2015
+++ src/sys/nfs/nfs_vnops.c Sat Feb 6 20:55:12 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: nfs_vnops.c,v 1.306.2.1 2015/05/19 04:56:45 snj Exp $ */
+/* $NetBSD: nfs_vnops.c,v 1.306.2.1.2.1 2016/02/06 20:55:12 snj Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.306.2.1 2015/05/19 04:56:45 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.306.2.1.2.1 2016/02/06 20:55:12 snj Exp $");
#ifdef _KERNEL_OPT
#include "opt_nfs.h"
@@ -954,18 +954,11 @@ dorpc:
if (NFS_CMPFH(np, fhp, fhsize)) {
/*
- * as we handle "." lookup locally, this should be
+ * As we handle "." lookup locally, this is
* a broken server.
*/
- vref(dvp);
- newvp = dvp;
-#ifndef NFS_V2_ONLY
- if (v3) {
- nfsm_postop_attr(newvp, attrflag, 0);
- nfsm_postop_attr(dvp, attrflag, 0);
- } else
-#endif
- nfsm_loadattr(newvp, (struct vattr *)0, 0);
+ m_freem(mrep);
+ return EBADRPC;
} else if (flags & ISDOTDOT) {
/*
* ".." lookup