From: netdev-bot+sashiko@kernel.org
To: astellman@stellman-greene.com
Cc: dhowells@redhat.com, marc.dionne@auristor.com,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, horms@kernel.org,
linux-afs@lists.infradead.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] rxrpc: Fix RxGK server to reject an expired ticket
Date: Fri, 20 Nov 2026 19:05:24 +0000 [thread overview]
Message-ID: <179520152436.3135.2656252511958141770@kernel.org> (raw)
In-Reply-To: <20261119184541.26343-1-astellman@stellman-greene.com>
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
prev parent reply other threads:[~2026-11-20 19:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 18:45 [PATCH net] rxrpc: Fix RxGK server to reject an expired ticket Andrew Stellman
2026-11-20 19:05 ` netdev-bot+sashiko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179520152436.3135.2656252511958141770@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=astellman@stellman-greene.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.dionne@auristor.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox