Commit 864a6040 authored by Johannes Berg's avatar Johannes Berg

mac80211: clear sequence/fragment number in QoS-null frames

Avoid leaking data by sending uninitialized memory and setting an
invalid (non-zero) fragment number (the sequence number is ignored
anyway) by setting the seq_ctrl field to zero.

Cc: stable@vger.kernel.org
Fixes: 3f52b7e3 ("mac80211: mesh power save basics")
Fixes: ce662b44 ("mac80211: send (QoS) Null if no buffered frames")
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent bc00a91d
...@@ -36,6 +36,7 @@ static struct sk_buff *mps_qos_null_get(struct sta_info *sta) ...@@ -36,6 +36,7 @@ static struct sk_buff *mps_qos_null_get(struct sta_info *sta)
sdata->vif.addr); sdata->vif.addr);
nullfunc->frame_control = fc; nullfunc->frame_control = fc;
nullfunc->duration_id = 0; nullfunc->duration_id = 0;
nullfunc->seq_ctrl = 0;
/* no address resolution for this frame -> set addr 1 immediately */ /* no address resolution for this frame -> set addr 1 immediately */
memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN);
memset(skb_put(skb, 2), 0, 2); /* append QoS control field */ memset(skb_put(skb, 2), 0, 2); /* append QoS control field */
......
...@@ -1206,6 +1206,7 @@ static void ieee80211_send_null_response(struct ieee80211_sub_if_data *sdata, ...@@ -1206,6 +1206,7 @@ static void ieee80211_send_null_response(struct ieee80211_sub_if_data *sdata,
memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN);
memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN); memcpy(nullfunc->addr2, sdata->vif.addr, ETH_ALEN);
memcpy(nullfunc->addr3, sdata->vif.addr, ETH_ALEN); memcpy(nullfunc->addr3, sdata->vif.addr, ETH_ALEN);
nullfunc->seq_ctrl = 0;
skb->priority = tid; skb->priority = tid;
skb_set_queue_mapping(skb, ieee802_1d_to_ac[tid]); skb_set_queue_mapping(skb, ieee802_1d_to_ac[tid]);
......
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