Fault injections are physical attacks that disrupt systems’ hardware to create exploitable erroneous behaviors. Countermeasures that rely on software (exclusively or not) frequently need much more precise control of the binary code than available through high-level languages’ semantics. This causes significant friction when compiling, as lowerings and optimizations only obey semantics and often destroy security code or annotations.
As a step to address this issue, we introduce Tracing LLVM, an open-source extension of LLVM with primitives to protect and compile non-functional aspects of programs (backed mostly by implementation-defined behavior and internal LLVM API contracts). We showcase its current capabilities by protecting typical countermeasures, lowering source information to late stages, and composing four protection schemes on a PIN verification function.