Chain Future

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

How OtterSec checked for miscompilations in Solana’s LLVM fork

To check whether a compiler produces code that behaves as intended, OtterSec adapted a testing tool called Rustlantis to compare results for two targets: x86 and Solana’s SBPF. A report published on December 3, 2026, at 00:13:11 (UTC+08:00) describes the method in the first part of OtterSec’s security audit of the SBF backend in Solana’s LLVM fork.

The backend is the part of the compiler that produces instructions for a particular target. The report explains how LLVM uses a graph called SelectionDAG during instruction selection, then covers linking. It also distinguishes two SBPF versions, SBPFv0 and SBPFv3, in three areas: stack layout, system calls and how executable files in ELF format are loaded.

With Rustlantis, OtterSec used differential fuzzing: generating test programs and comparing their results when compiled for x86 and SBPF. The aim was to identify Solana-specific miscompilations, cases where the compiler failed to issue a diagnostic, and compiler crashes. The first part explains the testing approach; it leaves specific vulnerabilities for the second part.