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=1796180378; b=I5iPEv/yp+H6pRXpbxruYMOxs4+EbhqKMJcXf0IANBisB9yNHMgMV9G4lolPpzJ+iAwM YkVpH5z8feDpgGlspvIPv2XMDrTmp6HXYWfqqbicajO3JftUrzuX+/RA/Au5VX2pP20zP rBcq3KAI2wLN4gcQQPHxAUb6KyRl1RvFcDS0vhzEpL6wMPoiGbT0Zo1QGJ5xI1ohprZMl LaeBK1/IDObnR6HU265cvbBKNjAI1GL0a38E96iwTJnkE/QFxsEjDKQTjw5mzNW99f4Pw 2ealuK9tH8IR4yDURtwtHy9ZV+T6HrWKHMufrXEuJBVCtWA+uEkYQRnsbuRDwxMRVpA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796180378; 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=GcZujGi+Ry7ET7B0dnuFTQaLGf2p9mzWYQaOO3ICE6g=; b=2AaZrMkTsFZH/rY7itsODJ094hc+U8TMATPDjcjFhRrHzT+4/kI+q+/GH2OU8Udahkca sakeEhxVucVQli67zX5m0phf3FpG6hd/8F2/6JR1Q1pcV7QiQRftRGXGaWPWyvm3Zvht4 3JkW2AVbaHza6+dW8HiavlGskIMQeF4GC+VCqsSsWu7QyotckAzFlBygbzy1FaWdl4lII TUMP18aVaX3sU1XQJY9+O+DVYj2NsN0O/UiFSNNU9hrvpV/XjFJVLgBJ69eQX4r7Kd5yk 4vRTRwFf42sgXjwROk7Mj82M/KTi9WFOOB+2smFsQIVKMYSONnaWAdmexTFN8qAHAeg== 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=Mmw+K5Yl; 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 3F0F9606A31A for ; Wed, 2 Dec 2026 02:59:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3F0F9606A31A 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=Mmw+K5Yl X-SpamFilter-By: ArmorX SpamTrap 5.80 with qID 6B22xYLT1645392, This message is accepted by code: ctloc85258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=realtek.com; s=dkim; t=1796180374; bh=GcZujGi+Ry7ET7B0dnuFTQaLGf2p9mzWYQaOO3ICE6g=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:Content-Transfer-Encoding:MIME-Version; b=Mmw+K5YlvUwtuBTw4nT1BcHNvSscE+yC/L+BskSrZaEg0XzqAndswbBXoU6hI6PH/ 7wDje2bQncgxhX71r5RLAbt9jglDgT4II+OuBoGwCLKp1veP8mvH9aUmGv99HkzILB 3CpyXegZSfQVC0FDl+ZwdNykagv39mpLaWlD4ZdtwPPswyKYBhsSvA8SvTG6jpOfWe zkbLYVpo6qlZ67sUadVnu9MnBaCn0qZLFp6JlMgsdPbqK141N1ZUpBUnpFPNvlt90s Fzd3VM68mY4jaTk3OPwjnEnC0Mck5hC88YugaxVsV81VPVmueOO7zXT34Fgg1rN9kG Ov2WMGHifWxfg== Received: from mail.realtek.com (rtkexhmbs04.realtek.com.tw[10.21.1.54]) by rtits2.realtek.com.tw (8.15.2/3.29/5.94) with ESMTPS id 6B22xYLT1645392 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 2 Dec 2026 10:59:34 +0800 Received: from RTKEXHMBS06.realtek.com.tw (10.21.1.56) by RTKEXHMBS04.realtek.com.tw (10.21.1.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Wed, 2 Dec 2026 10:59:34 +0800 Received: from RTKEXHMBS06.realtek.com.tw (10.21.1.56) by RTKEXHMBS06.realtek.com.tw (10.21.1.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Wed, 2 Dec 2026 10:59:33 +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; Wed, 2 Dec 2026 10:59:33 +0800 From: Ping-Ke Shih To: Maoyi Xie CC: "linux-wireless@vger.kernel.org" Subject: RE: [PATCH rtw-next 2/4] wifi: rtw89: pci: validate hardware index of BD ring Thread-Topic: [PATCH rtw-next 2/4] wifi: rtw89: pci: validate hardware index of BD ring Thread-Index: AQHdgXKcwAHxt5/7oku1uJ+dQ6ZC1LdJDvfg Date: Wed, 2 Dec 2026 02:59:33 +0000 Message-ID: <88db4d7008b04882b2f1963107ae1139@realtek.com> References: <20261201090138.3652600-1-maoyixie.tju@gmail.com> <20261201090138.3652600-3-maoyixie.tju@gmail.com> In-Reply-To: <20261201090138.3652600-3-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: > The hardware index of a BD ring has 12 bits, but a ring has 256 > entries. With an index of 512 or more (4095 for a read of 0xffffffff), > a failed release can leave the RX write pointer outside the ring. On > chips without rx_ring_eq_is_full, the next poll reads rx_ring->buf[] > out of bounds. >=20 > Ignore an index outside the ring. >=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