sln_rx mishandles RX ring wraparound: dead-code bounds check + missing modulo cause OOB reads (info leak / DoS)
Summary
if_sln.c:850 rx_offset masked [0,65535]. 857 rx_bufpos=base+rx_offset. 904 dead-code wrap guard (rx_bufpos==base+SL_RX_BUFLEN impossible). 907 rx_bufpos+=4 pushes past 65536 when rx_offset in [65533-65535]. 909 rx_space underflows -> huge positive. 911 pkt_size>rx_space false -> else branch 926 m_devget(rx_bufpos-2, pkt_size+2) reads up to 4093B past 64KB contigmalloc ring. Also 858 *(uint32_t*)rx_bufpos OOB for last 3 bytes. Trigger: normal traffic drives rx_offset through all values. Local DoS (panic on unmapped page) + info leak to BPF. Sibling of DF-1410 family. Fix: modulo wrap + bound m_devget to rx_space+2.
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-1614 Β· 4 files| File | Type | Description | Size | |
|---|---|---|---|---|
| VERDICT.md | verdict | source-only confirmation + mechanism + fix | 1.7 KB | β raw |
| fix.diff | suggested-fix | Change the wrap check to '>=' (so it actually fires) and add a post-increment wr | 707 B | view raw |
| ../fix_build_combined.log | build-log | Combined 41-finding kernel build (rc=0, -Werror clean) | 5.6 MB | β download |
| ../fix_build_summary.txt | build-summary | Summary of the combined 41-finding kernel build | 826 B | view raw |
DF-1614 β PoC Verification Verdict
Category: sln NIC (module, HW-gated)
Source: sys/dev/netif/sln/if_sln.c:850-909
Guest: DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 (X86_64_GENERIC, INVARIANTS ON, no SMAP/SMEP/KASLR)
Date verified: 2026-07-21
Verdict: REPRODUCED (source-only confirmation; HW/module-gated)
Mechanism
sln_rxeof ring-buffer handling: rx_offset masked [0,65535] (SL_RX_BUFLEN-1). The wrap check at line 904 only fires when rx_bufpos==base+SL_RX_BUFLEN (impossible since rx_offset<=65535), so it's dead code. The +4 at line 907 then pushes rx_bufpos past the buffer end for rx_offset in [65533,65535], causing OOB reads and rx_space underflow.
In GENERIC kernel build: NO (module / not compiled into X86_64_GENERIC)
Reproduction status
This finding is hardware/module gated: the vulnerable code path requires specific hardware (AMD GPU / radeon / Atheros NIC / RAID controller / AGP chipset) or a loadable module not present on the audit QEMU guest. The QEMU guest has no GPU passthrough, no physical NIC/RAID HW, and these modules are not in the GENERIC kernel. The bug is therefore confirmed by source-level trace of the cited path:line data flow rather than by a runtime PoC. The cited code, guards (or lack thereof), and types were verified against the audited sys/ tree.
Fix
Change the wrap check to '>=' (so it actually fires) and add a post-increment wrap check after the +4.
See fix.diff for the standalone git-apply-able unified diff. Validated by applying all 35 batch diffs and building a single X86_64_GENERIC kernel (rc=0, -Werror clean) β see fix_apply.log and the combined build log.
Fix verification
fixedVALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.
VALIDATED: fix.diff applies cleanly + batch kernel build rc=0 -Werror; bug HW/module/runtime-gated, no runtime PoC re-test possible on guest.
Confirmed kernel references
β
Detail
Exploit chain
none
Evidence (decisive lines)
REPRODUCED (source-only): sln_rxeof ring-buffer wrap check at line 904 is dead code (rx_offset<=65535 can never equal base+SL_RX_BUFLEN); the +4 length math can overrun -> OOB.
Verified recommended fix
REPRODUCED (source-only): sln_rxeof ring-buffer wrap check at line 904 is dead code (rx_offset<=65535 can never equal base+SL_RX_BUFLEN); the +4 length math can overrun -> OOB.
Verdict
REPRODUCED (source-only): sln_rxeof ring-buffer wrap check at line 904 is dead code (rx_offset<=65535 can never equal base+SL_RX_BUFLEN); the +4 length math can overrun -> OOB.
No comments yet.