Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-6-1]: src/sys/nfs Pull up following revision(s) (requested by han...



details:   https://anonhg.NetBSD.org/src/rev/eca2d6f982c1
branches:  netbsd-6-1
changeset: 776137:eca2d6f982c1
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Jul 14 06:55:08 2016 +0000

description:
Pull up following revision(s) (requested by hannken in ticket #1363):
        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

diffstat:

 sys/nfs/nfs_vnops.c |  17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diffs (40 lines):

diff -r bd39dcdc4eb4 -r eca2d6f982c1 sys/nfs/nfs_vnops.c
--- a/sys/nfs/nfs_vnops.c       Thu Jul 14 06:48:53 2016 +0000
+++ b/sys/nfs/nfs_vnops.c       Thu Jul 14 06:55:08 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_vnops.c,v 1.293.4.1 2012/08/12 12:59:48 martin Exp $       */
+/*     $NetBSD: nfs_vnops.c,v 1.293.4.1.6.1 2016/07/14 06:55:08 snj Exp $      */
 
 /*
  * Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.293.4.1 2012/08/12 12:59:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.293.4.1.6.1 2016/07/14 06:55:08 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -949,18 +949,11 @@
 
        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



Home | Main Index | Thread Index | Old Index