Re: [PATCH net] rxrpc: Fix RxGK server to reject an expired ticket
From: netdev-bot+sashiko
Date: Fri Nov 20 2026 - 14:05:51 EST
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.
Critical: 0 · High: 0 · Medium: 1 · Low: 0
If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).
- [Medium] rxrpc: rxgk_yfs_decode_ticket() misses negative and epoch-
truncated expiries
--
> diff --git a/net/rxrpc/rxgk_app.c b/net/rxrpc/rxgk_app.c
> --- a/net/rxrpc/rxgk_app.c
> +++ b/net/rxrpc/rxgk_app.c
> @@ -147,6 +147,13 @@ int rxgk_yfs_decode_ticket(struct rxrpc_connection *conn, struct sk_buff *skb,
> if (ret < 0)
> goto error_key;
>
> + ret = key_validate(key);
> + if (ret < 0) {
> + ret = rxrpc_abort_conn(conn, skb, RXGK_EXPIRED, ret,
> + rxgk_abort_resp_tok_expired);
> + goto error_key;
> + }
> +
> token = key->payload.data[0];
> token->no_leak_key = true;
> *_key = key;
>
[Severity: Medium]
This check only works when the ticket's expirationtime turns into a
positive number of seconds in key->expiry. Two cases get past it.
First, if expirationtime is at least one second before 1970-01-01,
rxrpc_s64_to_time64() returns a negative value. In that case
rxrpc_preparse_xdr_yfs_rxgk() jumps to its expired label, so
key_instantiate_and_link() itself fails with -EKEYEXPIRED. That error
takes the existing "if (ret < 0) goto error_key" just above and never
reaches the new rxrpc_abort_conn() call.
Back in rxgk_extract_token(), the cant_get_token switch only handles
-ENOMEM, -EINVAL and -ENOPKG. -EKEYEXPIRED falls through to
temporary_error, so the RESPONSE is quietly ignored instead of the
connection being aborted with RXGK_EXPIRED. The connection is left
sitting in the challenging state as if the error were transient.
Second, a non-zero endtime within one second of the epoch, in either
direction, is truncated to 0 by rxrpc_s64_to_time64(). The "expiry <
0" test in rxrpc_preparse_xdr_yfs_rxgk() lets that through, so
key->expiry ends up as 0. key_validate() treats 0 as "never expires",
so this expired ticket is accepted.
Both cases need a ticket encrypted with the server key, so they are
edge cases. Still, the point of the patch is to reject expired
tickets.
Would it be better to also map -EKEYEXPIRED from
key_instantiate_and_link() to the RXGK_EXPIRED abort? That could be
done here or in the cant_get_token switch. Separately, a non-zero
endtime that truncates to 0 could be treated as expired in
rxrpc_preparse_xdr_yfs_rxgk(). Alternatively, the ticket's endtime
could be compared directly against the current time here rather than
going through key->expiry. Which approach do you prefer?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119184541.26343-1-astellman%40stellman-greene.com