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 C5F7F31CA5B; Mon, 18 Aug 2025 13:03:06 +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=1755522186; cv=none; b=Pv1b32KT6qMHT+LbgVegUFyR4XthAPhbCTsQGUB4+vWNd/rDJp3ISUHrridvi2kDfeuij0N0UQDR0sxgQWF2GjuV+YnxcNXiliylq/W6D4Vt5n8GMhjdxosDOMvAuTgCUZjKsVe8Ez6hO4P5pZscWkqWKXLn+WkHcIoUTUqNf8c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755522186; c=relaxed/simple; bh=p2WA4bg0yiVi2uuW+EqQlNnvYMcrOa+TxCfCLlsU6/0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WbDZmAjC4Xf9SYaCdnANByTrpTpS3NU6je0Jf+VPAG2/Lw94kOA9udj7p++s2FXwepQae4RqNHNG919T4ZSYVpRy6qUIA0pcQpBL2Sr2asMZ/fg5Y87HGMA2cxwsJ8kvTEuxHjRYDD6Huqoc2ssb82t7QI1ec2dbAhHY6lWfyQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qJ4N3vaz; 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="qJ4N3vaz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33869C4CEEB; Mon, 18 Aug 2025 13:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755522186; bh=p2WA4bg0yiVi2uuW+EqQlNnvYMcrOa+TxCfCLlsU6/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qJ4N3vazwAKV1oQgKS1p2U2GKmeebt7ptFtC0bSWSbcLk9FmpIvVaMeuIJC3JZZrk EjEpxbERK2fCP5o8eeCvBG0opGltGqnMaa4y+PtPxXKs1RykG1EsUa0/+6eDpz2Y8Y buh6P0pxkjuqZ5Og+KMRYgz6ZWv1mCd3sNWZveoI= 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.12 241/444] wifi: iwlegacy: Check rate_idx range after addition Date: Mon, 18 Aug 2025 14:44:27 +0200 Message-ID: <20250818124457.872741612@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250818124448.879659024@linuxfoundation.org> References: <20250818124448.879659024@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.12-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 05c4af41bdb9..a94cf27ffe4b 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