Skip to content

Commit 4ae2c7c

Browse files
Miriam-Rachelgregkh
authored andcommitted
wifi: mac80211: ensure sdata->work is canceled before initialized.
[ Upstream commit 6c93fd5 ] 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 <miriam.rachel.korenblit@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Link: https://patch.msgid.link/20250205110958.99204c767c10.I84ce27a239059f6009cee197b252549a11426046@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cca16fb commit 4ae2c7c

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 <johannes@sipsolutions.net>
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)