From: Sabrina Dubroca <sd@queasysnail.net>
To: Sung Byeongchan <tjdqudcks0424@naver.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net] macsec: reject frames after receive PN exhaustion
Date: Wed, 14 Oct 2026 15:39:02 +0200 [thread overview]
Message-ID: <as-F9pXfjTnpAR3r@krikkit> (raw)
In-Reply-To: <20261009135109.718408-1-tjdqudcks0424@naver.com>
2026-10-09, 22:51:08 +0900, Sung Byeongchan wrote:
> Track the exhausted state explicitly. Preserve the full recovered XPN in
> the skb control block so that the post-authentication path can identify the
> full-width terminal value. Deliver the valid terminal frame once, mark the
> RXSA exhausted under its lock, and reject later frames. Clear the state
> when the receive SA is initialized or its PN is explicitly reset, and
> restore it if an offload update fails.
>
> The unmodified kernel accepted a post-terminal authenticated frame in three
> fresh boots for both non-XPN and XPN. With this change, the terminal frame
> was delivered once and every post-terminal frame was dropped in three fresh
> boots. Lower-word XPN wrap, replay-window, bad-ICV, reset, replacement,
> and concurrent-duplicate controls continued to pass.
Even after understanding the actual code, I can barely follow those 2
paragraphs. Please make your LLM write in a less obfuscated style (and
also not describe the patch line-by-line).
> @@ -744,6 +745,15 @@ static bool macsec_post_decrypt(struct sk_buff *skb, struct macsec_secy *secy, u
> u32 lowest_pn = 0;
>
> spin_lock(&rx_sa->lock);
> + if (rx_sa->exhausted) {
That's not reasonable. Now we will reject "delayed" packets that would
fall in the replay window.
nit: the style in this patch is also not nice:
> + spin_unlock(&rx_sa->lock);
> + u64_stats_update_begin(&rxsc_stats->syncp);
> + rxsc_stats->stats.InPktsLate++;
> + u64_stats_update_end(&rxsc_stats->syncp);
> + DEV_STATS_INC(secy->netdev, rx_dropped);
> + return false;
duplication of this big stats block
> + if ((!secy->xpn && pn == U32_MAX) ||
> + (secy->xpn && macsec_skb_cb(skb)->xpn_pn.full64 == U64_MAX)) {
bool exhausted = secy->xpn ? pn64 == U64_MAX : pn32 == U32_MAX;
--
pw-bot: cr
prev parent reply other threads:[~2026-10-14 13:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 13:51 [PATCH net] macsec: reject frames after receive PN exhaustion Sung Byeongchan
2026-10-09 13:54 ` netdev-bot+sinfo
2026-10-14 13:39 ` Sabrina Dubroca [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=as-F9pXfjTnpAR3r@krikkit \
--to=sd@queasysnail.net \
--cc=netdev@vger.kernel.org \
--cc=tjdqudcks0424@naver.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