Commit 6958b027 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Kalle Valo

mt76x2: fix possible NULL pointer dereferencing in mt76x2_tx()

Fix a theoretical NULL pointer dereferencing in mt76x2_tx routine that
can occurs for injected frames in a monitor vif since vif pointer could
be NULL for that interfaces

Fixes: 23405236 ("mt76: fix transmission of encrypted mgmt frames")
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: default avatarFelix Fietkau <nbd@nbd.name>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent db2ad7c2
...@@ -36,9 +36,12 @@ void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, ...@@ -36,9 +36,12 @@ void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
msta = (struct mt76x2_sta *) control->sta->drv_priv; msta = (struct mt76x2_sta *) control->sta->drv_priv;
wcid = &msta->wcid; wcid = &msta->wcid;
/* sw encrypted frames */
if (!info->control.hw_key && wcid->hw_key_idx != -1)
control->sta = NULL;
} }
if (vif || (!info->control.hw_key && wcid->hw_key_idx != -1)) { if (vif && !control->sta) {
struct mt76x2_vif *mvif; struct mt76x2_vif *mvif;
mvif = (struct mt76x2_vif *) vif->drv_priv; mvif = (struct mt76x2_vif *) vif->drv_priv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment