Skip to content

Commit 2ba5acf

Browse files
J. Bruce Fieldschucklever
authored andcommitted
SUNRPC: fix sign error causing rpcsec_gss drops
If sd_max is unsigned, then sd_max - GSS_SEQ_WIN is a very large number whenever sd_max is less than GSS_SEQ_WIN, and the comparison: seq_num <= sd->sd_max - GSS_SEQ_WIN in gss_check_seq_num is pretty much always true, even when that's clearly not what was intended. This was causing pynfs to hang when using krb5, because pynfs uses zero as the initial gss sequence number. That's perfectly legal, but this logic error causes knfsd to drop the rpc in that case. Out-of-order sequence IDs in the first GSS_SEQ_WIN (128) calls will also cause this. Fixes: 10b9d99 ("SUNRPC: Augment server-side rpcgss tracepoints") Cc: [email protected] Signed-off-by: J. Bruce Fields <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent 1959814 commit 2ba5acf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sunrpc/auth_gss/svcauth_gss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ static bool gss_check_seq_num(const struct svc_rqst *rqstp, struct rsc *rsci,
645645
}
646646
__set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win);
647647
goto ok;
648-
} else if (seq_num <= sd->sd_max - GSS_SEQ_WIN) {
648+
} else if (seq_num + GSS_SEQ_WIN <= sd->sd_max) {
649649
goto toolow;
650650
}
651651
if (__test_and_set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win))

0 commit comments

Comments
 (0)