[llvm-branch-commits] [llvm] [BOLT] Gadget scanner: detect signing oracles (PR #134146)
Kristof Beyls via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Apr 25 04:45:55 PDT 2025
================
@@ -462,7 +563,22 @@ class DataflowSrcSafetyAnalysis
return DFParent::getStateBefore(Inst);
}
- void run() override { DFParent::run(); }
+ void run() override {
+ for (BinaryBasicBlock &BB : Func) {
+ if (auto CheckerInfo = BC.MIB->getAuthCheckedReg(BB)) {
+ MCInst *LastInstOfChecker = BB.getLastNonPseudoInstr();
+ LLVM_DEBUG({
+ dbgs() << "Found pointer checking sequence in " << BB.getName()
+ << ":\n";
+ traceReg(BC, "Checked register", CheckerInfo->first);
+ traceInst(BC, "First instruction", *CheckerInfo->second);
+ traceInst(BC, "Last instruction", *LastInstOfChecker);
+ });
+ CheckerSequenceInfo[LastInstOfChecker] = *CheckerInfo;
+ }
+ }
----------------
kbeyls wrote:
Another nit-pick.
This to me looks like it's initializing the `CheckerSequenceInfo` variable of the `SrcSafetyAnalysis` parent class.
Wouldn't it be cleaner to do this initializing in the constructor for `SrcSafetyAnalysis`, rather than in this `run` method?
https://github.com/llvm/llvm-project/pull/134146
More information about the llvm-branch-commits
mailing list