From 281fe15dc1d6ad46992f18b7a6644269ec5f7138 Mon Sep 17 00:00:00 2001 From: Benny Halevy Date: Wed, 1 Apr 2009 09:23:27 -0400 Subject: nfs41: verify CB_SEQUENCE position in callback compound CB_SEQUENCE must appear first in the callback compound RPC. If it is not the first operation NFS4ERR_SEQUENCE_POS must be returned. If the first operation ni the CB_COMPOUND is not CB_SEQUENCE then NFS4ERR_OP_NOT_IN_SESSION must be returned. Signed-off-by: Ricardo Labiaga Signed-off-by: Benny Halevy [nfs41: refactor op preprocessing out of process_op] Signed-off-by: Benny Halevy --- fs/nfs/callback_xdr.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'fs/nfs/callback_xdr.c') diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 56a3cc510107..537f21da6e5f 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c @@ -521,6 +521,14 @@ out: static __be32 preprocess_nfs41_op(int nop, unsigned int op_nr, struct callback_op **op) { + if (op_nr == OP_CB_SEQUENCE) { + if (nop != 0) + return htonl(NFS4ERR_SEQUENCE_POS); + } else { + if (nop == 0) + return htonl(NFS4ERR_OP_NOT_IN_SESSION); + } + switch (op_nr) { case OP_CB_GETATTR: case OP_CB_RECALL: -- cgit v1.2.3-55-g7522