2023-07-11 11:57:14

by Felix Fietkau

[permalink] [raw]
Subject: [PATCH wireless] wifi: cfg80211: fix receving mesh packets without RFC1042 header

Fix ethernet header length field after stripping the mesh header

Cc: [email protected]
Link: https://lore.kernel.org/all/CT5GNZSK28AI.2K6M69OXM9RW5@syracuse/
Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
Reported-by: Nicolas Escande <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
---
net/wireless/util.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 89c9ad6c886e..1783ab9d57a3 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -580,6 +580,8 @@ int ieee80211_strip_8023_mesh_hdr(struct sk_buff *skb)
hdrlen += ETH_ALEN + 2;
else if (!pskb_may_pull(skb, hdrlen))
return -EINVAL;
+ else
+ payload.eth.h_proto = htons(skb->len - hdrlen);

mesh_addr = skb->data + sizeof(payload.eth) + ETH_ALEN;
switch (payload.flags & MESH_FLAGS_AE) {
--
2.41.0



2023-07-11 12:27:45

by Nicolas Escande

[permalink] [raw]
Subject: Re: [PATCH wireless] wifi: cfg80211: fix receving mesh packets without RFC1042 header

On Tue Jul 11, 2023 at 1:50 PM CEST, Felix Fietkau wrote:
> Fix ethernet header length field after stripping the mesh header
>
> Cc: [email protected]
> Link: https://lore.kernel.org/all/CT5GNZSK28AI.2K6M69OXM9RW5@syracuse/
> Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
> Reported-by: Nicolas Escande <[email protected]>
> Signed-off-by: Felix Fietkau <[email protected]>
> ---
> net/wireless/util.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/wireless/util.c b/net/wireless/util.c
> index 89c9ad6c886e..1783ab9d57a3 100644
> --- a/net/wireless/util.c
> +++ b/net/wireless/util.c
> @@ -580,6 +580,8 @@ int ieee80211_strip_8023_mesh_hdr(struct sk_buff *skb)
> hdrlen += ETH_ALEN + 2;
> else if (!pskb_may_pull(skb, hdrlen))
> return -EINVAL;
> + else
> + payload.eth.h_proto = htons(skb->len - hdrlen);
>
> mesh_addr = skb->data + sizeof(payload.eth) + ETH_ALEN;
> switch (payload.flags & MESH_FLAGS_AE) {

I tested this on my side and everything works again, so if you want/need it:

Tested-by: Nicolas Escande <[email protected]>

2023-07-13 01:04:38

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH wireless] wifi: cfg80211: fix receving mesh packets without RFC1042 header

On Tue, 11 Jul 2023 13:50:52 +0200 Felix Fietkau wrote:
> Fix ethernet header length field after stripping the mesh header
>
> Cc: [email protected]
> Link: https://lore.kernel.org/all/CT5GNZSK28AI.2K6M69OXM9RW5@syracuse/
> Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
> Reported-by: Nicolas Escande <[email protected]>
> Signed-off-by: Felix Fietkau <[email protected]>

Applied, thanks!