Chain Future

Solidity, smart-contract development, developer tools and explained protocol engineering

OtterSec finds three compiler defects in Solana’s LLVM fork

Checking a Solana program’s source code is only part of checking how it will behave: the compiler must also preserve the code’s meaning. In the second part of its research into Solana’s LLVM backend, published December 3, 2026, OtterSec described three defects it found through code review and fuzz testing.

A memory read changed the meaning of a selection. LLVM’s DAGCombiner optimizer rewrote a choice between two loaded values as a choice between two addresses, followed by a single load. The rewrite mishandled poison, LLVM’s term for a value that can propagate before its use triggers undefined behavior. OtterSec found that the rewrite could turn deferred undefined behavior into immediate undefined behavior.

A stack check missed the end of an object. The SBF backend checked where an object began on the stack without accounting for its length. An object could therefore start inside its assigned stack frame but extend into another frame. OtterSec used a large Anchor account structure to illustrate how the overlap could cause a program to crash.

An optimization loop could crash LLVM itself. LLVM’s general-purpose peephole optimizer, which rewrites small instruction patterns, could encounter a cycle in its rewrite map involving a COPY instruction it could not merge and a PHI instruction, which selects a value based on the path taken through the program. The optimizer followed the cycle recursively until LLVM exhausted its own stack and crashed. Unlike the SBF stack-frame defect, this failure occurred during compilation, not while the compiled program was running.