Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Sep 2018 00:53:58 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r338900 - projects/nfsv42/sys/fs/nfsserver
Message-ID:  <201809240053.w8O0rwaV008275@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Mon Sep 24 00:53:57 2018
New Revision: 338900
URL: https://svnweb.freebsd.org/changeset/base/338900

Log:
  Add a sanity check for v_type == VREG to the NFSv4.2 IO Advise operation.

Modified:
  projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c

Modified: projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c
==============================================================================
--- projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c	Sun Sep 23 19:00:06 2018	(r338899)
+++ projects/nfsv42/sys/fs/nfsserver/nfs_nfsdserv.c	Mon Sep 24 00:53:57 2018	(r338900)
@@ -4829,6 +4829,13 @@ nfsrvd_ioadvise(struct nfsrv_descript *nd, __unused in
 	}
 	if (len < 0)
 		len = 0;
+	if (vp->v_type != VREG) {
+		if (vp->v_type == VDIR)
+			nd->nd_repstat = NFSERR_ISDIR;
+		else
+			nd->nd_repstat = NFSERR_WRONGTYPE;
+		goto nfsmout;
+	}
 
 	/*
 	 * For now, we can only handle WILLNEED and DONTNEED and don't use



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