aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2015-04-03 16:24:27 -0400
committerJ. Bruce Fields <bfields@redhat.com>2015-04-21 15:44:06 -0400
commit5ba4a25ab7b13be528b23f85182f4d09cf7f71ad (patch)
tree03b162597644cdb4e5321b2416a8922768f34017 /fs
parent9b3075c59f858d64478f46a15daa6ecda3cf2318 (diff)
nfsd4: disallow ALLOCATE with special stateids
vfs_fallocate will hit a NULL dereference if the client tries an ALLOCATE or DEALLOCATE with a special stateid. Fix that. (We also depend on the open to have broken any conflicting leases or delegations for us.) (If it turns out we need to allow special stateid's then we could do a temporary open here in the special-stateid case, as we do for read and write. For now I'm assuming it's not necessary.) Fixes: 95d871f03cae "nfsd: Add ALLOCATE support" Cc: stable@vger.kernel.org Cc: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4proc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index b401da386604..d0848fc6529e 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1030,6 +1030,8 @@ nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
1030 dprintk("NFSD: nfsd4_fallocate: couldn't process stateid!\n"); 1030 dprintk("NFSD: nfsd4_fallocate: couldn't process stateid!\n");
1031 return status; 1031 return status;
1032 } 1032 }
1033 if (!file)
1034 return nfserr_bad_stateid;
1033 1035
1034 status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, file, 1036 status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, file,
1035 fallocate->falloc_offset, 1037 fallocate->falloc_offset,