Skip to content

Commit 60c2a80

Browse files
jmberg-intelgregkh
authored andcommitted
wifi: iwlwifi: uefi: check DSM item validity
[ Upstream commit 1d33694 ] The first array index is a bitmap indicating which of the other values are valid. Check that bitmap before returning a value. Fixes: fc7214c ("wifi: iwlwifi: read DSM functions from UEFI") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220085 Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250828095500.59ec52ff865e.I9e11f497a029eb38f481b2c90c43c0935285216d@changeid Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 5deadb9 commit 60c2a80

File tree

1 file changed

+6
-0
lines changed
  • drivers/net/wireless/intel/iwlwifi/fw

1 file changed

+6
-0
lines changed

drivers/net/wireless/intel/iwlwifi/fw/uefi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,12 @@ int iwl_uefi_get_dsm(struct iwl_fw_runtime *fwrt, enum iwl_dsm_funcs func,
747747
goto out;
748748
}
749749

750+
if (!(data->functions[DSM_FUNC_QUERY] & BIT(func))) {
751+
IWL_DEBUG_RADIO(fwrt, "DSM func %d not in 0x%x\n",
752+
func, data->functions[DSM_FUNC_QUERY]);
753+
goto out;
754+
}
755+
750756
*value = data->functions[func];
751757

752758
IWL_DEBUG_RADIO(fwrt,

0 commit comments

Comments
 (0)