46cae5bf4b13407019f05d3f4888bdd866de0274
[openwrt/staging/ansuel.git] /
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Wed, 3 Jul 2024 12:10:01 +0200
3 Subject: [PATCH] wifi: mac80211: clear vif drv_priv after calling
4 remove_interface
5
6 Avoid reusing stale driver data when an interface is brought down and up
7 again. In order to avoid having to duplicate the memset in every single
8 driver, do it here.
9
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 ---
12
13 --- a/net/mac80211/iface.c
14 +++ b/net/mac80211/iface.c
15 @@ -684,8 +684,12 @@ static void ieee80211_do_stop(struct iee
16
17 fallthrough;
18 default:
19 - if (going_down)
20 - drv_remove_interface(local, sdata);
21 + if (!going_down)
22 + break;
23 + drv_remove_interface(local, sdata);
24 +
25 + /* Clear private driver data to prevent reuse */
26 + memset(sdata->vif.drv_priv, 0, local->hw.vif_data_size);
27 }
28
29 ieee80211_recalc_ps(local);