Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

+2 -1
+2 -1
fs/nfsd/nfs4proc.c
··· 1272 1272 */ 1273 1273 if (argp->opcnt == resp->opcnt) 1274 1274 return false; 1275 - 1275 + if (next->opnum == OP_ILLEGAL) 1276 + return false; 1276 1277 nextd = OPDESC(next); 1277 1278 /* 1278 1279 * Rest of 2.6.3.1.1: certain operations will return WRONGSEC