* [PATCH v2] wifi: mac80211: clear vif drv_priv after remove_interface when stopping
@ 2024-07-04 13:09 Felix Fietkau
0 siblings, 0 replies; only message in thread
From: Felix Fietkau @ 2024-07-04 13:09 UTC (permalink / raw)
To: linux-wireless; +Cc: johannes
Avoid reusing stale driver data when an interface is brought down and up
again. In order to avoid having to duplicate the memset in every single
driver, do it here.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
v2: only clear data in ieee80211_do_stop
net/mac80211/iface.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 6d969d9f1ac9..97aee0a1a39a 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -689,8 +689,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
fallthrough;
default:
- if (going_down)
- drv_remove_interface(local, sdata);
+ if (!going_down)
+ break;
+ drv_remove_interface(local, sdata);
+
+ /* Clear private driver data to prevent reuse */
+ memset(sdata->vif.drv_priv, 0, local->hw.vif_data_size);
}
ieee80211_recalc_ps(local);
--
2.44.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-07-04 13:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-04 13:09 [PATCH v2] wifi: mac80211: clear vif drv_priv after remove_interface when stopping Felix Fietkau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox