From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795985253; b=NCTXrkw9HJoNGs/cvldGNvREqwUlSuWFkhS3q4MEbr66q8yoT0T7STW1pdDTjfGO6jOx 0yGzkR7f0R9Jj9gTOjAUa274Wfy/BmAqwPY+X/R6XD2lVEa4vrGjIKMUeurs6PYcG43UR g/PbQwa0AAvbvlSRZq83JV8xuMM9wX9OpvgFuP3n9xpN98B9YtB470TSqyxBrEIV/S/pE iaE343A3l7wg5ozdVtvUGVExSAG9Ae5X84cDwpIc3npLl1GhzLd6UdacHqxGDr5CwIMYu wMypA1+vrxoEZNYPVavtXINfTuGs14C9iQYS0ik7HlREF98mn0S4Mog/C7rjoAGF94w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795985253; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=EHAs6AVGGd9PzZyg+JbHiPZ6GPqgvHmo5EcUb8wCBsE=; b=Cy4dTuve6pT728yXURFMbpmzgbqBUUGRwt3qzCG6aL2N1USVBFunsu9/m6wD3FX5ONdD VfytWeGPXdrKeGBP6nSkJW37zlEHOgHwuPx2VI9BT/8CWaKBF2QbWnSK62b4Sk1N51blE 5u65IxrDqdNAbtOTccN/6v5lHdkmAUkv+LSBhz0SsiZh0Oj28WOfOUgKU/EaQxfzsHzQp abaua1sCb1m0WrBng3lY3NBIGHqlc5g3HiXXb36jT47B5agjxuf2umjutDlmffNB7Wdhb FkdUWoNWUGhHAhk8kv/2dLsJO0nSQCACNdulrxhP2x8CKNaBre5Y4NuFV2VXD+eJDTw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TLErg8O0; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF0AE606A325; Sun, 29 Nov 2026 20:47:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=TLErg8O0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1FDE1F00897; Sun, 29 Nov 2026 20:47:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795985253; bh=EHAs6AVGGd9PzZyg+JbHiPZ6GPqgvHmo5EcUb8wCBsE=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=TLErg8O0HxXwtzZqRW1CcRI4moWDHscyx62BOXdYI1ELFFHsbqDpeM7Xf3CGVY2BE D6M53ICX/Xd5dbyGQgZi/UgIy0Vb6KlJ413ZrAJlivsyiddbqWnhhZINOFGdrXyc1O frxxVBsjzwX968k0TcEC6onz/NUewn/3xEhbmSLALpbVAhODXMVXtIa8dDTKYoqp9C 7plSOawtjjkiWBxaO8TEM/Ax6Oc7wb8yDeLiA3B6/+dfIrK5jkxwql4k7ApKJR754N d/eZCioraVYs9+DFHR4sO9IpWu8rLxRWpeqmaayBrNRDPe4WZWZIdJH4cnCcHqy/oi xJ6rSPJIeJlwA== Date: Sun, 29 Nov 2026 21:47:31 +0100 From: Lorenzo Bianconi To: Felix Fietkau Cc: linux-wireless@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH mt76-next 14/20] wifi: mt76: mt7921: drop RX frame with a header gap past its end Message-ID: References: <20261129193131.3367661-1-nbd@nbd.name> <20261129193131.3367661-14-nbd@nbd.name> X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5IBehEpEDy6MQEhj" Content-Disposition: inline In-Reply-To: <20261129193131.3367661-14-nbd@nbd.name> --5IBehEpEDy6MQEhj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Nov 29, Felix Fietkau wrote: > mt7921_mac_fill_rx() does not check hdr_gap against the linear data of > the skb. A frame of several DMA buffers is not linear, and the hardware > sets the length of the first buffer. If hdr_gap is too large, skb_pull() > hits the BUG() in __skb_pull(), or fails and leaves no headroom, so the > __skb_push() in mt76_insert_ccmp_hdr() writes before skb->head. >=20 > Drop the frame if hdr_gap is not within the linear data. >=20 > Fixes: 163f4d22c118 ("mt76: mt7921: add MAC support") > Cc: stable@vger.kernel.org > Signed-off-by: Felix Fietkau Reviewed-by: Lorenzo Bianconi > --- > drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/ne= t/wireless/mediatek/mt76/mt7921/mac.c > index 7f80ffbd278c..23bc0d946c56 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c > @@ -383,6 +383,9 @@ mt7921_mac_fill_rx(struct mt792x_dev *dev, struct sk_= buff *skb) > } > =20 > hdr_gap =3D (u8 *)rxd - skb->data + 2 * remove_pad; > + if (hdr_gap >=3D skb_headlen(skb)) > + return -EINVAL; > + > if (hdr_trans && ieee80211_has_morefrags(fc)) { > struct ieee80211_vif *vif; > int err; > --=20 > 2.47.3 >=20 >=20 --5IBehEpEDy6MQEhj Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTquNwa3Txd3rGGn7Y6cBh0uS2trAUCawyPYwAKCRA6cBh0uS2t rGd0AQD6Kt8lkfHu0ogz4X0OS7Czvw1Rz4aouexMe849bHdK9gD/Qo6iMLfyMafm 7n/oCn0W+geW3vmJcNHrZ0nCj1AjIgw= =6Ct1 -----END PGP SIGNATURE----- --5IBehEpEDy6MQEhj--