From: J. Bruce Fields Date: Tue, 21 Apr 2015 19:25:39 +0000 (-0400) Subject: nfsd4: disallow SEEK with special stateids X-Git-Tag: v3.19.7~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3d6135d6b83abca927ded331d252a2d59c25901;p=thirdparty%2Fkernel%2Fstable.git nfsd4: disallow SEEK with special stateids commit 980608fb50aea34993ba956b71cd4602aa42b14b upstream. 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 Reported-by: Christoph Hellwig Signed-off-by: J. Bruce Fields Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index a1370084f41c8..2cd2d64ff1e8e 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1069,6 +1069,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: