@@ -199,8 +199,7 @@ namespace PAuthGadgetScanner {
199
199
// to distinguish intermediate and final results at the type level.
200
200
//
201
201
// Here is an overview of issue life-cycle:
202
- // * an analysis (SrcSafetyAnalysis at now, DstSafetyAnalysis will be added
203
- // later to support the detection of authentication oracles) computes register
202
+ // * an analysis (SrcSafetyAnalysis or DstSafetyAnalysis) computes register
204
203
// state for each instruction in the function.
205
204
// * for each instruction, it is checked whether it is a gadget of some kind,
206
205
// taking the computed state into account. If a gadget is found, its kind
@@ -273,6 +272,11 @@ class ExtraInfo {
273
272
virtual ~ExtraInfo () {}
274
273
};
275
274
275
+ // / The set of instructions writing to the affected register in an unsafe
276
+ // / manner.
277
+ // /
278
+ // / This is a hint to be printed alongside the report. It should be further
279
+ // / analyzed by the user.
276
280
class ClobberingInfo : public ExtraInfo {
277
281
SmallVector<MCInstReference> ClobberingInstrs;
278
282
@@ -282,6 +286,20 @@ class ClobberingInfo : public ExtraInfo {
282
286
void print (raw_ostream &OS, const MCInstReference Location) const override ;
283
287
};
284
288
289
+ // / The set of instructions leaking the authenticated pointer before the
290
+ // / result of authentication was checked.
291
+ // /
292
+ // / This is a hint to be printed alongside the report. It should be further
293
+ // / analyzed by the user.
294
+ class LeakageInfo : public ExtraInfo {
295
+ SmallVector<MCInstReference> LeakingInstrs;
296
+
297
+ public:
298
+ LeakageInfo (ArrayRef<MCInstReference> Instrs) : LeakingInstrs(Instrs) {}
299
+
300
+ void print (raw_ostream &OS, const MCInstReference Location) const override ;
301
+ };
302
+
285
303
// / A brief version of a report that can be further augmented with the details.
286
304
// /
287
305
// / A half-baked report produced on the first run of the analysis. An extra,
@@ -322,6 +340,9 @@ class FunctionAnalysisContext {
322
340
void findUnsafeUses (SmallVector<PartialReport<MCPhysReg>> &Reports);
323
341
void augmentUnsafeUseReports (ArrayRef<PartialReport<MCPhysReg>> Reports);
324
342
343
+ void findUnsafeDefs (SmallVector<PartialReport<MCPhysReg>> &Reports);
344
+ void augmentUnsafeDefReports (ArrayRef<PartialReport<MCPhysReg>> Reports);
345
+
325
346
// / Process the reports which do not have to be augmented, and remove them
326
347
// / from Reports.
327
348
void handleSimpleReports (SmallVector<PartialReport<MCPhysReg>> &Reports);
0 commit comments