diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-11-14 00:10:11 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-11-14 00:10:11 +0000 |
commit | 7b1ccd71f2daeaf22349b2805db65aad5af33040 (patch) | |
tree | 3e420f270799b7da6d29fbbdf7ac197097553f82 | |
parent | 7ec76cbdce92f37cf3b1dc3c2744ac8e00f87667 (diff) | |
download | FreeBSD-src-7b1ccd71f2daeaf22349b2805db65aad5af33040.zip FreeBSD-src-7b1ccd71f2daeaf22349b2805db65aad5af33040.tar.gz |
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
-rw-r--r-- | sys/fs/nfsclient/nfs_clvnops.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 7e87b6e..ee3c8d9 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -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 |