diff mbox series

[wireless] wifi: cfg80211: fix receving mesh packets without RFC1042 header

Message ID 20230711115052.68430-1-nbd@nbd.name (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series [wireless] wifi: cfg80211: fix receving mesh packets without RFC1042 header | expand

Commit Message

Felix Fietkau July 11, 2023, 11:50 a.m. UTC
Fix ethernet header length field after stripping the mesh header

Cc: stable@vger.kernel.org
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 <nico.escande@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/wireless/util.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Nicolas Escande July 11, 2023, 12:21 p.m. UTC | #1
On Tue Jul 11, 2023 at 1:50 PM CEST, Felix Fietkau wrote:
> Fix ethernet header length field after stripping the mesh header
>
> Cc: stable@vger.kernel.org
> 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 <nico.escande@gmail.com>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
>  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 <nico.escande@gmail.com>
Jakub Kicinski July 13, 2023, 1:03 a.m. UTC | #2
On Tue, 11 Jul 2023 13:50:52 +0200 Felix Fietkau wrote:
> Fix ethernet header length field after stripping the mesh header
> 
> Cc: stable@vger.kernel.org
> 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 <nico.escande@gmail.com>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

Applied, thanks!
diff mbox series

Patch

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) {