DragonFlyBSD Kernel Audit
← triage · dashboard
DF-2888

vcnt()/vcnt_intr() accumulate u_int per-CPU counters into signed int, wrapping vm.stats.* exports negative after 2^31 aggregate events

Field Value
ID DF-2888
Status new
Severity Info
CVSS 3.1 CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:N
CWE CWE-192 Integer Coercion Error
File sys/vm/vm_meter.c
Lines 245-253, 259-272
Area vm
Confidence certain
Discovered 2026-09-02
Pass 2 (GLM 5.3 second pass)
Bucket base:vm
Reported pending
Known CVE none
CVE match novel

Summary

Every vm.stats.sys. and vm.stats.vm. counter is exported by vcnt(), which declares int count and sums u_int per-CPU fields across all CPUs; vcnt_intr() likewise. Once the cross-CPU sum exceeds 2^31 (or any single CPU's counter passes 2^31 — reachable in days on a busy box at ~10k ctx switches/s/CPU), the exported value wraps negative/incorrect. Correctness/hardening in exported accounting only — the int goes straight to userland stat consumers (systat, top) with no in-kernel reader; no security impact. Fix: accumulate u64, export u_int (row diff).

Timeline

  • 2026-09-02 Discovered during pass-2 audit of vm_meter.c (GLM 5.3).

Discussion (0)

No comments yet.