Skip to content

Commit 51904b0

Browse files
author
J. Bruce Fields
committed
nfsd4: fix crash on unknown operation number
Unknown operation numbers are caught in nfsd4_decode_compound() which sets op->opnum to OP_ILLEGAL and op->status to nfserr_op_illegal. The error causes the main loop in nfsd4_proc_compound() to skip most processing. But nfsd4_proc_compound also peeks ahead at the next operation in one case and doesn't take similar precautions there. Cc: [email protected] Signed-off-by: J. Bruce Fields <[email protected]>
1 parent d1d84c9 commit 51904b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/nfsd/nfs4proc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,8 @@ static bool need_wrongsec_check(struct svc_rqst *rqstp)
12721272
*/
12731273
if (argp->opcnt == resp->opcnt)
12741274
return false;
1275-
1275+
if (next->opnum == OP_ILLEGAL)
1276+
return false;
12761277
nextd = OPDESC(next);
12771278
/*
12781279
* Rest of 2.6.3.1.1: certain operations will return WRONGSEC

0 commit comments

Comments
 (0)