rtredirect_oncpu ignores rt_setgate return: routes redirect that failed or self-targets
Summary
rtredirect_oncpu(:421-430) gateway-smash: rt_setgate(rt,rt_key(rt),gateway) return discarded. EADDRNOTAVAIL: rt_setgate already deleted route (rtrequest RTM_DELETE) then rtredirect reports stat=rts_newgateway and sends RTM_CHANGE for removed route -> routing table inconsistency. ENOBUFS: silently swallows alloc failure. Malicious on-link router sends ICMP redirect with gateway==dst. Contrast rtsock.c:933 checks return.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-0399 Β· 2 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source verification verdict | 717 B | β raw |
| fix.diff | suggested-fix | fix for logic bug | 501 B | view raw |
DF-0399 - Verification Verdict
Verdict: REPRODUCED (source-only confirmation)
Bug class: logic
Impact: none
Source file: sys/net/route.c
Mechanism
CONFIRMED: rtredirect_oncpu discards rt_setgate return. EADDRNOTAVAIL path: route already deleted but RTM_CHANGE sent for removed route. Fix: check return value.
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/route.c:427.
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
- /
- r
- o
- u
- t
- e
- .
- c
- :
- 4
- 2
- 7
Detail
Exploit chain
none (non-corruption Low severity finding; source-only confirmation)
Evidence (decisive lines)
Source-traced at sys/net/route.c:427. Combined kernel build with all 70 fixes: rc=0, -Werror.
PoC changes
Created fix.diff for DF-0399. No PoC binary (source-only verification).
Verified recommended fix
Check rt_setgate return value. Matches finding proposal.
Verdict
CONFIRMED source-only: rt_setgate return discarded. Route inconsistency on error path.
No comments yet.