2015-06-13 14:16:48

by Bob Copeland

[permalink] [raw]
Subject: [PATCH] mac80211: enable assoc check for mesh interfaces

We already set a station to be associated when peering completes, both
in user space and in the kernel. Thus we should always have an
associated sta before sending data frames to that station.

Failure to check assoc state can cause crashes in the lower-level driver
due to transmitting unicast data frames before driver sta structures
(e.g. ampdu state in ath9k) are initialized. This occurred when
forwarding in the presence of fixed mesh paths: frames were transmitted
to stations with whom we hadn't yet completed peering.

Cc: [email protected]
Reported-by: Alexis Green <[email protected]>
Tested-by: Jesse Jones <[email protected]>
Signed-off-by: Bob Copeland <[email protected]>
---
net/mac80211/tx.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8410bb3..d580f86 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -311,9 +311,6 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
if (tx->sdata->vif.type == NL80211_IFTYPE_WDS)
return TX_CONTINUE;

- if (tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
- return TX_CONTINUE;
-
if (tx->flags & IEEE80211_TX_PS_BUFFERED)
return TX_CONTINUE;

--
2.1.4



2015-06-17 09:01:33

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: enable assoc check for mesh interfaces

On Sat, 2015-06-13 at 10:16 -0400, Bob Copeland wrote:
> We already set a station to be associated when peering completes, both
> in user space and in the kernel. Thus we should always have an
> associated sta before sending data frames to that station.
>
> Failure to check assoc state can cause crashes in the lower-level driver
> due to transmitting unicast data frames before driver sta structures
> (e.g. ampdu state in ath9k) are initialized. This occurred when
> forwarding in the presence of fixed mesh paths: frames were transmitted
> to stations with whom we hadn't yet completed peering.

Applied.

johannes