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 4795938654F; Sat, 17 Oct 2026 16:16:55 +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=1792253816; cv=none; b=Dth4NsOsuo/oqXsswsQTPnZdICdP93Lov+WBi0Q3yvHTsm+kGgb/+LVqhX74W3nbu3waUiqrskswu4JVmHiJC5xvU7uiguoFQnRmeuRZZ/XfC2q307CAAZY9bApsXr4PLIZ83ntzhsdREXymQmZUS8BTaW1ZOFlOovdpgT/UPfE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792253816; c=relaxed/simple; bh=vWhImizEagXuaZG+7iD8osrrHBQoijdHN0g70rd8KPo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VLsedCI2epV0YpCvOnb6ezRxoqbV5GcOyUI208LuimwNVW25MywdFLmkwCtVsMH0x/9KbxMhC+YW1xM1FuwsAqele/4yy7F9YDt1pfupli/1Td1VjYnL31AGYQXZpXzu0nizbJcp8dq3LYMF3O87lf13Hr14KehrDQFPi1J94ug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WdWQX413; 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="WdWQX413" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9149C1F000C4; Sat, 17 Oct 2026 16:16:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792253815; bh=hguJJk9R3ebUwGOULIhSnCvcOTkB3prYpXjOZMqu6pM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WdWQX413nlck1wu6DNRcMj9xnaCMpY0YEhgRSEmOaeND31BBGODYLBTnnN955r3Fe frvXkuRBP9nkgUtFM31wWkPPcSb0wPJNZBouAtxOK25c3ig7K3TiJrtADTDm7GAsiE YISl2dxc2OQl7PVMnU5BmG0N8i79hyGVWBHpz3mk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Johannes Berg , Miri Korenblit , Sasha Levin Subject: [PATCH 6.12 240/869] wifi: iwlwifi: fix 22000 series SMEM parsing Date: Sat, 17 Oct 2026 17:51:21 +0200 Message-ID: <20261017160043.208698410@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160036.979869304@linuxfoundation.org> References: <20261017160036.979869304@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johannes Berg [ Upstream commit 58192b9ce09b0f0f86e2036683bd542130b91a98 ] If the firmware were to report three LMACs (which doesn't exist in hardware) then using "fwrt->smem_cfg.lmac[2]" is an overrun of the array. Reject such and use IWL_FW_CHECK instead of WARN_ON in this function. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20251110150012.16e8c2d70c26.Iadfcc1aedf43c5175b3f0757bea5aa232454f1ac@changeid Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/fw/smem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/smem.c b/drivers/net/wireless/intel/iwlwifi/fw/smem.c index 3f1272014dafb..50ebc81a3748c 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/smem.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/smem.c @@ -6,6 +6,7 @@ */ #include "iwl-drv.h" #include "runtime.h" +#include "dbg.h" #include "fw/api/commands.h" static void iwl_parse_shared_mem_22000(struct iwl_fw_runtime *fwrt, @@ -17,7 +18,9 @@ static void iwl_parse_shared_mem_22000(struct iwl_fw_runtime *fwrt, u8 api_ver = iwl_fw_lookup_notif_ver(fwrt->fw, SYSTEM_GROUP, SHARED_MEM_CFG_CMD, 0); - if (WARN_ON(lmac_num > ARRAY_SIZE(mem_cfg->lmac_smem))) + /* Note: notification has 3 entries, but we only expect 2 */ + if (IWL_FW_CHECK(fwrt, lmac_num > ARRAY_SIZE(fwrt->smem_cfg.lmac), + "FW advertises %d LMACs\n", lmac_num)) return; fwrt->smem_cfg.num_lmacs = lmac_num; -- 2.53.0