]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: iwlwifi: mvm: verify scan id reported by firmware
authorAvraham Stern <avraham.stern@intel.com>
Tue, 14 Jul 2026 11:19:50 +0000 (14:19 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 14 Jul 2026 17:45:19 +0000 (20:45 +0300)
The scan id reported by firmware in scan complete notification is
used as an index to the scan status array. Verify the reported id
does not exceed the array size.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Link: https://patch.msgid.link/20260714141909.fdf31f494f1c.I70d01ed2023f6584fb23ea8ab344a93d222cc4c0@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/scan.c

index 79829f775c89bfb06c192e43d35ca0765b8e12de..42f9d9a713b8804f49127f4658c54de92dffcc12 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2012-2014, 2018-2025 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2026 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -3217,6 +3217,10 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm,
 
        mvm->mei_scan_filter.is_mei_limited_scan = false;
 
+       if (IWL_FW_CHECK(mvm, uid >= ARRAY_SIZE(mvm->scan_uid_status),
+                        "FW reports out-of-range scan UID %d\n", uid))
+               return;
+
        IWL_DEBUG_SCAN(mvm,
                       "Scan completed: uid=%u type=%u, status=%s, EBS=%s\n",
                       uid, mvm->scan_uid_status[uid],