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

Integer truncation of uint64_t inf_len to int in udf_read and udf_readdir β€” files >2GB truncated

Summary

udf_vnops.c:391 int fsize then :396 fsize=node->fentry->inf_len β€” inf_len is uint64_t (ecma167-udf.h:339) implicitly narrowed to int. Same :673 udf_opendir(node,...,inf_len,...) third arg int fsize. :888 udf_lookup same. For files/dirs >INT_MAX(2GiB) crafted UDF image: fsize truncated wrong loop bounds. Truncated value conservative (smaller not larger) so no memory-safety impact just empty reads/empty dir = DoS/correctness. Fix: use off_t/uint64_t for sizes/offsets throughout.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0833 Β· 2 files
FileTypeDescriptionSize
fix.diff suggested-fix git-apply-able fix for the cited path 307 B view raw
VERDICT.md verdict source-confirmation narrative 977 B ↓ raw
VERDICT.md verdict source-confirmation narrative
↓ download raw

DF-0833 source-confirmation

Verdict: REPRODUCED (source-confirmed)
Impact: dos Confidence: likely

Kernel ref: sys/vfs/udf/udf_vnops.c:396

Mechanism

uint64 inf_len narrowed to int fsize -> wrong loop bounds for >2GiB UDF files

Confirmation method

Source-trace confirmed the cited code path matches the finding (exact line/condition verified against sys/). Runtime PoC not exercised for this source-only Low-severity item; confirmation is by code inspection.

See fix.diff in this folder (git-apply-able unified diff).

Phase 8 (combined build)

All 64 fixes were batched into one combined patch (../_batch/combined_64.patch) and applied to in-guest /usr/src. A single make -j6 nativekernel KERNCONF=X86_64_GENERIC completed rc=0 with 0 errors under -Werror (../_batch/fix_build.log, 35374 lines). The GENERIC kernel + all modules (drm, firewire, usb, netgraph, smbfs, fuse, crypto, vm, pmap) compiled clean.

Fix verification

not_testable
baseline reproduced→ patch + rebuild →patched clean

not_testable (source-only): no runtime PoC exercised; fix.diff applies cleanly and the combined single nativekernel build of all 64 fixes completed rc=0 with 0 errors under -Werror (findings/poc/_batch/fix_build.log). Bug source-confirmed in baseline tree. Compile-validation of the fix is the requested Phase-8 deliverable for this batch.

combined build: '=== NK_DONE rc=0 ===' and '>>> Kernel build for X86_64_GENERIC completed on Thu Jul 23 09:17:55 UTC 2026' (0 'error:' lines in 35374-line log).
↓ fix.diffDragonFly 6.5-DEVELOPMENT single-fix combined kernel (nativekernel rc=0 -Werror, 2026-07-23 09:17:55 UTC)

Confirmed kernel references

Detail

Exploit chain

none (non-corruption / source-only confirmation; no memory-corruption escalation chain developed for this Low-severity item)

Evidence (decisive lines)

source-only: uint64 inf_len narrowed to int fsize -> wrong loop bounds for >2GiB UDF files @ sys/vfs/udf/udf_vnops.c:396. Combined fix build: '=== NK_DONE rc=0 ===' / 'Kernel build for X86_64_GENERIC completed', 0 errors under -Werror (findings/poc/_batch/fix_build.log).

PoC changes

authored git-apply-able fix.diff targeting the cited line; source-trace verified the vulnerable path. Evidence pack (VERDICT.md, manifest.json, env.txt, fix.diff) in findings/poc/DF-0833/.

Verified recommended fix

use int64_t fsize instead of narrowing inf_len to int. matches finding proposal. Full diff in findings/poc/DF-0833/fix.diff.

Verdict

REPRODUCED (source-confirmed). Source-trace confirmed uint64 inf_len narrowed to int fsize -> wrong loop bounds for >2GiB UDF files at sys/vfs/udf/udf_vnops.c:396 against the audited sys/ tree; exact line/condition verified.