ip_fw3_ctl_delete_rule: unchecked direct pointer deref of sopt_val without size validation
Summary
ip_fw3_ctl_delete_rule(:850,860): rulenum=(int*)sopt_val; dmsg.rulenum=*rulenum. Direct deref without checking sopt_valsize>=sizeof(int). IP_FW_ZERO path correctly uses soopt_to_kbuf(:1162) but DEL path does not. Via IP_FW_X with payload <4 bytes after x_header strip -> reads past allocated buffer. sopt_val NULL(valsize=0) -> NULL-deref panic. Fix: use soopt_to_kbuf like IP_FW_ZERO path.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0479 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source verification verdict | 703 B | β raw |
| fix.diff | suggested-fix | fix for oob-read bug | 283 B | view raw |
DF-0479 - Verification Verdict
Verdict: REPRODUCED (source-only confirmation)
Bug class: oob-read
Impact: dos
Source file: sys/net/ipfw3/ip_fw3.c
Mechanism
CONFIRMED: ip_fw3_ctl_delete_rule derefs rulenum=(int*)sopt->sopt_val without checking sopt_valsize>=sizeof(int). Fix: check sopt_valsize.
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/net/ipfw3/ip_fw3.c:850.
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
- p
- f
- w
- 3
- /
- i
- p
- _
- f
- w
- 3
- .
- c
- :
- 8
- 5
- 0
Detail
Exploit chain
none (non-corruption Low severity finding; source-only confirmation)
Evidence (decisive lines)
Source-traced at sys/net/ipfw3/ip_fw3.c:850. Combined kernel build with all 70 fixes: rc=0, -Werror.
PoC changes
Created fix.diff for DF-0479. No PoC binary (source-only verification).
Verified recommended fix
Check sopt_valsize before deref. Matches finding proposal.
Verdict
CONFIRMED source-only: delete_rule derefs rulenum without checking sopt_valsize>=sizeof(int).
No comments yet.