Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Felix Fietkau <nbd@nbd.name>
Cc: linux-wireless@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH mt76-next 12/20] wifi: mt76: connac: drop a first fragment without an Ethernet header
Date: Sun, 29 Nov 2026 21:43:14 +0100	[thread overview]
Message-ID: <awyOYvKF2EwuCAY5@lore-desk> (raw)
In-Reply-To: <20261129193131.3367661-12-nbd@nbd.name>

[-- Attachment #1: Type: text/plain, Size: 1519 bytes --]

> mt76_connac2_reverse_frag0_hdr_trans() reads an Ethernet header after
> hdr_offset, but does not check that the linear data of the skb holds
> one. A frame of several DMA buffers is not linear, and the hardware sets
> the length of the first buffer. For a shorter first buffer, skb_pull()
> hits the BUG() in __skb_pull(), or fails and leaves no headroom, so the
> skb_push() of the LLC header hits skb_under_panic().
> 
> Drop a first fragment whose linear data holds no full Ethernet header
> after the header gap.
> 
> Fixes: dc5399a50b45 ("mt76: reverse the first fragmented frame to 802.11")
> Cc: stable@vger.kernel.org
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

Reviewed-by: Lorenzo Bianconi <lorenzo@kernel.org>

> ---
>  drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
> index 6c2caade62d6..653d5162358e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
> @@ -976,6 +976,9 @@ int mt76_connac2_reverse_frag0_hdr_trans(struct ieee80211_vif *vif,
>  	struct ieee80211_hdr hdr;
>  	u16 frame_control;
>  
> +	if (skb_headlen(skb) < hdr_offset + sizeof(*eth_hdr))
> +		return -EINVAL;
> +
>  	if (le32_get_bits(rxd[3], MT_RXD3_NORMAL_ADDR_TYPE) !=
>  	    MT_RXD3_NORMAL_U2M)
>  		return -EINVAL;
> -- 
> 2.47.3
> 
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-11-29 20:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20261129193131.3367661-1-nbd@nbd.name>
2026-11-29 19:31 ` [PATCH mt76-next 11/20] wifi: mt76: mt7615: drop RX frame with a header gap past its end Felix Fietkau
2026-11-29 20:43   ` Lorenzo Bianconi
2026-11-29 19:31 ` [PATCH mt76-next 12/20] wifi: mt76: connac: drop a first fragment without an Ethernet header Felix Fietkau
2026-11-29 20:43   ` Lorenzo Bianconi [this message]
2026-11-29 19:31 ` [PATCH mt76-next 13/20] wifi: mt76: mt7915: drop RX frame with a header gap past its end Felix Fietkau
2026-11-29 20:47   ` Lorenzo Bianconi
2026-11-29 19:31 ` [PATCH mt76-next 14/20] wifi: mt76: mt7921: " Felix Fietkau
2026-11-29 20:47   ` Lorenzo Bianconi
2026-11-29 19:31 ` [PATCH mt76-next 15/20] wifi: mt76: mt7996: " Felix Fietkau
2026-11-29 20:51   ` Lorenzo Bianconi
2026-11-29 19:31 ` [PATCH mt76-next 16/20] wifi: mt76: mt7925: bound the header gap by the linear data of a frame Felix Fietkau
2026-11-29 20:45   ` Lorenzo Bianconi
2026-11-29 19:31 ` [PATCH mt76-next 17/20] wifi: mt76: mt7921: fix out-of-bounds read in mt7921_mac_add_txs Felix Fietkau
2026-11-29 20:42   ` Lorenzo Bianconi
2026-11-29 19:31 ` [PATCH mt76-next 18/20] wifi: mt76: mt7925: fix out-of-bounds read in mt7925_mac_add_txs Felix Fietkau
2026-11-29 20:41   ` Lorenzo Bianconi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=awyOYvKF2EwuCAY5@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=nbd@nbd.name \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox