Skip to content

Commit 8c02130

Browse files
author
Alex Eyers-Taylor
committed
DataFlow: Rearrange files to group the parts that can be shared with overlay aware.
1 parent 18e33b1 commit 8c02130

File tree

2 files changed

+115
-115
lines changed

2 files changed

+115
-115
lines changed

shared/dataflow/codeql/dataflow/DataFlow.qll

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -691,59 +691,6 @@ module DataFlowMake<LocationSig Location, InputSig<Location> Lang> {
691691
predicate flowToExpr(DataFlowExpr sink);
692692
}
693693

694-
/**
695-
* Constructs a global data flow computation.
696-
*/
697-
module Global<ConfigSig Config> implements GlobalFlowSig {
698-
private module C implements FullStateConfigSig {
699-
import DefaultState<Config>
700-
import Config
701-
702-
predicate accessPathLimit = Config::accessPathLimit/0;
703-
704-
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
705-
Config::isAdditionalFlowStep(node1, node2) and model = "Config"
706-
}
707-
}
708-
709-
private module Stage1 = ImplStage1<C>;
710-
711-
import Stage1::PartialFlow
712-
713-
private module Flow = Impl<C, Stage1::Stage1NoState>;
714-
715-
import Flow
716-
}
717-
718-
/**
719-
* Constructs a global data flow computation using flow state.
720-
*/
721-
module GlobalWithState<StateConfigSig Config> implements GlobalFlowSig {
722-
private module C implements FullStateConfigSig {
723-
import Config
724-
725-
predicate accessPathLimit = Config::accessPathLimit/0;
726-
727-
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
728-
Config::isAdditionalFlowStep(node1, node2) and model = "Config"
729-
}
730-
731-
predicate isAdditionalFlowStep(
732-
Node node1, FlowState state1, Node node2, FlowState state2, string model
733-
) {
734-
Config::isAdditionalFlowStep(node1, state1, node2, state2) and model = "Config"
735-
}
736-
}
737-
738-
private module Stage1 = ImplStage1<C>;
739-
740-
import Stage1::PartialFlow
741-
742-
private module Flow = Impl<C, Stage1::Stage1WithState>;
743-
744-
import Flow
745-
}
746-
747694
signature class PathNodeSig {
748695
/** Gets a textual representation of this element. */
749696
string toString();
@@ -1140,4 +1087,57 @@ module DataFlowMake<LocationSig Location, InputSig<Location> Lang> {
11401087
// Re-export the PathGraph so the user can import a single module and get both PathNode and the query predicates
11411088
import PathGraph
11421089
}
1090+
1091+
/**
1092+
* Constructs a global data flow computation.
1093+
*/
1094+
module Global<ConfigSig Config> implements GlobalFlowSig {
1095+
private module C implements FullStateConfigSig {
1096+
import DefaultState<Config>
1097+
import Config
1098+
1099+
predicate accessPathLimit = Config::accessPathLimit/0;
1100+
1101+
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
1102+
Config::isAdditionalFlowStep(node1, node2) and model = "Config"
1103+
}
1104+
}
1105+
1106+
private module Stage1 = ImplStage1<C>;
1107+
1108+
import Stage1::PartialFlow
1109+
1110+
private module Flow = Impl<C, Stage1::Stage1NoState>;
1111+
1112+
import Flow
1113+
}
1114+
1115+
/**
1116+
* Constructs a global data flow computation using flow state.
1117+
*/
1118+
module GlobalWithState<StateConfigSig Config> implements GlobalFlowSig {
1119+
private module C implements FullStateConfigSig {
1120+
import Config
1121+
1122+
predicate accessPathLimit = Config::accessPathLimit/0;
1123+
1124+
predicate isAdditionalFlowStep(Node node1, Node node2, string model) {
1125+
Config::isAdditionalFlowStep(node1, node2) and model = "Config"
1126+
}
1127+
1128+
predicate isAdditionalFlowStep(
1129+
Node node1, FlowState state1, Node node2, FlowState state2, string model
1130+
) {
1131+
Config::isAdditionalFlowStep(node1, state1, node2, state2) and model = "Config"
1132+
}
1133+
}
1134+
1135+
private module Stage1 = ImplStage1<C>;
1136+
1137+
import Stage1::PartialFlow
1138+
1139+
private module Flow = Impl<C, Stage1::Stage1WithState>;
1140+
1141+
import Flow
1142+
}
11431143
}

shared/dataflow/codeql/dataflow/TaintTracking.qll

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -83,68 +83,6 @@ module TaintFlowMake<
8383
}
8484
}
8585

86-
/**
87-
* Constructs a global taint tracking computation.
88-
*/
89-
module Global<DataFlow::ConfigSig Config> implements DataFlow::GlobalFlowSig {
90-
private module Config0 implements DataFlowInternal::FullStateConfigSig {
91-
import DataFlowInternal::DefaultState<Config>
92-
import Config
93-
94-
predicate isAdditionalFlowStep(
95-
DataFlowLang::Node node1, DataFlowLang::Node node2, string model
96-
) {
97-
Config::isAdditionalFlowStep(node1, node2) and model = "Config"
98-
}
99-
}
100-
101-
private module C implements DataFlowInternal::FullStateConfigSig {
102-
import AddTaintDefaults<Config0>
103-
}
104-
105-
private module Stage1 = DataFlowInternalStage1::ImplStage1<C>;
106-
107-
import Stage1::PartialFlow
108-
109-
private module Flow = DataFlowInternal::Impl<C, Stage1::Stage1NoState>;
110-
111-
import Flow
112-
}
113-
114-
/**
115-
* Constructs a global taint tracking computation using flow state.
116-
*/
117-
module GlobalWithState<DataFlow::StateConfigSig Config> implements DataFlow::GlobalFlowSig {
118-
private module Config0 implements DataFlowInternal::FullStateConfigSig {
119-
import Config
120-
121-
predicate isAdditionalFlowStep(
122-
DataFlowLang::Node node1, DataFlowLang::Node node2, string model
123-
) {
124-
Config::isAdditionalFlowStep(node1, node2) and model = "Config"
125-
}
126-
127-
predicate isAdditionalFlowStep(
128-
DataFlowLang::Node node1, FlowState state1, DataFlowLang::Node node2, FlowState state2,
129-
string model
130-
) {
131-
Config::isAdditionalFlowStep(node1, state1, node2, state2) and model = "Config"
132-
}
133-
}
134-
135-
private module C implements DataFlowInternal::FullStateConfigSig {
136-
import AddTaintDefaults<Config0>
137-
}
138-
139-
private module Stage1 = DataFlowInternalStage1::ImplStage1<C>;
140-
141-
import Stage1::PartialFlow
142-
143-
private module Flow = DataFlowInternal::Impl<C, Stage1::Stage1WithState>;
144-
145-
import Flow
146-
}
147-
14886
signature int speculationLimitSig();
14987

15088
private module AddSpeculativeTaintSteps<
@@ -216,6 +154,68 @@ module TaintFlowMake<
216154
}
217155
}
218156

157+
/**
158+
* Constructs a global taint tracking computation.
159+
*/
160+
module Global<DataFlow::ConfigSig Config> implements DataFlow::GlobalFlowSig {
161+
private module Config0 implements DataFlowInternal::FullStateConfigSig {
162+
import DataFlowInternal::DefaultState<Config>
163+
import Config
164+
165+
predicate isAdditionalFlowStep(
166+
DataFlowLang::Node node1, DataFlowLang::Node node2, string model
167+
) {
168+
Config::isAdditionalFlowStep(node1, node2) and model = "Config"
169+
}
170+
}
171+
172+
private module C implements DataFlowInternal::FullStateConfigSig {
173+
import AddTaintDefaults<Config0>
174+
}
175+
176+
private module Stage1 = DataFlowInternalStage1::ImplStage1<C>;
177+
178+
import Stage1::PartialFlow
179+
180+
private module Flow = DataFlowInternal::Impl<C, Stage1::Stage1NoState>;
181+
182+
import Flow
183+
}
184+
185+
/**
186+
* Constructs a global taint tracking computation using flow state.
187+
*/
188+
module GlobalWithState<DataFlow::StateConfigSig Config> implements DataFlow::GlobalFlowSig {
189+
private module Config0 implements DataFlowInternal::FullStateConfigSig {
190+
import Config
191+
192+
predicate isAdditionalFlowStep(
193+
DataFlowLang::Node node1, DataFlowLang::Node node2, string model
194+
) {
195+
Config::isAdditionalFlowStep(node1, node2) and model = "Config"
196+
}
197+
198+
predicate isAdditionalFlowStep(
199+
DataFlowLang::Node node1, FlowState state1, DataFlowLang::Node node2, FlowState state2,
200+
string model
201+
) {
202+
Config::isAdditionalFlowStep(node1, state1, node2, state2) and model = "Config"
203+
}
204+
}
205+
206+
private module C implements DataFlowInternal::FullStateConfigSig {
207+
import AddTaintDefaults<Config0>
208+
}
209+
210+
private module Stage1 = DataFlowInternalStage1::ImplStage1<C>;
211+
212+
import Stage1::PartialFlow
213+
214+
private module Flow = DataFlowInternal::Impl<C, Stage1::Stage1WithState>;
215+
216+
import Flow
217+
}
218+
219219
/**
220220
* Constructs a global taint tracking computation that also allows a given
221221
* maximum number of speculative taint steps.

0 commit comments

Comments
 (0)