Przeglądaj źródła

nfsd4: disallow SEEK with special stateids

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>
J. Bruce Fields 10 lat temu
rodzic
commit
980608fb50
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      fs/nfsd/nfs4proc.c

+ 2 - 0
fs/nfsd/nfs4proc.c

@@ -1071,6 +1071,8 @@ nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 		dprintk("NFSD: nfsd4_seek: couldn't process stateid!\n");
 		dprintk("NFSD: nfsd4_seek: couldn't process stateid!\n");
 		return status;
 		return status;
 	}
 	}
+	if (!file)
+		return nfserr_bad_stateid;
 
 
 	switch (seek->seek_whence) {
 	switch (seek->seek_whence) {
 	case NFS4_CONTENT_DATA:
 	case NFS4_CONTENT_DATA: