From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D98FC270ED2; Mon, 18 Aug 2025 13:32:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755523963; cv=none; b=bOVnc/QB3Ljb7DP5ELfTo3UAXpVd7yp4Vq6fc6B9ovEDwPxgzxYcCNcxzrNSM5bT5jrG9x94XZrtDn8KEWWQuzo/joCgHhxzkMEpCJC4d0km6OKDISwdjD25TJwfqbZpWvkp1lRh4kuuWkQfDlt6r26B0emABYubBAx4O76IH4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755523963; c=relaxed/simple; bh=dIwcQS9qG8Utga776u4F74G44AAzkBrMueUhc2CzVIs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GI938DS4uNA/TsNl4QbLjXA99nSSdhaEFJ8c0oN1N0inBkVhZq4Vuscd1xpu0G6QbjoON76WGaFyNKNdcSUzS8LNr5dq+z9SGzeR6jDt/BjNrxt4y8FUVCaIxA9r6cnhtXJpAg03fIMM7hsUSiGqHlOaraJeFbAFX9Z23d+6CpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PrCyjclC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PrCyjclC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4539BC4CEEB; Mon, 18 Aug 2025 13:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755523963; bh=dIwcQS9qG8Utga776u4F74G44AAzkBrMueUhc2CzVIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PrCyjclCLX8eINhP0cYnV956Qe4HugSDrPC+iiYfjedZL4rSD1yeCYb/yajcjumSk M4WGWGUvufR9wb4NUFO9vxyr9cPAgtmepiLK4dZiRu38KQ08LrEZvou5w005iBjPN1 kkAJ+uAQyrvYdXQgdOhXtlwXxv5PGDONmBgt99+E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Fedor Pchelkin , Alexei Safin , Stanislaw Gruszka , Johannes Berg , Sasha Levin Subject: [PATCH 6.15 294/515] wifi: iwlegacy: Check rate_idx range after addition Date: Mon, 18 Aug 2025 14:44:40 +0200 Message-ID: <20250818124509.739356738@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124458.334548733@linuxfoundation.org> References: <20250818124458.334548733@linuxfoundation.org> User-Agent: quilt/0.68 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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stanislaw Gruszka [ Upstream commit 0de19d5ae0b2c5b18b88c5c7f0442f707a207409 ] Limit rate_idx to IL_LAST_OFDM_RATE for 5GHz band for thinkable case the index is incorrect. Reported-by: Fedor Pchelkin Reported-by: Alexei Safin Signed-off-by: Stanislaw Gruszka Reviewed-by: Fedor Pchelkin Link: https://patch.msgid.link/20250525144524.GA172583@wp.pl Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c index dc8c408902e6..4d2148147b94 100644 --- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c @@ -1575,8 +1575,11 @@ il4965_tx_cmd_build_rate(struct il_priv *il, || rate_idx > RATE_COUNT_LEGACY) rate_idx = rate_lowest_index(&il->bands[info->band], sta); /* For 5 GHZ band, remap mac80211 rate indices into driver indices */ - if (info->band == NL80211_BAND_5GHZ) + if (info->band == NL80211_BAND_5GHZ) { rate_idx += IL_FIRST_OFDM_RATE; + if (rate_idx > IL_LAST_OFDM_RATE) + rate_idx = IL_LAST_OFDM_RATE; + } /* Get PLCP rate for tx_cmd->rate_n_flags */ rate_plcp = il_rates[rate_idx].plcp; /* Zero out flags for this packet */ -- 2.39.5