Message ID | 95a01ec8-4f2e-4cc0-a107-cb40257f100e@yandex.ru |
---|---|
State | New |
Headers | show |
Series | On 021d53a3d87e ("wifi: mac80211: fix NULL dereference at band check in starting tx ba session") | expand |
Dmitry Antipov <dmantipov@yandex.ru> wrote: > > Looking at 021d53a3d87e ("wifi: mac80211: fix NULL dereference at band check in starting tx > ba session"), can the following be useful for older (e.g. 5.10) kernels without any MLO > support? > > diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index > 4b4ab1961068..1a89ba2aecaa 100644 > --- a/net/mac80211/agg-tx.c > +++ b/net/mac80211/agg-tx.c > @@ -595,7 +595,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 > tid, > return -EINVAL; > > if (!pubsta->ht_cap.ht_supported && > - sta->sdata->vif.bss_conf.chandef.chan->band != NL80211_BAND_6GHZ) > + !pubsta->vht_cap.vht_supported && > + !pubsta->he_cap.has_he) > return -EINVAL; > > if (WARN_ON_ONCE(!local->ops->ampdu_action)) > > Dmitry > Without MLO, no NULL dereference here, and the original logic is workable (though not very intuitive). So, to me, it doesn't seem much necessary for older kernels.
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index 4b4ab1961068..1a89ba2aecaa 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c @@ -595,7 +595,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, return -EINVAL; if (!pubsta->ht_cap.ht_supported && - sta->sdata->vif.bss_conf.chandef.chan->band != NL80211_BAND_6GHZ) + !pubsta->vht_cap.vht_supported && + !pubsta->he_cap.has_he) return -EINVAL; if (WARN_ON_ONCE(!local->ops->ampdu_action))