From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E4193CD8B8; Wed, 30 Sep 2026 18:58:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790794681; cv=none; b=epVG/uNnYHpcNsWOk+0DV4cbiv4hJ9j7/stQ2bUy2sQZaAx1s4be3vUh9Vwf/Ej3jPQ5dwa+6sBL4U5vaguIG6/Xrq+lyCH2kEt2p+AwB2qbRV8UCNipgHKIN+eZmX/4OVN4t1NP4GWUWwqu21uTZU5rdl0+37RlUl/jYGbVerU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790794681; c=relaxed/simple; bh=aHSEYiqT/aPxuQ0TBwiW17LIElxB+bIJxp19sF5rpS0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A73a77Iymty6EGhKyu1MmWCQLANYZ5Tq2hufWDYSS72OeDe0c54jMrlwqcU+E+1ITrrJFYEmNI4cEOcOFkRPpS0WOO+2b6rrZgiYQU+VTlIR5LofemZnV8YG6Sh8O5rLnaLMyrMa4dOWz43PTYJtaWcBCzB5mCfPNDxss2QmQDs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2sI0wsgz; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="2sI0wsgz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C2B11F000FF; Wed, 30 Sep 2026 18:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790794680; bh=qrTiubQYC8oFV0PYD5PLlXnTBGReNHyo37vMEsSPcPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=2sI0wsgzxob/y/0TV3eEPV1yx6iMj9jkJCDRwkjY3dDrX7b4oRPrDm8xUuofipF3S CGHpTfRXih8ihIcC62j+Oc8rerhovQa1aMihpRjmL2Whyhc9lRoQ1vFa1fGpGfttxA XCFzsOWGxc4sx8ahHzIOtDFP94B33FgUH/d+CLJY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Pengpeng Hou , Johannes Berg , Sasha Levin Subject: [PATCH 6.6 0296/1193] wifi: libipw: fix key index receive bound checks Date: Wed, 30 Sep 2026 17:16:20 +0200 Message-ID: <20260930152440.736505989@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152434.301151190@linuxfoundation.org> References: <20260930152434.301151190@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pengpeng Hou [ Upstream commit 74ed3669f26803b1761c1f55403062bea44c3466 ] libipw_rx() reads skb->data[hdrlen + 3] to extract the WEP key index in both the software-decrypt key selection path and the hardware-decrypted IV/ICV strip path. In both places the existing guard only checks skb->len >= hdrlen + 3, which proves bytes up to hdrlen + 2 but not the byte at hdrlen + 3. Require hdrlen + 4 bytes before reading that item in both paths. This is a local source-boundary check only; it does not change the key index semantics. Signed-off-by: Pengpeng Hou Link: https://patch.msgid.link/20260705083519.23567-1-pengpeng@iscas.ac.cn Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_rx.c b/drivers/net/wireless/intel/ipw2x00/libipw_rx.c index 9a97ab9b89ae8..2220a9814c8a6 100644 --- a/drivers/net/wireless/intel/ipw2x00/libipw_rx.c +++ b/drivers/net/wireless/intel/ipw2x00/libipw_rx.c @@ -417,7 +417,7 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb, ieee->host_mc_decrypt : ieee->host_decrypt; if (can_be_decrypted) { - if (skb->len >= hdrlen + 3) { + if (skb->len >= hdrlen + 4) { /* Top two-bits of byte 3 are the key index */ keyidx = skb->data[hdrlen + 3] >> 6; } @@ -663,7 +663,7 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb, int trimlen = 0; /* Top two-bits of byte 3 are the key index */ - if (skb->len >= hdrlen + 3) + if (skb->len >= hdrlen + 4) keyidx = skb->data[hdrlen + 3] >> 6; /* To strip off any security data which appears before the -- 2.53.0