From: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, kavita.kavita@oss.qualcomm.com
Subject: [PATCH wireless-next v3 02/15] wifi: cfg80211: cancel pmsr_free_wk in cfg80211_pmsr_wdev_down
Date: Thu, 5 Mar 2026 21:36:59 +0530 [thread overview]
Message-ID: <20260305160712.1263829-3-peddolla.reddy@oss.qualcomm.com> (raw)
In-Reply-To: <20260305160712.1263829-1-peddolla.reddy@oss.qualcomm.com>
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: 9bb7e0f24e7e ("cfg80211: add peer measurement with FTM initiator API")
Signed-off-by: Peddolla Harshavardhan Reddy <peddolla.reddy@oss.qualcomm.com>
---
net/wireless/pmsr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/wireless/pmsr.c b/net/wireless/pmsr.c
index b875b61c0b48..c2977a37add2 100644
--- a/net/wireless/pmsr.c
+++ b/net/wireless/pmsr.c
@@ -658,6 +658,7 @@ void cfg80211_pmsr_wdev_down(struct wireless_dev *wdev)
}
spin_unlock_bh(&wdev->pmsr_lock);
+ cancel_work_sync(&wdev->pmsr_free_wk);
if (found)
cfg80211_pmsr_process_abort(wdev);
--
2.34.1
next prev parent reply other threads:[~2026-03-05 16:07 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 16:06 [PATCH wireless-next v3 00/15] wifi: Ranging support enhancements Peddolla Harshavardhan Reddy
2026-03-05 16:06 ` [PATCH wireless-next v3 01/15] wifi: cfg80211: Allow RSTA role without LMR request Peddolla Harshavardhan Reddy
2026-03-12 21:03 ` Stern, Avraham
2026-03-20 18:07 ` Peddolla Harshavardhan Reddy
2026-03-05 16:06 ` Peddolla Harshavardhan Reddy [this message]
2026-03-12 21:04 ` [PATCH wireless-next v3 02/15] wifi: cfg80211: cancel pmsr_free_wk in cfg80211_pmsr_wdev_down Stern, Avraham
2026-03-20 18:20 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 03/15] wifi: cfg80211: Add MAC address filter to remain_on_channel Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 04/15] wifi: cfg80211/mac80211: Add NL80211_IFTYPE_PD for PD PASN and PMSR operations Peddolla Harshavardhan Reddy
2026-03-12 21:06 ` Stern, Avraham
2026-03-20 18:25 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 05/15] wifi: cfg80211: add start/stop proximity detection commands Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 06/15] wifi: cfg80211: add proximity detection capabilities to PMSR Peddolla Harshavardhan Reddy
2026-03-12 21:08 ` Stern, Avraham
2026-03-20 18:33 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 07/15] wifi: cfg80211: add continuous ranging and PD request support Peddolla Harshavardhan Reddy
2026-03-12 21:11 ` Stern, Avraham
2026-03-20 18:53 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 08/15] wifi: cfg80211: extend PMSR FTM response for proximity ranging Peddolla Harshavardhan Reddy
2026-03-12 21:13 ` Stern, Avraham
2026-03-05 16:07 ` [PATCH wireless-next v3 09/15] wifi: cfg80211: add role-based PD peer limits Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 10/15] wifi: cfg80211: add ingress/egress distance thresholds for FTM Peddolla Harshavardhan Reddy
2026-03-12 21:14 ` Stern, Avraham
2026-03-20 19:18 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 11/15] wifi: cfg80211: add PD-specific preamble and bandwidth capabilities Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 12/15] wifi: cfg80211: add FTM range report negotiation support Peddolla Harshavardhan Reddy
2026-03-12 21:15 ` Stern, Avraham
2026-03-20 19:00 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 13/15] wifi: cfg80211: add result reporting control for PD requests Peddolla Harshavardhan Reddy
2026-03-12 21:16 ` Stern, Avraham
2026-03-20 19:04 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 14/15] wifi: cfg80211: add LTF keyseed support for secure ranging Peddolla Harshavardhan Reddy
2026-03-15 8:22 ` Stern, Avraham
2026-03-20 19:10 ` Peddolla Harshavardhan Reddy
2026-03-05 16:07 ` [PATCH wireless-next v3 15/15] wifi: mac80211_hwsim: Add support for extended FTM ranging Peddolla Harshavardhan Reddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260305160712.1263829-3-peddolla.reddy@oss.qualcomm.com \
--to=peddolla.reddy@oss.qualcomm.com \
--cc=johannes@sipsolutions.net \
--cc=kavita.kavita@oss.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox