Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Nov 2011 00:10:11 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r227494 - head/sys/fs/nfsclient
Message-ID:  <201111140010.pAE0ABvg014645@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmacklem
Date: Mon Nov 14 00:10:11 2011
New Revision: 227494
URL: http://svn.freebsd.org/changeset/base/227494

Log:
  Since NFSv4 byte range locking only works for regular files,
  add a sanity check for the vnode type to the NFSv4 client.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clvnops.c

Modified: head/sys/fs/nfsclient/nfs_clvnops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvnops.c	Sun Nov 13 23:09:26 2011	(r227493)
+++ head/sys/fs/nfsclient/nfs_clvnops.c	Mon Nov 14 00:10:11 2011	(r227494)
@@ -2941,6 +2941,8 @@ nfs_advlock(struct vop_advlock_args *ap)
 	u_quad_t size;
 	
 	if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) {
+		if (vp->v_type != VREG)
+			return (EINVAL);
 		if ((ap->a_flags & F_POSIX) != 0)
 			cred = p->p_ucred;
 		else



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