On Nov 18, Felix Fietkau wrote: > On 18.11.26 09:43, Lorenzo Bianconi wrote: > > > mt76_rx_release_amsdu() reads the first subframe relative to > > > skb->data, which points to the radiotap data where the driver pushed HE > > > fields or EHT TLVs. It then misses an RFC1042 header in place of the > > > destination address, so an A-MSDU of an HE or EHT PPDU in 802.11 format > > > passes the mitigation of CVE-2020-24588. > > > > > > Locate the subframe behind the header that mt76_skb_get_hdr() returns. > > > > > > Fixes: 2c2bdd2372af ("mt76: validate rx A-MSDU subframes") > > > Signed-off-by: Felix Fietkau > > > --- > > > drivers/net/wireless/mediatek/mt76/mac80211.c | 11 +++++++---- > > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > > > diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c > > > index bd822193e769..271fbd4711f7 100644 > > > --- a/drivers/net/wireless/mediatek/mt76/mac80211.c > > > +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c > > > @@ -965,18 +965,21 @@ static void mt76_rx_release_amsdu(struct mt76_phy *phy, enum mt76_rxq_id q) > > > * address. > > > */ > > > if (skb_shinfo(skb)->frag_list) { > > > - int offset = 0; > > > + u8 *subframe = skb->data; > > > if (!(status->flag & RX_FLAG_8023)) { > > > - offset = ieee80211_get_hdrlen_from_skb(skb); > > > + struct ieee80211_hdr *hdr = mt76_skb_get_hdr(skb); > > > + > > > + subframe = (u8 *)hdr + > > > + ieee80211_hdrlen(hdr->frame_control); > > > if ((status->flag & > > > (RX_FLAG_DECRYPTED | RX_FLAG_IV_STRIPPED)) == > > > RX_FLAG_DECRYPTED) > > > - offset += 8; > > > + subframe += 8; > > > } > > > - if (ether_addr_equal(skb->data + offset, rfc1042_header)) { > > > + if (ether_addr_equal(subframe, rfc1042_header)) { > > > > maybe I am too paranoic, but should we check this is part of the skb head > > running pskb_may_pull()? Otherwise I am fine with the patch. > This is only called for hw-deaggregated A-MSDU subframes, and each subframe > has its own buffer. Even if the hardware were to misbehave and pass a > truncated subframe here, the pointer would still be much closer to the start > of the buffer than the end, and never overflow. ack, in this case: Reviewed-by: Lorenzo Bianconi > > - Felix