-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18576 from hvitved/rust/translate-mad-ids
- Loading branch information
Showing
6 changed files
with
524 additions
and
470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
private import codeql.dataflow.test.ProvenancePathGraph as Graph | ||
private import codeql.rust.dataflow.internal.ModelsAsData as MaD | ||
|
||
private signature predicate provenanceSig(string model); | ||
|
||
/** Translates models-as-data provenance information into a format that can be used in tests. */ | ||
module TranslateModels<provenanceSig/1 provenance> { | ||
import Graph::TranslateModels<MaD::interpretModelForTest/2, provenance/1> | ||
} |
940 changes: 476 additions & 464 deletions
940
rust/ql/test/library-tests/dataflow/local/DataFlowStep.expected
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
import codeql.rust.dataflow.DataFlow | ||
import codeql.rust.dataflow.internal.TaintTrackingImpl | ||
import utils.test.TranslateModels | ||
|
||
query predicate additionalTaintStep = RustTaintTracking::defaultAdditionalTaintStep/3; | ||
private predicate provenance(string model) { | ||
RustTaintTracking::defaultAdditionalTaintStep(_, _, model) | ||
} | ||
|
||
private module Tm = TranslateModels<provenance/1>; | ||
|
||
query predicate models = Tm::models/2; | ||
|
||
query predicate additionalTaintStep(DataFlow::Node pred, DataFlow::Node succ, string model) { | ||
exists(string madId | | ||
RustTaintTracking::defaultAdditionalTaintStep(pred, succ, madId) and | ||
Tm::translateModels(madId, model) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters