lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZiY0Of0QuDOCPXHg@gauss3.secunet.de>
Date: Mon, 22 Apr 2024 11:56:09 +0200
From: Steffen Klassert <steffen.klassert@...unet.com>
To: Paul Davey <paul.davey@...iedtelesis.co.nz>
CC: Herbert Xu <herbert@...dor.apana.org.au>, "David S. Miller"
	<davem@...emloft.net>, <netdev@...r.kernel.org>
Subject: Re: [PATCH net] xfrm: Preserve vlan tags for transport mode software
 GRO

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@...iedtelesis.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!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ