浏览代码

nfsd41: nfsd4_decode_compound() does not recognize all ops

The server incorrectly assumes that the operations in the
array start with value 0.  The first operation (OP_ACCESS)
has a value of 3, causing the check in nfsd4_decode_compound
to be off.

Instead of comparing that the operation number is less than
the number of elements in the array, the server should verify
that it is less than the maximum valid operation number
defined by LAST_NFS4_OP.

Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Ricardo Labiaga 15 年之前
父节点
当前提交
c551866e64
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/nfsd/nfs4xdr.c

+ 1 - 1
fs/nfsd/nfs4xdr.c

@@ -1434,7 +1434,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
 		}
 		}
 		op->opnum = ntohl(*argp->p++);
 		op->opnum = ntohl(*argp->p++);
 
 
-		if (op->opnum >= OP_ACCESS && op->opnum < ops->nops)
+		if (op->opnum >= OP_ACCESS && op->opnum <= LAST_NFS4_OP)
 			op->status = ops->decoders[op->opnum](argp, &op->u);
 			op->status = ops->decoders[op->opnum](argp, &op->u);
 		else {
 		else {
 			op->opnum = OP_ILLEGAL;
 			op->opnum = OP_ILLEGAL;