Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=211.75.126.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796522689; b=ZrLKJDMzrLoT2nLv8uRV7kbrWpPna9Z+lMdtgCbU7PlMj14YlCqrOZqhwnqT1L3aI8Bp xVva5d80jKxsUVXGj4JPtosgGwxeG089T/7hdTc3iXzrMW7s3kaLXtXO4G0A+kYg5IQCC 4rf/fnUVU8MKXkfqhHGYloOpcVyClqfa4r39Tx10IZ4kvCqwvYYW8IaWnoBnCIzehUnEF xtKptaRR3/p82KcUp8lzorHNhw10BmZWw9wLxtCMRbIGLVUQEiJf3oBcuPmonn8rIl7SN SZM8mgShN69vo4Z1gZWm90id8ulmwR85dSVfT2BWlX1vXqQDJMcI/Us3Wp2Wm+fygnQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796522689; h=DMARC-Filter:X-SpamFilter-By:DKIM-Signature:Received:Received: Received:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID: References:In-Reply-To:Accept-Language:Content-Language: x-originating-ip:Content-Type:Content-Transfer-Encoding:MIME-Version; bh=nAVp7r792e8FM4Nr1eJCBmikdV/qIcEPAquMnpUJT5s=; b=WlCGRFvjWP6Pim6EATk4TZEKl0QWw58kFgMk2B5jUVZpo6nFNikQKJC9RC68F5AdJpka hhtbybSkClF+N+BzdEF2EVm6/LbREoeHlWjxktIA4K26LvBwCByi0zwvkre25UeiLm2yz np8Mp/83IG6MAre0Uu9ZnmoPOGv0JDxwL0EajXngUiTqk69qWsr5eucUPM54A8eRiy73K +Vj2/nLmhGQ50UJoJNYFiSpRVKSikXt/ZElsyM1H3i2cjMYCV6wzYdZF2V2A2DP65sTP3 ePYrchfcr9/pB+RzW2zz1e7bjrAs5b0vO++IkHcz5Uiu4jWMT2G2Ik6SYGTM1WLHTTw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; dkim=pass header.d=realtek.com header.i=@realtek.com header.a=rsa-sha256 header.s=dkim header.b="Bkq7/UfE"; arc=none smtp.remote-ip=211.75.126.72 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08FD4606A31F for ; Sun, 6 Dec 2026 02:04:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 08FD4606A31F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=realtek.com header.i=@realtek.com header.a=rsa-sha256 header.s=dkim header.b=Bkq7/UfE X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 6B624hMqA4037429, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realtek.com; s=dkim; t=1796522683; bh=nAVp7r792e8FM4Nr1eJCBmikdV/qIcEPAquMnpUJT5s=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:Content-Transfer-Encoding:MIME-Version; b=Bkq7/UfEafRPAl8pAcE/H80R4YTRLYHKiOgnQ+JKXRBJtMycaY3syKkt//9Y/aFHf I0NUIeGbAvp1Kaoifmbn/mLnfJk1dJaMsSE0iqW/AAp63MCvwAmwYHIvg9lVgHFrb5 rj2O8Am8ghB1UD5O+hnquQOBcr9EIDPkDwGbf96Rc5TcWsTEoyciMeurB6XInWcb8Z nYYe6l/1Erv3hxyyiavQKGzKyIwcWAefRHWgneMobTfBRqbLfZE/1We1cfBMOcTOCG Y6a16NjPd9RGTrML9K1gdDS0oT/JFUQdFgmE3NYIh+rn0UQGChK5qALlAyeQt6WQg1 SToopDUlIt8gg== Received: from mail.realtek.com (rtkexhmbs03.realtek.com.tw[10.21.1.53]) by rtits2.realtek.com.tw (8.15.2/3.29/5.94) with ESMTPS id 6B624hMqA4037429 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 6 Dec 2026 10:04:43 +0800 Received: from RTKEXHMBS06.realtek.com.tw (10.21.1.56) by RTKEXHMBS03.realtek.com.tw (10.21.1.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Sun, 6 Dec 2026 10:04:43 +0800 Received: from RTKEXHMBS06.realtek.com.tw ([fe80::eeeb:c765:ca73:5eef]) by RTKEXHMBS06.realtek.com.tw ([fe80::eeeb:c765:ca73:5eef%10]) with mapi id 15.02.2562.056; Sun, 6 Dec 2026 10:04:43 +0800 From: Ping-Ke Shih To: Maoyi Xie CC: "linux-wireless@vger.kernel.org" Subject: RE: [PATCH rtw-next v3 1/4] wifi: rtw89: pci: reject oversized RX packets Thread-Topic: [PATCH rtw-next v3 1/4] wifi: rtw89: pci: reject oversized RX packets Thread-Index: AQHdg8QMcORwxE5K2kqla1pO+QGqc7dPRIOA Date: Sun, 6 Dec 2026 02:04:43 +0000 Message-ID: References: <20261204074944.2942452-1-maoyixie.tju@gmail.com> <20261204074944.2942452-2-maoyixie.tju@gmail.com> In-Reply-To: <20261204074944.2942452-2-maoyixie.tju@gmail.com> Accept-Language: en-US, zh-TW Content-Language: zh-TW Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 Maoyi Xie wrote: > rtw89_skb_put_rx_data() and rtw89_pci_release_tx_skbs() take the data > length of an RX buffer from the 14-bit write size that the chip reports. > Nothing checks it against RTW89_PCI_RX_BUF_SIZE. A larger value makes > them read up to about 5 KB past the buffer. >=20 > Check the write size in > rtw89_pci_sync_skb_for_device_and_validate_rx_info(). A write size > below the data offset makes copy_len wrap, and a single segment then > copies desc_info->pkt_size bytes. Use that fallback only when it fits > in the buffer. >=20 > Found with a CodeQL-based static analysis tool. Reproduced in a > userspace harness under AddressSanitizer. Not tested on hardware. >=20 > Fixes: e3ec7017f6a2 ("rtw89: add Realtek 802.11ax driver") > Cc: stable@vger.kernel.org > Signed-off-by: Maoyi Xie Acked-by: Ping-Ke Shih