Skip to content
/ linux Public

Commit d32c07e

Browse files
Peddolla Harshavardhan Reddygregkh
authored andcommitted
wifi: cfg80211: cancel pmsr_free_wk in cfg80211_pmsr_wdev_down
[ Upstream commit 6dccbc9 ] When the nl80211 socket that originated a PMSR request is closed, cfg80211_release_pmsr() sets the request's nl_portid to zero and schedules pmsr_free_wk to process the abort asynchronously. If the interface is concurrently torn down before that work runs, cfg80211_pmsr_wdev_down() calls cfg80211_pmsr_process_abort() directly. However, the already- scheduled pmsr_free_wk work item remains pending and may run after the interface has been removed from the driver. This could cause the driver's abort_pmsr callback to operate on a torn-down interface, leading to undefined behavior and potential crashes. Cancel pmsr_free_wk synchronously in cfg80211_pmsr_wdev_down() before calling cfg80211_pmsr_process_abort(). This ensures any pending or in-progress work is drained before interface teardown proceeds, preventing the work from invoking the driver abort callback after the interface is gone. Fixes: 9bb7e0f ("cfg80211: add peer measurement with FTM initiator API") Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com> Link: https://patch.msgid.link/20260305160712.1263829-3-peddolla.reddy@oss.qualcomm.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 29a1a35 commit d32c07e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/wireless/pmsr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@ void cfg80211_pmsr_wdev_down(struct wireless_dev *wdev)
647647
}
648648
spin_unlock_bh(&wdev->pmsr_lock);
649649

650+
cancel_work_sync(&wdev->pmsr_free_wk);
650651
if (found)
651652
cfg80211_pmsr_process_abort(wdev);
652653

0 commit comments

Comments
 (0)