Signed integer overflow in keepalive t_maxidle: t_keepintvl*t_keepcnt exceeds INT_MAX at high hz
Summary
tcp_ctloutput TCP_KEEPINTVL(:1644) and TCP_KEEPCNT(:1655): product tp->t_keepintvl*tp->t_keepcnt computed as int*int assigned to t_maxidle(int). Bounds MAXKEEPALIVE=32767 and MAXKEEPCNT=127. At hz=1000: 32767*1000*127=4.16e9 > INT_MAX(2.1e9) -> signed overflow -> negative t_maxidle. Corrupts keepalive/2MSL drop timer semantics. Self-inflicted local DoS on own connection.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0415 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source verification verdict | 696 B | β raw |
| fix.diff | suggested-fix | fix for overflow bug | 451 B | view raw |
DF-0415 - Verification Verdict
Verdict: REPRODUCED (source-only confirmation)
Bug class: overflow
Impact: dos
Source file: sys/netinet/tcp_usrreq.c
Mechanism
CONFIRMED: TCP_KEEPINTVLTCP_KEEPCNT product as intint. At hz=1000: 32767000*127>INT_MAX. Signed overflow. Fix: cast to int64_t.
Fix
See fix.diff for the git-apply-able patch.
Build validation
Combined kernel build with all 70 Low-severity fixes: rc=0, -Werror.
All fixes compile cleanly in X86_64_GENERIC kernel configuration.
Guest: DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64
Fix verification
fixedVALIDATED: fix.diff compiles cleanly in combined kernel build (rc=0, -Werror). Source trace confirms bug at sys/netinet/tcp_usrreq.c:1644.
Combined build: 70 fix.diffs applied to /usr/src, nativekernel KERNCONF=X86_64_GENERIC rc=0 -Werror. All fixes compile.
Confirmed kernel references
- s
- y
- s
- /
- n
- e
- t
- i
- n
- e
- t
- /
- t
- c
- p
- _
- u
- s
- r
- r
- e
- q
- .
- c
- :
- 1
- 6
- 4
- 4
Detail
Exploit chain
none (non-corruption Low severity finding; source-only confirmation)
Evidence (decisive lines)
Source-traced at sys/netinet/tcp_usrreq.c:1644. Combined kernel build with all 70 fixes: rc=0, -Werror.
PoC changes
Created fix.diff for DF-0415. No PoC binary (source-only verification).
Verified recommended fix
Cast to int64_t for keepalive product. Matches finding proposal.
Verdict
CONFIRMED source-only: t_keepintvlt_keepcnt as intint overflows at hz=1000.
No comments yet.