LLVM: lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp File Reference (original) (raw)

Go to the source code of this file.

Namespaces
namespace llvm
This is an optimization pass for GlobalISel generic memory operations.
Functions
STATISTIC (NumFences, "Number of LFENCEs inserted for LVI mitigation")
STATISTIC (NumFunctionsConsidered, "Number of functions analyzed")
STATISTIC (NumFunctionsMitigated, "Number of functions for which mitigations " "were deployed")
STATISTIC (NumGadgets, "Number of LVI gadgets detected during analysis")
static void writeGadgetGraph (raw_ostream &OS, MachineFunction &MF, MachineGadgetGraph *G)
INITIALIZE_PASS_BEGIN (X86LoadValueInjectionLoadHardeningPass, PASS_KEY, "X86 LVI load hardening", false, false) INITIALIZE_PASS_END(X86LoadValueInjectionLoadHardeningPass
Variables
static cl::opt< std::string > OptimizePluginPath (PASS_KEY "-opt-plugin", cl::desc("Specify a plugin to optimize LFENCE insertion"), cl::Hidden)
static cl::opt< bool > NoConditionalBranches (PASS_KEY "-no-cbranch", cl::desc("Don't treat conditional branches as disclosure gadgets. This " "may improve performance, at the cost of security."), cl::init(false), cl::Hidden)
static cl::opt< bool > EmitDot (PASS_KEY "-dot", cl::desc("For each function, emit a dot graph depicting potential LVI gadgets"), cl::init(false), cl::Hidden)
static cl::opt< bool > EmitDotOnly (PASS_KEY "-dot-only", cl::desc("For each function, emit a dot graph depicting potential LVI " "gadgets, and do not insert any fences"), cl::init(false), cl::Hidden)
static cl::opt< bool > EmitDotVerify (PASS_KEY "-dot-verify", cl::desc("For each function, emit a dot graph to stdout depicting " "potential LVI gadgets, used for testing purposes only"), cl::init(false), cl::Hidden)
static llvm::sys::DynamicLibrary OptimizeDL
static OptimizeCutT OptimizeCut = nullptr
PASS_KEY
X86 LVI load hardening
X86 LVI load false

DEBUG_TYPE

PASS_KEY

#define PASS_KEY "x86-lvi-load"

OptimizeCutT

INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( X86LoadValueInjectionLoadHardeningPass ,
PASS_KEY ,
"X86 LVI load hardening" ,
false ,
false )

STATISTIC() [1/4]

STATISTIC ( NumFences ,
"Number of LFENCEs inserted for LVI mitigation" )

STATISTIC() [2/4]

STATISTIC ( NumFunctionsConsidered ,
"Number of functions analyzed" )

STATISTIC() [3/4]

STATISTIC ( NumFunctionsMitigated ,
"Number of functions for which mitigations " "were deployed" )

STATISTIC() [4/4]

STATISTIC ( NumGadgets ,
"Number of LVI gadgets detected during analysis" )

writeGadgetGraph()

EmitDot

EmitDotOnly

cl::opt< bool > EmitDotOnly(PASS_KEY "-dot-only", cl::desc("For each function, emit a dot graph depicting potential LVI " "gadgets, and do not insert any fences"), cl::init(false), cl::Hidden) ( PASS_KEY "-dot-only" , cl::desc("For each function, emit a dot graph depicting potential LVI " "gadgets, and do not insert any fences") , cl::init(false) , cl::Hidden ) static

EmitDotVerify

cl::opt< bool > EmitDotVerify(PASS_KEY "-dot-verify", cl::desc("For each function, emit a dot graph to stdout depicting " "potential LVI gadgets, used for testing purposes only"), cl::init(false), cl::Hidden) ( PASS_KEY "-dot-verify" , cl::desc("For each function, emit a dot graph to stdout depicting " "potential LVI gadgets, used for testing purposes only") , cl::init(false) , cl::Hidden ) static

false

hardening

NoConditionalBranches

cl::opt< bool > NoConditionalBranches(PASS_KEY "-no-cbranch", cl::desc("Don't treat conditional branches as disclosure gadgets. This " "may improve performance, at the cost of security."), cl::init(false), cl::Hidden) ( PASS_KEY "-no-cbranch" , cl::desc("Don't treat conditional branches as disclosure gadgets. This " "may improve performance, at the cost of security.") , cl::init(false) , cl::Hidden ) static

OptimizeCut

OptimizeCutT OptimizeCut = nullptr static

OptimizeDL

OptimizePluginPath

PASS_KEY