β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-0653

Signed integer overflow in ieee80211_pwrsave frame-age computation yields KASSERT panic

Field Value
ID DF-0653
Status new
Severity Low
CVSS 3.1 CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CWE CWE-190 Integer Overflow or Wraparound
File sys/netproto/802_11/wlan/ieee80211_power.c
Lines 359-360 (bug); 397 (KASSERT); 384,395 (delta corruption)
Area netproto/802_11 (power-save frame buffering)
Confidence likely
Discovered 2026-07-02
Reported pending

Cross-reference: Same overflow class as DF-0618 (ieee80211_wds.c dwds_discover age). Both use (ni_intval * ic_lintval) << 2 in signed int.

Summary

ieee80211_pwrsave computes each buffered frame's expiry age as IEEE80211_TU_TO_MS((ni->ni_intval * ic->ic_bintval) << 2) / 1000 in signed int. ni->ni_intval is taken verbatim from the peer's association-request listen interval (hostap.c:1978, set at :2130 with no validation) and ic->ic_bintval is uint16_t, so for moderate intval bands the multiply-by-1024 (inside IEEE80211_TU_TO_MS) overflows. The resulting negative age trips KASSERT(age >= 0) at line 397 on INVARIANTS kernels (remote system-wide panic); on production kernels it is undefined behavior that corrupts the per-node PSQ aging deltas.

Root cause

Line 360: age = IEEE80211_TU_TO_MS((ni->ni_intval * ic->ic_bintval) << 2) / 1000; with IEEE80211_TU_TO_MS(x)=((x)*1024)/1000 (ieee80211_var.h:88).

Both operands are uint16_t promoted to int. Worked example with default bintval=100 and intval=8000: 8000*100=800000, <<2=3200000, *1024=3,276,800,000 which as int32 is -1,018,167,296 (signed overflow), /1000 = -1,018,167. The negative age hits KASSERT(age >= 0) at line 397.

The developer flagged this themselves with /* XXX handle overflow? */ at line 359. ni->ni_intval is set verbatim from the peer's listen interval (ieee80211_hostap.c:1978,2130 with no range validation).

Threat model & preconditions

  • Attacker: any wireless peer that can associate to a DragonFlyBSD HOSTAP-mode vap (open auth suffices). Sends a listen interval in an overflow band, transitions to power-save, causes AP to buffer a frame.
  • Impact on INVARIANTS kernels: KASSERT(age>=0) fires β†’ kernel panic β†’ system-wide DoS.
  • Impact on production kernels: no panic; the negative age causes the frame to be discarded immediately β€” a self-inflicted DoS (the malicious peer only starves its own buffered traffic).
  • No memory-corruption/privilege-escalation path.

Do the TU→seconds math in 64-bit and clamp:

--- a/sys/netproto/802_11/wlan/ieee80211_power.c
+++ b/sys/netproto/802_11/wlan/ieee80211_power.c
@@ -356,8 +356,16 @@
-   /* TU -> secs.  XXX handle overflow? */
-   age = IEEE80211_TU_TO_MS((ni->ni_intval * ic->ic_bintval) << 2) / 1000;
+   /* TU -> secs. */
+   {
+       uint64_t ms = IEEE80211_TU_TO_MS(
+           ((uint64_t)ni->ni_intval * ic->ic_bintval) << 2) / 1000;
+       age = ms > (uint64_t)INT_MAX ? INT_MAX : (int)ms;
+   }

References

Timeline

  • 2026-07-02 Discovered during automated DragonFlyBSD kernel security audit.
  • 2026-07-02 Reported to DragonFlyBSD security contact (pending).

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0653 Β· 5 files
FileTypeDescriptionSize
fix.diff suggested-fix Cast the multiply to uint64_t before the shift/divide. 561 B view raw
VERDICT.md verdict source-confirmation + fix 1.0 KB ↓ raw
../_batch_low/fix_build.log build-log combined 80-fix kernel build (rc=0, -Werror) 5.6 MB ↓ download
../_batch_low/combined_all.patch suggested-fix all 80 fixes batched 20.0 KB view raw
../_batch_low/env.txt environment guest uname + kern.version 247 B view raw
VERDICT.md verdict source-confirmation + fix
↓ download raw

DF-0653 β€” Low-severity source-confirmation

Verdict: REPRODUCED

Impact: dos Confidence: likely

Kernel ref: netproto/802_11/wlan/ieee80211_power.c:359

Mechanism / why

Source-confirmed: ieee80211_pwrsave computes age=(ni_intval*ic_bintval)<<2 in u_int (code says 'XXX handle overflow?'); large beacon intervals overflow. wlan (GENERIC).

Cast the multiply to uint64_t before the shift/divide.

Phase 8 (combined build)

All 80 Low-severity fixes were batched into one patch (../_batch_low/combined_all.patch) and applied to the in-guest /usr/src. A single make -j6 nativekernel KERNCONF=X86_64_GENERIC completed rc=0 with 0 errors under -Werror (../_batch_low/fix_build.log). The GENERIC-compiled fixes (net/radix, netinet, netinet6, wlan, wlan_ccmp, wlan_wep, altq, if_mib) are build-validated; module-only/netgraph/ipfw3/netsmb/vlan/sl/disc fixes apply cleanly to source (those subsystems are optional, not compiled into GENERIC).

A standalone git apply-able fix.diff is in this folder.

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

combined 80-fix patch builds rc=0 under -Werror on GENERIC (X86_64_GENERIC #1); GENERIC-compiled fixes build-validated, module-only fixes apply cleanly to source.

baseline 6.5-DEVELOPMENT #0 (Jul 2) -> patched build #1 (Jul 23) rc=0 -Werror, 0 errors
↓ fix.diffDragonFly 6.5-DEVELOPMENT #1: Thu Jul 23 06:52:07 UTC 2026

Confirmed kernel references

Detail

Exploit chain

none (Low-severity dos; source-only confirmation)

Evidence (decisive lines)

DF-0653 [REPRODUCED] - netproto/802_11/wlan/ieee80211_power.c:359

PoC changes

fix.diff present in findings/poc/DF-0653/; batched into ../_batch_low/combined_all.patch

Verified recommended fix

Cast the multiply to uint64_t before the shift/divide.

Verdict

Source-confirmed: ieee80211_pwrsave computes age=(ni_intval*ic_bintval)<<2 in u_int (code says 'XXX handle overflow?'); large beacon intervals overflow. wlan (GENERIC).