Skip to content

Commit

Permalink
nfs41: verify CB_SEQUENCE position in callback compound
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Benny Halevy <[email protected]>
[nfs41: refactor op preprocessing out of process_op]
Signed-off-by: Benny Halevy <[email protected]>
  • Loading branch information
Benny Halevy committed Jun 17, 2009
1 parent 4aece6a commit 281fe15
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/nfs/callback_xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,14 @@ static unsigned encode_cb_sequence_res(struct svc_rqst *rqstp,
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:
Expand Down

0 comments on commit 281fe15

Please sign in to comment.