Skip to content

Commit d8ecbc2

Browse files
committed
[BOLT] Gadget scanner: detect authentication oracles
Implement the detection of authentication instructions whose results can be inspected by an attacker to know whether authentication succeeded. As the properties of output registers of authentication instructions are inspected, add a second set of analysis-related classes to iterate over the instructions in reverse order.
1 parent 26c9582 commit d8ecbc2

File tree

4 files changed

+1356
-0
lines changed

4 files changed

+1356
-0
lines changed

bolt/include/bolt/Passes/PAuthGadgetScanner.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,15 @@ class ClobberingInfo : public ExtraInfo {
284284
void print(raw_ostream &OS, const MCInstReference Location) const override;
285285
};
286286

287+
class LeakageInfo : public ExtraInfo {
288+
SmallVector<MCInstReference> LeakingInstrs;
289+
290+
public:
291+
LeakageInfo(const ArrayRef<MCInstReference> Instrs) : LeakingInstrs(Instrs) {}
292+
293+
void print(raw_ostream &OS, const MCInstReference Location) const override;
294+
};
295+
287296
/// A brief version of a report that can be further augmented with the details.
288297
///
289298
/// A half-baked report produced on the first run of the analysis. An extra,
@@ -324,6 +333,9 @@ class FunctionAnalysisContext {
324333
void findUnsafeUses(SmallVector<PartialReport<MCPhysReg>> &Reports);
325334
void augmentUnsafeUseReports(ArrayRef<PartialReport<MCPhysReg>> Reports);
326335

336+
void findUnsafeDefs(SmallVector<PartialReport<MCPhysReg>> &Reports);
337+
void augmentUnsafeDefReports(ArrayRef<PartialReport<MCPhysReg>> Reports);
338+
327339
/// Process the reports which do not have to be augmented, and remove them
328340
/// from Reports.
329341
void handleSimpleReports(SmallVector<PartialReport<MCPhysReg>> &Reports);

0 commit comments

Comments
 (0)