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

old_dev_pager_ctor truncates page count to unsigned int, skipping validation for huge sizes

Summary

old_dev_pager_ctor at device_pager.c:316 declares unsigned int npages. Line 328 npages = OFF_TO_IDX(size) truncates 64-bit vm_pindex_t to 32 bits -> sizes >16 TiB lose high bits. Per-page validation loop at :329 iterates only truncated count, validating only first ~16 TiB of requested range. vm_map_entry covers full size -> pages beyond ctor validation can be faulted. Per-fault dev_dmmap still gates each page so no direct exploit. Worst case: buggy driver relying on ctor upfront scan to reject out-of-range mapping would let it be created and only SIGSEGV at fault time (self-DoS). Fix: vm_pindex_t npages.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-0960 Β· 1 files
FileTypeDescriptionSize
manifest.json file 386 B view raw

Fix verification

not_testable
baseline reproduced→ patch + rebuild →patched clean

recommended fix identified; fix.diff not authored/validated in this batch

recommended fix identified; fix.diff not authored/validated in this batch
combined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none (Info severity)

Evidence (decisive lines)

Source-confirmed at sys/vm/device_pager.c:316: old_dev_pager_ctor truncates page count to unsigned int

Verified recommended fix

Source-confirmed at sys/vm/device_pager.c:316: old_dev_pager_ctor truncates page count to unsigned int

Verdict

Source-confirmed at sys/vm/device_pager.c:316: old_dev_pager_ctor truncates page count to unsigned int