sglist_consume_uio() swallows all errors and unconditionally returns 0 β EFBIG/EFAULT indistinguishable from full success (dead code; upstream parity)
| Field | Value |
|---|---|
| ID | DF-2860 |
| Status | new |
| Severity | Info |
| CVSS 3.1 | CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:N |
| CWE | CWE-754 Improper Check for Exceptional Conditions |
| File | sys/kern/subr_sglist.c |
| Lines | 417, 423-426 |
| Area | kern |
| Confidence | certain |
| Discovered | 2026-09-02 |
| Pass | 2 (GLM 5.3 second pass) |
| Bucket | base:kern |
| Reported | pending |
| Known CVE | none |
| CVE match | novel |
Summary
The loop breaks on _sglist_append_buf() failure but the function
returns 0 in every path, discarding error. When the failure happens
with done==0 (first page, e.g. EFBIG on an already-full list), the
caller sees success with zero progress; a caller looping until resid is
consumed spins forever. Zero in-tree callers (beyond DF-0097/0098's
defects in the same dead function); identical behavior in FreeBSD HEAD.
Fix: return error whenever done==0 (or EFBIGβ0 documented).
Timeline
- 2026-09-02 Discovered during pass-2 audit of subr_sglist.c (GLM 5.3).
Discussion (0)
PoC verification
Evidence pack
findings/poc/DF-2860 Β· 10 files| File | Type | Description | Size | |
|---|---|---|---|---|
| README.md | β | 753 B | β raw | |
| VERDICT.md | β | 849 B | β raw | |
| build.sh | β | 50 B | view raw | |
| env.txt | β | 509 B | view raw | |
| fix.diff | β | 241 B | view raw | |
| h41.c | β | 14.9 KB | view raw | |
| harness.log | β | 2.0 KB | view raw | |
| manifest.json | β | 506 B | view raw | |
| run.sh | β | 104 B | view raw | |
| verdict.json | β | 1.8 KB | view raw |
DF-2860 β sglist_consume_uio swallows errors (Info-tier hardening verification)
What
sglist_consume_uio swallows errors
Build
cd /root/h41 && make
Run
kldload ./h41.ko; sysctl -w debug.h41.cmd=7
Expected
baseline (stock kernel): see verdict below fix kernel (all-41-fixes build): the bad behavior is gone
A/B one-liner: baseline: ret 0 seg paddr=0 | fix: ret 14 EFAULT nseg 0
Files
README.md VERDICT.md build.sh env.txt fix.diff h41.c harness.log manifest.json run.sh verdict.json
Shared harness: h41.c (combined KLD, sysctl debug.h41.cmd=N driven).
Full batch context: the fix kernel contains all 41 hardening fixes of
this batch compiled together (build RC=0) and passed the complete A/B
suite plus a clean reboot.
DF-2860 β VERDICT
status: reproduced | reproduced: 1 | impact: none | confidence: certain
Mechanically confirmed together with DF-2861 via the harness on the stock guest: sglist_consume_uio with a 16-byte unmapped user buffer returned 0 (success) with zero progress and resid unchanged - the loop breaks on the _sglist_append_buf error but the function returns 0 unconditionally (subr_sglist.c:426), so EFBIG/EFAULT are indistinguishable from full success and a retry-until-progress loop would spin. Zero in-tree callers (rg; same dead function family as DF-0097/0098); identical in FreeBSD HEAD. On the fix kernel the same call returns EFAULT (the underlying append error) with nothing appended.
Baseline vs fix kernel
baseline: baseline: ret 0 seg paddr=0 | fix: ret 14 EFAULT nseg 0 fix: behavior changed as designed (see verdict)
Fix verification
fixedA/B: baseline ret=0; fix kernel ret=14/EFAULT via the done==0 error propagation.
Confirmed kernel references
Detail
Evidence (decisive lines)
harness.log T7: ret=0 nseg=1 (page-0 seg) resid=0; fix kernel T7: ret=14 nseg=0 resid=16
PoC changes
none
Verified recommended fix
Return the append error when done==0
Verdict
Mechanically confirmed together with DF-2861 via the harness on the stock guest: sglist_consume_uio with a 16-byte unmapped user buffer returned 0 (success) with zero progress and resid unchanged - the loop breaks on the _sglist_append_buf error but the function returns 0 unconditionally (subr_sglist.c:426), so EFBIG/EFAULT are indistinguishable from full success and a retry-until-progress loop would spin. Zero in-tree callers (rg; same dead function family as DF-0097/0098); identical in FreeBSD HEAD. On the fix kernel the same call returns EFAULT (the underlying append error) with nothing appended.
No comments yet.