]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:00:20 +0000 (12:00 +0200)
commitcdbf51bfa4b0411820806777da36d93d49bc49a1
tree4df439d697606243848a9b94bd4f38d605585056
parent3807905165af4e0e6d47edf03d9b84ef5f3ed883
wifi: iwlwifi: mvm: avoid NULL pointer dereference

[ Upstream commit 557a6cd847645e667f3b362560bd7e7c09aac284 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/tx.c