Skip to content

Commit 7c59532

Browse files
Miriam-Racheljfvogel
authored andcommitted
wifi: mac80211: ensure sdata->work is canceled before initialized.
[ Upstream commit 6c93fd502023dd919b5987ccbe990735410edd49 ] This wiphy work is canceled when the iface is stopped, and shouldn't be queued for a non-running iface. If it happens to be queued for a non-running iface (due to a bug) it can cause a corruption of wiphy_work_list when ieee80211_setup_sdata is called. Make sure to cancel it in this case and warn on. Signed-off-by: Miri Korenblit <[email protected]> Reviewed-by: Johannes Berg <[email protected]> Link: https://patch.msgid.link/20250205110958.99204c767c10.I84ce27a239059f6009cee197b252549a11426046@changeid Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 4ae2c7c7d36976b381352b34eab6bf501afe0f1a) Signed-off-by: Jack Vogel <[email protected]>
1 parent 69a078c commit 7c59532

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/mac80211/iface.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Copyright 2008, Johannes Berg <[email protected]>
99
* Copyright 2013-2014 Intel Mobile Communications GmbH
1010
* Copyright (c) 2016 Intel Deutschland GmbH
11-
* Copyright (C) 2018-2024 Intel Corporation
11+
* Copyright (C) 2018-2025 Intel Corporation
1212
*/
1313
#include <linux/slab.h>
1414
#include <linux/kernel.h>
@@ -812,6 +812,9 @@ static void ieee80211_set_multicast_list(struct net_device *dev)
812812
*/
813813
static void ieee80211_teardown_sdata(struct ieee80211_sub_if_data *sdata)
814814
{
815+
if (WARN_ON(!list_empty(&sdata->work.entry)))
816+
wiphy_work_cancel(sdata->local->hw.wiphy, &sdata->work);
817+
815818
/* free extra data */
816819
ieee80211_free_keys(sdata, false);
817820

0 commit comments

Comments
 (0)