2
0

304-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From b478e06a16a8baa00c5ecc87c1d636981f2206d5 Mon Sep 17 00:00:00 2001
  2. From: Johannes Berg <[email protected]>
  3. Date: Tue, 29 Oct 2019 10:25:25 +0100
  4. Subject: [PATCH] mac80211: sta: randomize BA session dialog token allocator
  5. We currently always start the dialog token generator at zero,
  6. so the first dialog token we use is always 1. This would be
  7. OK if we had a perfect guarantee that we always do a proper
  8. deauth/re-auth handshake, but in IBSS mode this doesn't always
  9. happen properly.
  10. To make problems with block ack (aggregation) sessions getting
  11. stuck less likely, randomize the dialog token so if we start a
  12. new session but the peer still has old state for us, it can
  13. better detect this.
  14. This is really just a workaround to make things a bit more
  15. robust than they are now - a better fix would be to do a full
  16. authentication handshake in IBSS mode upon having discovered a
  17. new station, and on the receiver resetting the state (removing
  18. and re-adding the station) on receiving the authentication
  19. packet.
  20. Signed-off-by: Johannes Berg <[email protected]>
  21. ---
  22. net/mac80211/sta_info.c | 1 +
  23. 1 file changed, 1 insertion(+)
  24. --- a/net/mac80211/sta_info.c
  25. +++ b/net/mac80211/sta_info.c
  26. @@ -357,6 +357,7 @@ struct sta_info *sta_info_alloc(struct i
  27. INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames);
  28. INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
  29. mutex_init(&sta->ampdu_mlme.mtx);
  30. + sta->ampdu_mlme.dialog_token_allocator = prandom_u32_max(U8_MAX);
  31. #ifdef CPTCFG_MAC80211_MESH
  32. if (ieee80211_vif_is_mesh(&sdata->vif)) {
  33. sta->mesh = kzalloc(sizeof(*sta->mesh), gfp);