From: Steffen Klassert <steffen.klassert@secunet.com>
To: Paul Davey <paul.davey@alliedtelesis.co.nz>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>
Subject: Re: [PATCH net] xfrm: Preserve vlan tags for transport mode software GRO
Date: Mon, 22 Apr 2024 11:56:09 +0200 [thread overview]
Message-ID: <ZiY0Of0QuDOCPXHg@gauss3.secunet.de> (raw)
In-Reply-To: <20240422025711.145577-1-paul.davey@alliedtelesis.co.nz>
On Mon, Apr 22, 2024 at 02:56:20PM +1200, Paul Davey wrote:
> The software GRO path for esp transport mode uses skb_mac_header_rebuild
> prior to re-injecting the packet via the xfrm_napi_dev. This only
> copies skb->mac_len bytes of header which may not be sufficient if the
> packet contains 802.1Q tags or other VLAN tags. Worse copying only the
> initial header will leave a packet marked as being VLAN tagged but
> without the corresponding tag leading to mangling when it is later
> untagged.
>
> The VLAN tags are important when receiving the decrypted esp transport
> mode packet after GRO processing to ensure it is received on the correct
> interface.
>
> Therefore record the full mac header length in xfrm*_transport_input for
> later use in correpsonding xfrm*_transport_finish to copy the entire mac
> header when rebuilding the mac header for GRO. The skb->data pointer is
> left pointing skb->mac_header bytes after the start of the mac header as
> is expected by the network stack and network and transport header
> offsets reset to this location.
>
> Signed-off-by: Paul Davey <paul.davey@alliedtelesis.co.nz>
Please add a 'Fixes:' tag so it can be backported to stable.
> diff --git a/include/net/xfrm.h b/include/net/xfrm.h
> index 57c743b7e4fe..0331cfecb28b 100644
> --- a/include/net/xfrm.h
> +++ b/include/net/xfrm.h
> @@ -675,6 +675,9 @@ struct xfrm_mode_skb_cb {
>
> /* Used by IPv6 only, zero for IPv4. */
> u8 flow_lbl[3];
> +
> + /* Used to keep whole l2 header for transport mode GRO */
> + u32 orig_mac_len;
xfrm_mode_skb_cb has already reached the maximum size of 48 bytes.
Adding more will overwrite data in the 'struct sk_buff'.
Try to store this in 'struct xfrm_offload'.
Thanks!
next prev parent reply other threads:[~2024-04-22 9:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-22 2:56 [PATCH net] xfrm: Preserve vlan tags for transport mode software GRO Paul Davey
2024-04-22 9:56 ` Steffen Klassert [this message]
2024-04-22 12:49 ` Sabrina Dubroca
2024-04-22 16:11 ` Steffen Klassert
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=ZiY0Of0QuDOCPXHg@gauss3.secunet.de \
--to=steffen.klassert@secunet.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
--cc=paul.davey@alliedtelesis.co.nz \
/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;
as well as URLs for NNTP newsgroup(s).