Skip to content

Commit 9c19b33

Browse files
njha-jsAnna Schumaker
authored andcommitted
sunrpc: fix loop in gss seqno cache
There was a silly bug in the initial implementation where a loop variable was not incremented. This commit increments the loop variable. This bug is somewhat tricky to catch because it can only happen on loops of two or more. If it is hit, it locks up a kernel thread in an infinite loop. Signed-off-by: Nikhil Jha <[email protected]> Tested-by: Nikhil Jha <[email protected]> Fixes: 08d6ee6 ("sunrpc: implement rfc2203 rpcsec_gss seqnum cache") Reviewed-by: Benjamin Coddington <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 86731a2 commit 9c19b33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/auth_gss/auth_gss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1724,7 +1724,7 @@ gss_validate(struct rpc_task *task, struct xdr_stream *xdr)
17241724
maj_stat = gss_validate_seqno_mic(ctx, task->tk_rqstp->rq_seqnos[0], seq, p, len);
17251725
/* RFC 2203 5.3.3.1 - compute the checksum of each sequence number in the cache */
17261726
while (unlikely(maj_stat == GSS_S_BAD_SIG && i < task->tk_rqstp->rq_seqno_count))
1727-
maj_stat = gss_validate_seqno_mic(ctx, task->tk_rqstp->rq_seqnos[i], seq, p, len);
1727+
maj_stat = gss_validate_seqno_mic(ctx, task->tk_rqstp->rq_seqnos[i++], seq, p, len);
17281728
if (maj_stat == GSS_S_CONTEXT_EXPIRED)
17291729
clear_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags);
17301730
if (maj_stat)

0 commit comments

Comments
 (0)