]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: iwlwifi: validate payload length in iwl_pnvm_complete_fn
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Wed, 15 Jul 2026 18:57:07 +0000 (21:57 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Thu, 16 Jul 2026 18:12:18 +0000 (21:12 +0300)
commitdaec24a5ed5da77a108e246ad77aa8b889911f93
tree53301a060be213e7331afac9fff529bca598521f
parentbc796f84ec9a95b356959ec7caf1d4fce33f3a76
wifi: iwlwifi: validate payload length in iwl_pnvm_complete_fn

iwl_pnvm_complete_fn() casts pkt->data directly to
struct iwl_pnvm_init_complete_ntfy and reads the status field
without first verifying that the firmware notification payload
is large enough to contain that structure.

Add a WARN_ON_ONCE check against sizeof(*pnvm_ntf) and return
early without reading uninitialised memory if the payload is too
short.

Fixes: b3e4c0f34c17 ("iwlwifi: move PNVM implementation to common code")
Assisted-by: GitHubCopilot:gpt-5.3-codex
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260715215523.7f2a669e5c75.I00465dcfcbccb250ae9af2d9bb305e24de1ba394@changeid
drivers/net/wireless/intel/iwlwifi/fw/pnvm.c