Files
claude-noether af4b52affc bes2600: pre-empt AP-deauth-6 with mac80211 reassoc on decrypt-fail storm
When the BES2600 firmware reports WSM_STATUS_DECRYPTFAILURE for a burst
of received frames (typically because the host's PTK or GTK has fallen
out of sync with the AP), the AP eventually concludes that the STA is
not authenticated and emits an unprotected deauth-reason-6 ("Class 2
frame received from non-authenticated station"). On the deployed
pinetab2 + bes2600 stack this AP-initiated deauth has been observed to
leave the link blackholed for up to 109 s before userspace finds a
different SSID/channel to recover on. (Receipts at
https://git.reauktion.de/marfrit/besser, notes/phase5-2026-05-06.md.)

Add a sliding-window counter on each bes2600_vif: when 5 decrypt
failures fire within 5 s, schedule a worker that calls
ieee80211_connection_loss(vif). mac80211 then performs immediate
disassociation; userspace (NetworkManager / wpa_supplicant) reconnects
with fresh keys before the AP gets a chance to fire its unprotected
deauth.

Predicted Phase 7 delta vs the unpatched baseline:
- decrypt-burst rate: unchanged (this does not address root cause)
- AP-deauth-6 rate: <= 0.2 of baseline
- conditional probability of >5s blackhole given a burst:
  100% -> <= 10%
- worst-case recovery time: 109s -> <5s

Contract pin: ieee80211_connection_loss() per
include/net/mac80211.h: "may also be called if the connection needs to
be terminated for some other reason... will cause immediate change to
disassociated state, without connection recovery attempts." Userspace
recovery is the existing NM/wpa_supplicant path. The worker context
satisfies the implicit process-context expectation.

Files touched:
- bes2600/bes2600.h: 4 new fields on struct bes2600_vif + 2 prototypes
- bes2600/txrx.c: new helpers + the call site at the existing
  WSM_STATUS_DECRYPTFAILURE log point (the unconditional "goto drop"
  branch in bes2600_rx_cb)
- bes2600/sta.c: bes2600_decrypt_storm_init() in bes2600_vif_setup;
  cancel_work_sync() in bes2600_remove_interface, alongside the
  existing per-vif cancel_*_work_sync block. Safe under the kernel
  cancel_work_sync contract: the work_struct is INIT_WORK'd in setup,
  so the call is valid; it blocks until any in-flight handler returns,
  ensuring no use-after-free of priv when mac80211 frees the vif; and
  it is idempotent (subsequent calls just return false).
- bes2600/debug.c: DecryptStormRecoveries seq_printf in the per-vif
  status seq_file output

Threshold (5/5s) is set well above the steady-state per-vif decrypt-
fail rate observed in measurement (~1/min even under sustained 1 MB/s
load), so a true storm is required to trip it. The cw1200/cw1260
ancestor has no equivalent storm-recovery; this is a clean addition.

checkpatch.pl --no-tree --strict: clean (0/0/0).

Signed-off-by: Claude (noether) <claude@reauktion.de>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 20:43:42 +02:00
..
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00
2025-09-17 16:35:45 +02:00