From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796093964; b=FCP4ZGkd8jOXYtti6LhDzY+GmezzE6uGFtfH9BcbLG9ybz69MK4Xe/IUaNbgXboChPqI PWD6scPN9WXh3q9AdxX1rzHWTrHnFLpyxQRu3+Mh1F9fjnMiHzeSEYcmUisrGCBloPxnV WuJtgX/xHTFYj40zukzLhaYAzFqAhx9wRQD2cgRWaL8EJOGnZWIwurBBShbSYPQoB4P7H PPjDe3EGhrM7dbHo4usUafuBdnQACqIf8ztkdcVwB8mnq2Y1ROgo4hEKVtah3aFz2jDov oJZ1GeoCEVFmKZ+uB7OV1s2o3LKKT1Ya14+nB0OuJ3O9jxpH0lWIhDDw1yiDIJdPvhA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796093964; h=DMARC-Filter:X-SpamFilter-By:DKIM-Signature:Received: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=yqpdWpe5CYGfa8tVjfXtiJYSD3wtWLBts4dWJ1LWlCc=; b=L34jlNCM3dUBdommQIbp4W9fWTisGebPDj27F7/btcflc8yufCAvH2yO/BR3nURih9TH P9COn8MtLZmAX95T+PvkD1fMGc1Jc5dR7J9STgG5gWxm19hbUHClIDHOeqc5y9JoVAY3z IFLLf9n+sUX8+/vwdtk+x/Zy2Mw9v1uBboNWW5O2Z2Ta3E6S1kA6BOMz1QCAqnmuDkWSn t6RPtJI981cUnlTZBca8p3eg06X9Hv2UqfTOOp1sXC8Ci5VPJWNsJYWzva8X+W6O1efcl Cm6M4lDWU9eMNemYOFOaz0bJsHIQw37L4gZtWk38dlx5gYCA1QfPWP7LRKDq1RmrPkQ== 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=PUfAeqah; 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 50E14606A31A; Tue, 1 Dec 2026 02:59:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 50E14606A31A 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=PUfAeqah X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 6B12x6F513885895, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realtek.com; s=dkim; t=1796093946; bh=yqpdWpe5CYGfa8tVjfXtiJYSD3wtWLBts4dWJ1LWlCc=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:Content-Transfer-Encoding:MIME-Version; b=PUfAeqahBsym8ZImzmAnpU6No7bGrEaoghm2Jg0DG+OzdntRF+qeOCom3hjayw5uc NUvEkMMxj5DSvyeYyOHraj8GFOQsKTft14LBAHpGqIWIx1DoBkqOEhXdSevJ8B+GLj iYT3x8yeS0U/GL+L8ztnKTvhbSfXuzupotjWDo9A9fOi+75j6nsfdkivtMvZJIuRf7 omKf8hvugYBaZrE0S4Lf8mQAyiJT5yjkESx5yz/OI7YbHrc5jsYUH1Mo5z2N+LsAQR qfLrXAUjsHdVNvd9wxBKBgpq2D3aR3WHCD03SMfCdHu9k9rJrb7j30aVj5iv0Ro7jf snsqCgmIjx88w== Received: from mail.realtek.com (rtkexhmbs02.realtek.com.tw[172.21.6.41]) by rtits2.realtek.com.tw (8.15.2/3.29/5.94) with ESMTPS id 6B12x6F513885895 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 1 Dec 2026 10:59:06 +0800 Received: from RTKEXHMBS05.realtek.com.tw (10.21.1.55) by RTKEXHMBS02.realtek.com.tw (172.21.6.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Tue, 1 Dec 2026 10:59:06 +0800 Received: from RTKEXHMBS06.realtek.com.tw (10.21.1.56) by RTKEXHMBS05.realtek.com.tw (10.21.1.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Tue, 1 Dec 2026 10:59:06 +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; Tue, 1 Dec 2026 10:59:06 +0800 From: Ping-Ke Shih To: Tanuj Sharma , "rtl8821cerfe2@gmail.com" CC: "security@kernel.org" , "kvalo@kernel.org" , "linux-wireless@vger.kernel.org" , "stable@vger.kernel.org" Subject: RE: [PATCH v2] wifi: rtlwifi: fix P2P NoA bounds check using truncated length Thread-Topic: [PATCH v2] wifi: rtlwifi: fix P2P NoA bounds check using truncated length Thread-Index: AQHdgQ18XXtIK5TuY0uk/qF9SGs1K7dHfWwg Date: Tue, 1 Dec 2026 02:59:05 +0000 Message-ID: <4999a75ee6e24db18c019bb6e5fcda6a@realtek.com> References: <20261130205750.64080-1-ertanuj96@gmail.com> In-Reply-To: <20261130205750.64080-1-ertanuj96@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 Tanuj Sharma wrote: > Both rtl_p2p_noa_ie() and rtl_p2p_action_ie() parse P2P sub-elements > whose length field is 16 bits (little-endian at bytes 1-2 of each > sub-element header). The code reads the full 16-bit value into noa_len: >=20 > noa_len =3D le16_to_cpu(*((__le16 *)&ie[1])); >=20 > but the bounds check only uses the low byte: >=20 > if (ie + 3 + ie[1] > end) >=20 > When the high byte (ie[2]) is non-zero, the bounds check passes with a > smaller value than the actual length, allowing the inner NOA descriptor > loop to read up to 26 bytes past the validated region. Use noa_len in the > bounds check to match the actual length used for parsing. >=20 > Additionally, the while loop condition 'ie + 1 < end' only guarantees > ie[0] and ie[1] are readable, but the le16_to_cpu read accesses both > ie[1] and ie[2]. Change the condition to 'ie + 2 < end' to ensure the > full 3-byte sub-element header (attribute ID + 16-bit length) is > accessible before reading. >=20 > Cc: stable@vger.kernel.org > Fixes: 8c55dedb795b ("rtlwifi: Fix potential overflow on P2P code") I think Fixes should be: Fixes: 26634c4b1868 ("rtlwifi Modify existing bits to match vendor version = 2013.02.07") > Signed-off-by: Tanuj Sharma Otherwise, looks good to me. Acked-by: Ping-Ke Shih