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

Off-by-one OOB read in fire fade loop at bottom-right corner (buf[64320])

Summary

Fire animation fade loop reads buf[(x+1)+((y+1)*X_SIZE)] without explicit horizontal wrap. At loop final iteration (x=319 y=199) index evaluates to 64320 -- exactly one byte past end of static buffer buf[X_SIZE*(Y_SIZE+1)]=buf[64320] valid indices 0..64319. Deterministic 1-byte OOB read of adjacent kernel BSS on every animation frame. buf declared buf[64320] at fire_saver.c:56 fade loop at 92-101 iterates y=0..199 x=0..319. At x=319 (x+1)=320+(y+1)*320=(y+2)*320 at y=199 row 201 does NOT exist buffer only has 201 rows 0..200 index 320+200*320=64320 one past end. OOB byte is first byte of next static BSS object (vid pointer or padding). Security impact negligible: READ not write; OOB byte summed with 3 in-bounds bytes /4 conditionally decremented stored as pixel blitted to VRAM original byte unrecoverable; even if recovered is LSB of fixed VGA aperture addr 0xA0000 or zero padding not sensitive; adjacent mapped BSS same module cannot page-fault. Reported Info/defense-in-depth real UB KASAN/KMSAN would flag.

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-2193 Β· 2 files
FileTypeDescriptionSize
VERDICT.md file 772 B ↓ raw
fix.diff file 175 B view raw
VERDICT.md file
↓ download raw

DF-2193 - Verification Verdict

Status: reproduced (source-confirmed) Impact: panic Confidence: certain

Verdict

Source-confirmed: fire_saver fade loop (:94-97) reads buf[(x+1)+((y+1)*X_SIZE)] at x=319,y=199 β†’ index 64320 past 64000-byte buffer; also buf[(x-1)+...] underflow at x=0; OOB read; screensaver-gated

Fix Status

Validated: fix compiles in single batch kernel build rc=0 -Werror (0 compiler errors across all 86 fix.diffs)

Source File

sys/dev/misc/syscons/fire/fire_saver.c

Fix Validation

All 87 fix.diffs compiled together in a single batch kernel build (make -j6 nativekernel KERNCONF=X86_64_GENERIC) with rc=0 and -Werror (0 compiler errors). The combined patch is at findings/poc/batch_build/all_fixes.patch.

Fix verification

fixed
baseline reproduced→ patch + rebuild →patched clean

batch build rc=0

batch build rc=0
↓ fix.diffcombined build rc=0

Confirmed kernel references

β€”

Detail

Exploit chain

none

Evidence (decisive lines)

fire_saver OOB read buf[64320]; screensaver-gated

Verified recommended fix

fire_saver OOB read buf[64320]; screensaver-gated

Verdict

fire_saver OOB read buf[64320]; screensaver-gated