* [PATCH wireless] wifi: mac80211: drop the monitor filter counts on stop, not just sometimes
@ 2026-08-25 4:37 Devin Wittmayer
2026-09-04 7:49 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Devin Wittmayer @ 2026-08-25 4:37 UTC (permalink / raw)
To: Johannes Berg
Cc: Alexander Wetzel, Felix Fietkau, linux-wireless, linux-kernel
Bringing a monitor up raises the filter counts that track what userspace
asked to see: frames that failed their checksum, control frames, other-BSS
traffic. Taking it down again should lower them.
The rise happens for every monitor. The fall sits inside the branch that
retires the virtual monitor, so it is skipped for an active monitor, and
on any driver setting NO_VIRTUAL_MONITOR. For those, every up and down
leaves another increment behind.
So once anything has asked to see frames that failed their checksum, the
hardware keeps handing them up long afterwards, to monitors that never
asked for them. The other counts accumulate the same way, including the
one that keeps TX status reporting armed once it has been used.
Changing the flags on a running monitor still balances, so the
accumulation boils down to the open and stop pair.
Reproduced on mac80211_hwsim: an active monitor brought up and down
leaves one unmatched increment behind, while a passive monitor on the
same phy balances.
The two sides matched until cooked monitor support was taken off the
heat. The decrement got baked into the new conditional along with the
virtual monitor bookkeeping and never came back out. Move it out again
so it mirrors the increment.
Fixes: 286e69677065 ("wifi: mac80211: Drop cooked monitor support")
Cc: stable@vger.kernel.org
Signed-off-by: Devin Wittmayer <lucid_duck@justthetip.ca>
---
net/mac80211/iface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 43460a705a6b..6fc01d85eea9 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -629,9 +629,9 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
local->hw.conf.flags &= ~IEEE80211_CONF_MONITOR;
hw_reconf_flags |= IEEE80211_CONF_CHANGE_MONITOR;
}
-
- ieee80211_adjust_monitor_flags(sdata, -1);
}
+
+ ieee80211_adjust_monitor_flags(sdata, -1);
break;
case NL80211_IFTYPE_NAN:
/* Check if any open NAN_DATA interfaces */
--
2.55.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH wireless] wifi: mac80211: drop the monitor filter counts on stop, not just sometimes
2026-08-25 4:37 [PATCH wireless] wifi: mac80211: drop the monitor filter counts on stop, not just sometimes Devin Wittmayer
@ 2026-09-04 7:49 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2026-09-04 7:49 UTC (permalink / raw)
To: Devin Wittmayer
Cc: Alexander Wetzel, Felix Fietkau, linux-wireless, linux-kernel
On Mon, 2026-08-24 at 21:37 -0700, Devin Wittmayer wrote:
> Bringing a monitor up raises the filter counts that track what userspace
> asked to see: frames that failed their checksum, control frames, other-BSS
> traffic. Taking it down again should lower them.
Seems legit, but ...
> The rise happens for every monitor. The fall sits inside the branch that
> retires the virtual monitor, so it is skipped for an active monitor, and
> on any driver setting NO_VIRTUAL_MONITOR. For those, every up and down
> leaves another increment behind.
>
> So once anything has asked to see frames that failed their checksum, the
> hardware keeps handing them up long afterwards, to monitors that never
> asked for them. The other counts accumulate the same way, including the
> one that keeps TX status reporting armed once it has been used.
>
> Changing the flags on a running monitor still balances, so the
> accumulation boils down to the open and stop pair.
>
> Reproduced on mac80211_hwsim: an active monitor brought up and down
> leaves one unmatched increment behind, while a passive monitor on the
> same phy balances.
>
> The two sides matched until cooked monitor support was taken off the
> heat. The decrement got baked into the new conditional along with the
> virtual monitor bookkeeping and never came back out. Move it out again
> so it mirrors the increment.
Ugh. Please rewrite this manually to not just be LLM fluff, to be
something one can actually consume at human speed.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-04 7:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-25 4:37 [PATCH wireless] wifi: mac80211: drop the monitor filter counts on stop, not just sometimes Devin Wittmayer
2026-09-04 7:49 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®