FAILED: patch "[PATCH] mac80211: properly handle A-MSDUs that start with an RFC 1042" failed to apply to 4.14-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a1d5ff5651ea592c67054233b14b30bf4452999c Mon Sep 17 00:00:00 2001
From: Mathy Vanhoef <[email protected]>
Date: Tue, 11 May 2021 20:02:44 +0200
Subject: [PATCH] mac80211: properly handle A-MSDUs that start with an RFC 1042
header
Properly parse A-MSDUs whose first 6 bytes happen to equal a rfc1042 header. This can occur in practice when the destination MAC address equals AA:AA:03:00:00:00. More importantly, this simplifies the next patch to mitigate A-MSDU injection attacks.
include/net/cfg80211.h +2 -2
@@ -5760,7 +5760,7 @@ unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr);*/ int ieee80211_data_to_8023_exthdr (struct sk_buff *skb,struct ethhdr *ehdr,const u8 *addr,enum nl80211_iftype iftype, -u8 data_offset); +u8 data_offset,bool is_amsdu);/** * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3
@@ -5772,7 +5772,7 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,static inline int ieee80211_data_to_8023 (struct sk_buff *skb,const u8 *addr,enum nl80211_iftype iftype) { -return ieee80211_data_to_8023_exthdr (skb,NULL , addr, iftype,0 ); +return ieee80211_data_to_8023_exthdr (skb,NULL , addr, iftype,0 , false); }/**
net/mac80211/rx.c +1 -1
@@ -2682,7 +2682,7 @@ __ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset)if (ieee80211_data_to_8023_exthdr (skb, ðhdr, rx->sdata->vif.addr, rx->sdata->vif.type, - data_offset)) + data_offset, true))return RX_DROP_UNUSABLE ; ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr,
net/wireless/util.c +2 -2
@@ -542,7 +542,7 @@ EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen);int ieee80211_data_to_8023_exthdr (struct sk_buff *skb,struct ethhdr *ehdr,const u8 *addr,enum nl80211_iftype iftype, -u8 data_offset) +u8 data_offset,bool is_amsdu) {struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;struct {
@@ -629,7 +629,7 @@ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,skb_copy_bits (skb, hdrlen, &payload,sizeof (payload)); tmp.h_proto = payload.proto; -if (likely ((ether_addr_equal (payload.hdr, rfc1042_header) && +if (likely ((!is_amsdu &ðer_addr_equal (payload.hdr, rfc1042_header) && tmp.h_proto !=htons (ETH_P_AARP ) && tmp.h_proto !=htons (ETH_P_IPX )) ||ether_addr_equal (payload.hdr, bridge_tunnel_header)))