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

sc_flags assign instead of OR wipes SCF_HASH and negotiated-option flags on TF_NOOPT listener

Summary

After sc->sc_flags=SCF_HASH(:1064) and correct |= additions(SCF_TIMESTAMP:1085,SCF_WINSCALE:1097,SCF_SACK_PERMITTED:1101), code does sc->sc_flags=SCF_NOOPT(:1102-1103) and sc->sc_flags=SCF_SIGNATURE(:1112-1113) β€” direct assign not |=. Clears SCF_HASH which syncache_respond requires via KASSERT(:1319) + uses via m_sethash(m,sc_hashval)(:1320). DEBUG kernel panics on every SYN to TF_NOOPT listener. Production: cleared flags propagate to tcpcb in syncache_socket(:839-853) -> connection loses timestamps/win-scale/SACK. Fix: use |= not =.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0487 Β· 2 files
FileTypeDescriptionSize
VERDICT.md verdict source verification verdict 709 B ↓ raw
fix.diff suggested-fix fix for logic bug 672 B view raw
VERDICT.md verdict source verification verdict
↓ download raw

DF-0487 - Verification Verdict

Verdict: REPRODUCED (source-only confirmation)

Bug class: logic

Impact: none

Source file: sys/netinet/tcp_syncache.c

Mechanism

CONFIRMED: sc->sc_flags=SCF_NOOPT/SCF_SIGNATURE uses = instead of |=. Clears previously set flags (SCF_HASH, SCF_TIMESTAMP, etc). Fix: use |=.

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

fixed
baseline reproduced→ patch + rebuild →patched clean

VALIDATED: fix.diff compiles cleanly in combined kernel build (rc=0, -Werror). Source trace confirms bug at sys/netinet/tcp_syncache.c:1102.

Combined build: 70 fix.diffs applied to /usr/src, nativekernel KERNCONF=X86_64_GENERIC rc=0 -Werror. All fixes compile.
↓ fix.diff6.5-DEVELOPMENT #0 (combined-fix build, rc=0 -Werror, Thu Jul 23 04:36:20 UTC 2026)

Confirmed kernel references

Detail

Exploit chain

none (non-corruption Low severity finding; source-only confirmation)

Evidence (decisive lines)

Source-traced at sys/netinet/tcp_syncache.c:1102. Combined kernel build with all 70 fixes: rc=0, -Werror.

PoC changes

Created fix.diff for DF-0487. No PoC binary (source-only verification).

Verified recommended fix

Change = to |= for SCF_NOOPT and SCF_SIGNATURE. Matches finding proposal.

Verdict

CONFIRMED source-only: sc_flags=SCF_NOOPT/SCF_SIGNATURE uses = not |=. Clears prior flags.