From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>,
Sasha Levin <sashal@kernel.org>,
johannes@sipsolutions.net, linux-wireless@vger.kernel.org
Subject: [PATCH AUTOSEL 6.18-6.12] wifi: cfg80211: use cfg80211_leave() in iftype change
Date: Sat, 6 Dec 2025 09:02:16 -0500 [thread overview]
Message-ID: <20251206140252.645973-11-sashal@kernel.org> (raw)
In-Reply-To: <20251206140252.645973-1-sashal@kernel.org>
From: Johannes Berg <johannes.berg@intel.com>
[ Upstream commit 7a27b73943a70ee226fa125327101fb18e94701d ]
When changing the interface type, all activity on the interface has
to be stopped first. This was done independent of existing code in
cfg80211_leave(), so didn't handle e.g. background radar detection.
Use cfg80211_leave() to handle it the same way.
Note that cfg80211_leave() behaves slightly differently for IBSS in
wireless extensions, it won't send an event in that case. We could
handle that, but since nl80211 was used to change the type, IBSS is
rare, and wext is already a corner case, it doesn't seem worth it.
Link: https://patch.msgid.link/20251121174021.922ef48ce007.I970c8514252ef8a864a7fbdab9591b71031dee03@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## 2. CODE CHANGE ANALYSIS
Looking at the diff and comparing with `cfg80211_leave()`:
**Original inline switch did:**
- AP/P2P_GO: `cfg80211_stop_ap()`
- ADHOC: `cfg80211_leave_ibss(rdev, dev, false)` - note the `false`
parameter
- STATION/P2P_CLIENT: `cfg80211_disconnect()`
- MESH_POINT: **nothing** (just a comment "mesh should be handled?")
- OCB: `cfg80211_leave_ocb()`
**`cfg80211_leave()` additionally does:**
1. `cfg80211_pmsr_wdev_down(wdev)` - **new cleanup**
2. `cfg80211_stop_background_radar_detection(wdev)` - **mentioned bug
fix**
3. For ADHOC: uses `true` instead of `false` (changes wext event
behavior)
4. For STATION/P2P_CLIENT: stops scheduled scans + wext cleanup
5. For MESH_POINT: `cfg80211_leave_mesh()` - **fixes the TODO bug**
## 3. CLASSIFICATION
This is primarily a **code refactoring/consolidation** that:
- Fixes bugs: background radar detection not stopped, MESH_POINT not
handled
- Changes behavior: IBSS wext event, additional scheduled scan cleanup,
pmsr cleanup
- The author explicitly acknowledges behavioral differences but
considers them "not worth" fixing
## 4. SCOPE AND RISK ASSESSMENT
- **Lines:** Removes ~20 lines, replaces with single function call (net
negative)
- **Files:** 1 file (net/wireless/util.c)
- **Risk:** Medium - introduces behavioral changes beyond the stated bug
fixes
The behavioral differences acknowledged by the author are concerning for
stable:
- IBSS with wext will behave differently (no event sent)
- Additional cleanup operations are now performed
## 5. USER IMPACT
The bugs fixed (background radar detection, mesh point handling) are
real but:
- Not crashes or security issues
- More like "incomplete state cleanup" issues
- Impact is limited to users changing interface types
## 6. STABILITY INDICATORS
**Missing stable signals:**
- No `Cc: stable@vger.kernel.org` tag
- No `Fixes:` tag pointing to when bug was introduced
- Author explicitly noted behavioral differences but chose not to
address them
## 7. DEPENDENCY CHECK
The change depends on `cfg80211_leave()` having the current
implementation with all the necessary handlers.
## Summary
While this commit does fix real issues (background radar detection not
stopped, MESH_POINT not handled), it's fundamentally a **code
consolidation** that:
1. **Introduces behavioral changes** beyond the bug fixes (IBSS wext
events, additional cleanup operations)
2. **Lacks explicit stable request** from the maintainer (Johannes Berg)
3. **Author acknowledged** behavioral differences but chose not to fix
them
4. The bugs fixed are **not crashes, security issues, or data
corruption** - they're incomplete state cleanup issues
The maintainer deliberately did not add a `Cc: stable` or `Fixes:` tag,
suggesting this wasn't intended for backporting. The behavioral changes
(IBSS wext, scheduled scan cleanup, pmsr cleanup) go beyond the stated
bug fixes and could introduce unexpected regressions in stable trees.
This is code cleanup/improvement material, not targeted stable-critical
bug fix material.
**NO**
net/wireless/util.c | 23 +----------------------
1 file changed, 1 insertion(+), 22 deletions(-)
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 56724b33af045..4eb028ad16836 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1203,28 +1203,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
dev->ieee80211_ptr->use_4addr = false;
rdev_set_qos_map(rdev, dev, NULL);
- switch (otype) {
- case NL80211_IFTYPE_AP:
- case NL80211_IFTYPE_P2P_GO:
- cfg80211_stop_ap(rdev, dev, -1, true);
- break;
- case NL80211_IFTYPE_ADHOC:
- cfg80211_leave_ibss(rdev, dev, false);
- break;
- case NL80211_IFTYPE_STATION:
- case NL80211_IFTYPE_P2P_CLIENT:
- cfg80211_disconnect(rdev, dev,
- WLAN_REASON_DEAUTH_LEAVING, true);
- break;
- case NL80211_IFTYPE_MESH_POINT:
- /* mesh should be handled? */
- break;
- case NL80211_IFTYPE_OCB:
- cfg80211_leave_ocb(rdev, dev);
- break;
- default:
- break;
- }
+ cfg80211_leave(rdev, dev->ieee80211_ptr);
cfg80211_process_rdev_events(rdev);
cfg80211_mlme_purge_registrations(dev->ieee80211_ptr);
--
2.51.0
next prev parent reply other threads:[~2025-12-06 14:03 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-06 14:02 [PATCH AUTOSEL 6.18-6.1] ksmbd: fix use-after-free in ksmbd_tree_connect_put under concurrency Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.12] fs/ntfs3: check for shutdown in fsync Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.1] smb/server: fix return value of smb2_ioctl() Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.1] gfs2: Fix use of bio_chain Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-5.10] Bluetooth: btusb: Add new VID/PID 13d3/3533 for RTL8821CE Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.12] Bluetooth: btusb: Add new VID/PID 0x0489/0xE12F for RTL8852BE-VT Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-5.10] btrfs: scrub: always update btrfs_scrub_progress::last_physical Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.12] wifi: rtl8xxxu: Fix HT40 channel config for RTL8192CU, RTL8723AU Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.12] Bluetooth: btusb: MT7920: Add VID/PID 0489/e135 Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.12] Bluetooth: btusb: MT7922: Add VID/PID 0489/e170 Sasha Levin
2025-12-06 14:02 ` Sasha Levin [this message]
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.1] kbuild: Use objtree for module signing key path Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.1] wifi: brcmfmac: Add DMI nvram filename quirk for Acer A1 840 tablet Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-5.10] hfsplus: Verify inode mode when loading from disk Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.6] gfs2: fix remote evict for read-only filesystems Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.17] Bluetooth: btusb: add new custom firmwares Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18] hfsplus: fix volume corruption issue for generic/101 Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-5.10] hfsplus: fix missing hfs_bnode_get() in __hfs_bnode_create Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-5.10] hfsplus: fix volume corruption issue for generic/070 Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-5.15] fs/ntfs3: Support timestamps prior to epoch Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.6] Bluetooth: btusb: Add new VID/PID 2b89/6275 for RTL8761BUV Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.6] ntfs: set dummy blocksize to read boot_block when mounting Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-5.10] hfsplus: fix volume corruption issue for generic/073 Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.12] wifi: mt76: mt792x: fix wifi init fail by setting MCU_RUNNING after CLC load Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.12] gfs2: Fix "gfs2: Switch to wait_event in gfs2_quotad" Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.12] wifi: cfg80211: stop radar detection in cfg80211_leave() Sasha Levin
2025-12-06 14:55 ` Johannes Berg
2025-12-06 22:49 ` Sasha Levin
2025-12-06 14:02 ` [PATCH AUTOSEL 6.18-6.6] ksmbd: vfs: fix race on m_flags in vfs_cache Sasha Levin
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=20251206140252.645973-11-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.