Skip to content

Commit d5e568c

Browse files
committed
mac80211: track only QoS data frames for admission control
For admission control, obviously all of that only works for QoS data frames, otherwise we cannot even access the QoS field in the header. Syzbot reported (see below) an uninitialized value here due to a status of a non-QoS nullfunc packet, which isn't even long enough to contain the QoS header. Fix this to only do anything for QoS data packets. Reported-by: syzbot+614e82b88a1a4973e534@syzkaller.appspotmail.com Fixes: 02219b3 ("mac80211: add WMM admission control support") Link: https://lore.kernel.org/r/20211122124737.dad29e65902a.Ieb04587afacb27c14e0de93ec1bfbefb238cc2a0@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 48c0670 commit d5e568c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

net/mac80211/mlme.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2452,11 +2452,18 @@ static void ieee80211_sta_tx_wmm_ac_notify(struct ieee80211_sub_if_data *sdata,
24522452
u16 tx_time)
24532453
{
24542454
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2455-
u16 tid = ieee80211_get_tid(hdr);
2456-
int ac = ieee80211_ac_from_tid(tid);
2457-
struct ieee80211_sta_tx_tspec *tx_tspec = &ifmgd->tx_tspec[ac];
2455+
u16 tid;
2456+
int ac;
2457+
struct ieee80211_sta_tx_tspec *tx_tspec;
24582458
unsigned long now = jiffies;
24592459

2460+
if (!ieee80211_is_data_qos(hdr->frame_control))
2461+
return;
2462+
2463+
tid = ieee80211_get_tid(hdr);
2464+
ac = ieee80211_ac_from_tid(tid);
2465+
tx_tspec = &ifmgd->tx_tspec[ac];
2466+
24602467
if (likely(!tx_tspec->admitted_time))
24612468
return;
24622469

0 commit comments

Comments
 (0)