summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2015-04-21 15:25:39 -0400
committerSasha Levin <sasha.levin@oracle.com>2015-05-17 19:12:26 -0400
commit61c8c52ced763e16f2c1482ee5a7f4e162c5c4ca (patch)
tree0e8c0f6e05994379e7a19123d38d11ee8e42cc0e
parent5a9fb83ea5da6f96708e88e39d352730a02fc8b0 (diff)
downloadlwn-61c8c52ced763e16f2c1482ee5a7f4e162c5c4ca.tar.gz
lwn-61c8c52ced763e16f2c1482ee5a7f4e162c5c4ca.zip
nfsd4: disallow SEEK with special stateids
[ Upstream commit 980608fb50aea34993ba956b71cd4602aa42b14b ] If the client uses a special stateid then we'll pass a NULL file to vfs_llseek. Fixes: 24bab491220f " NFSD: Implement SEEK" Cc: Anna Schumaker <Anna.Schumaker@Netapp.com> Cc: stable@vger.kernel.org Reported-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-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 0beb023f25ac..6ed585935d5e 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1028,6 +1028,8 @@ nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
dprintk("NFSD: nfsd4_seek: couldn't process stateid!\n");
return status;
}
+ if (!file)
+ return nfserr_bad_stateid;
switch (seek->seek_whence) {
case NFS4_CONTENT_DATA: