All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jérémy Jean" <Jeremy.Jean@oss.cyber.gouv.fr>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH ipsec v2 3/7] xfrm: esp: use the current sequence number for AAD and offload
Date: Mon, 09 Nov 2026 14:27:11 +0000	[thread overview]
Message-ID: <sashiko-outbox-205096@kernel.org> (raw)
In-Reply-To: <20261108142652.1330952-4-Jeremy.Jean@oss.cyber.gouv.fr>

> When a GSO packet is split in software, esp_xmit() and esp6_xmit()
> advance xo->seq before software encryption or the handoff to the NIC.
> If the 64-bit sequence number of the segment is (H, 0xffffffff), the
> counter becomes (H+1, 0). Both the software ESN helpers and drivers
> such as Chelsio then use H+1 instead of H as part of the associated
> data that is authenticated.
> 
> However, the ESN 32 high bits are not present in the ESP header: the
> receiver reconstructs the 64-bit value from the received 32 low bits
> and its own replay state, and uses it to check cryptographic
> integrity. It uses H for this packet at the boundary, so the GCM tag
> computed by the sender with H+1 fails verification, as it is different
> from the one obtained by the receiver using H.
> 
> Use the high bits saved in esp->seqno for the software AAD. For
> hardware encryption, restore the current sequence after skb_ext_add()
> makes the secpath private, leaving the shared counter advanced for
> the remaining segments. Restore both halves because drivers can also
> use xo->seq to generate the IV.
> 
> Fixes: 3dca3f38cfb8 ("xfrm: Separate ESP handling from segmentation for GRO packets.")
> Fixes: 4b549ccce941 ("xfrm: replay: Fix ESN wrap around for GSO")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jérémy Jean <Jeremy.Jean@oss.cyber.gouv.fr>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261108142652.1330952-1-Jeremy.Jean@oss.cyber.gouv.fr?part=3


  reply	other threads:[~2026-11-09 14:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08 14:26 [PATCH ipsec v2 0/7] xfrm: fix ESP IV generation and ESN authentication Jérémy Jean
2026-11-08 14:26 ` [PATCH ipsec v2 1/7] xfrm: esp6: use the current sequence number for the IV Jérémy Jean
2026-11-09 14:27   ` sashiko-bot
2026-11-12 10:14   ` Usman Malik
2026-11-08 14:26 ` [PATCH ipsec v2 2/7] xfrm: esp4: " Jérémy Jean
2026-11-09 14:27   ` sashiko-bot
2026-11-08 14:26 ` [PATCH ipsec v2 3/7] xfrm: esp: use the current sequence number for AAD and offload Jérémy Jean
2026-11-09 14:27   ` sashiko-bot [this message]
2026-11-09 15:08   ` netdev-bot+sashiko
2026-11-08 14:26 ` [PATCH ipsec v2 4/7] xfrm: prevent AES-GCM nonce reuse after early GSO Jérémy Jean
2026-11-09 14:27   ` sashiko-bot
2026-11-09 15:08   ` netdev-bot+sashiko
2026-11-12 10:15   ` Usman Malik
2026-11-08 14:26 ` [PATCH ipsec v2 5/7] net/mlx5e: Use the packet sequence number for the IPsec IV Jérémy Jean
2026-11-09 14:27   ` sashiko-bot
2026-11-12 12:03   ` Tariq Toukan
2026-11-08 14:26 ` [PATCH ipsec v2 6/7] xfrm: segment untrusted GSO packets before sequence allocation Jérémy Jean
2026-11-09 14:27   ` sashiko-bot
2026-11-09 15:08   ` netdev-bot+sashiko
2026-11-08 14:26 ` [PATCH ipsec v2 7/7] xfrm: leave the sequence counter unchanged on ESN overflow Jérémy Jean
2026-11-09 14:27   ` sashiko-bot
2026-11-08 14:32 ` [PATCH ipsec v2 0/7] xfrm: fix ESP IV generation and ESN authentication netdev-bot+sinfo

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=sashiko-outbox-205096@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Jeremy.Jean@oss.cyber.gouv.fr \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.