Skip to content

Commit 359ef12

Browse files
J. Bruce Fieldsksacilotto
authored andcommitted
SUNRPC: fix sign error causing rpcsec_gss drops
BugLink: https://bugs.launchpad.net/bugs/1951643 commit 2ba5acf upstream. 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: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 5f0ab1f commit 359ef12

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
@@ -643,7 +643,7 @@ static bool gss_check_seq_num(const struct svc_rqst *rqstp, struct rsc *rsci,
643643
}
644644
__set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win);
645645
goto ok;
646-
} else if (seq_num <= sd->sd_max - GSS_SEQ_WIN) {
646+
} else if (seq_num + GSS_SEQ_WIN <= sd->sd_max) {
647647
goto toolow;
648648
}
649649
if (__test_and_set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win))

0 commit comments

Comments
 (0)