]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: iwlwifi: mvm: avoid NULL pointer dereference
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Sun, 25 Aug 2024 16:17:09 +0000 (19:17 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 27 Aug 2024 08:28:55 +0000 (10:28 +0200)
commit557a6cd847645e667f3b362560bd7e7c09aac284
tree138a63f5ec4fa8c135981c2e9506da4447fa89ea
parent53bc1b73b67836ac9867f93dee7a443986b4a94f
wifi: iwlwifi: mvm: avoid NULL pointer dereference

iwl_mvm_tx_skb_sta() and iwl_mvm_tx_mpdu() verify that the mvmvsta
pointer is not NULL.
It retrieves this pointer using iwl_mvm_sta_from_mac80211, which is
dereferencing the ieee80211_sta pointer.
If sta is NULL, iwl_mvm_sta_from_mac80211 will dereference a NULL
pointer.
Fix this by checking the sta pointer before retrieving the mvmsta
from it. If sta is not NULL, then mvmsta isn't either.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20240825191257.880921ce23b7.I340052d70ab6d3410724ce955eb00da10e08188f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/tx.c