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: <20240801182228.GY1967603@kernel.org>
Date: Thu, 1 Aug 2024 19:22:28 +0100
From: Simon Horman <horms@...nel.org>
To: Tom Herbert <tom@...bertland.com>
Cc: davem@...emloft.net, kuba@...nel.org, edumazet@...gle.com,
	netdev@...r.kernel.org, felipe@...anda.io
Subject: Re: [PATCH 07/12] flow_dissector: Parse vxlan in UDP

On Wed, Jul 31, 2024 at 10:23:27AM -0700, Tom Herbert wrote:
> Parse vxlan in a UDP encapsulation
> 
> Signed-off-by: Tom Herbert <tom@...bertland.com>
> ---
>  net/core/flow_dissector.c | 57 +++++++++++++++++++++++++++++++++++++++
>  1 file changed, 57 insertions(+)
> 
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c

...

> @@ -756,6 +758,55 @@ __skb_flow_dissect_gre(const struct sk_buff *skb,
>  	return FLOW_DISSECT_RET_PROTO_AGAIN;
>  }
>  
> +static enum flow_dissect_ret
> +__skb_flow_dissect_vxlan(const struct sk_buff *skb,
> +			 struct flow_dissector *flow_dissector,
> +			 void *target_container, const void *data,
> +			 __be16 *p_proto, int *p_nhoff, int hlen,
> +			 unsigned int flags)
> +{
> +	struct vxlanhdr *hdr, _hdr;
> +	__be16 protocol;
> +
> +	hdr = __skb_header_pointer(skb, *p_nhoff, sizeof(_hdr), data, hlen,
> +				   &_hdr);
> +	if (!hdr)
> +		return FLOW_DISSECT_RET_OUT_BAD;
> +
> +	/* VNI flag always required to be set */
> +	if (!(hdr->vx_flags & VXLAN_HF_VNI))
> +		return FLOW_DISSECT_RET_OUT_BAD;
> +
> +	if (hdr->vx_flags & VXLAN_F_GPE) {

Hi Tom,

Sparse flags an byte-order miss match on the line above.
I expect this would resolve it (completely untested!):

	if (hdr->vx_flags & cpu_to_be32(VXLAN_F_GPE))

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ