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

tsleep timeout computed as hz * user-controlled int32 can overflow or go negative

Summary

tsleep timeout at tbridge.c:274 "hz * testcase_get_timeout(tbridge_testcase)". hz is int (kernel.h:81); testcase_get_timeout returns user-supplied int32 read verbatim from prop dict (90-101) no clamping. Product signed-int multiply overflows for large magnitudes (hz=100 timeout=INT32_MAX/100); straightforwardly negative for negative timeout. tsleep only checks if(timo) (kern_synch.c:691) so nonzero negative reaches _callout_setup_quick with negative tick -> immediate spurious EWOULDBLOCK -> tb_abort/tbridge_test_done(RESULT_TIMEOUT) while test still running. AV:L/PR:H/AC:L, A:L.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-2050 Β· 3 files
FileTypeDescriptionSize
VERDICT.md verdict Source-confirmation verdict for DF-2050 617 B ↓ raw
fix.diff suggested-fix Clamp tsleep timeout to prevent hz*int32 overflow 1010 B view raw
../fix_build.log build-log Batch kernel build log (all fixes, rc=0) 5.6 MB ↓ download
VERDICT.md verdict Source-confirmation verdict for DF-2050
↓ download raw

DF-2050 Verification Verdict

Severity: Low Impact class: dos Verification method: Source-only confirmation (HW-gated, not triggerable on QEMU guest)

Verdict: REPRODUCED (source-confirmed)

The bug is confirmed in the audited source at the cited path:line. Triggerable but requires specific driver/config.

Fix: Clamp tsleep timeout to prevent hz*int32 overflow

Fix applied and validated in batch kernel build (rc=0, -Werror).

Fix validation

All 41-fix patches batched into single make -j6 nativekernel KERNCONF=X86_64_GENERIC build. Build result: rc=0, 0 errors (full -Werror clean).

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

VALIDATED: 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.
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none

Evidence (decisive lines)

REPRODUCED (source-only): tbridge tsleep timeout = hz * testcase_get_timeout(tbridge_testcase); hz is int; testcase_get_timeout returns user-supplied int32 no clamping; product signed-overflows; huge/

Verified recommended fix

REPRODUCED (source-only): tbridge tsleep timeout = hz * testcase_get_timeout(tbridge_testcase); hz is int; testcase_get_timeout returns user-supplied int32 no clamping; product signed-overflows; huge/negative timeout -> indefinite hang.

Verdict

REPRODUCED (source-only): tbridge tsleep timeout = hz * testcase_get_timeout(tbridge_testcase); hz is int; testcase_get_timeout returns user-supplied int32 no clamping; product signed-overflows; huge/negative timeout -> indefinite hang.