DragonFlyBSD Kernel Audit
← triage · dashboard
DF-2606

Unvalidated bref->keybits from disk causes undefined behavior in shift operations throughout chain lookups

Summary

On-disk bref->keybits (uint8_t 0-255) used directly as shift count in (hammer2_key_t)1<<keybits throughout chain code no bounds check. For keybits>63 UB shift>=type width. Code at :4555 explicitly detects keybits>64 but only Debugger() no-op without DDB then uses invalid value anyway. UB produces wrong key-range calc on x86_64 masks to 6 bits keybits=64 gives range 1 byte. Corrupts RB-tree comparator chain_cmp misplaced chains overlapping/missing key coverage. Filesystem-corruption logic-bug not memory-corruption. Mount crafted image keybits=65.

Discussion (0)

No comments yet.