12
12
* - Summaries:
13
13
* `namespace; type; subtypes; name; signature; ext; input; output; kind; provenance`
14
14
* - Neutrals:
15
- * `namespace; type; name; signature; provenance`
15
+ * `namespace; type; name; signature; kind; provenance`
16
16
* A neutral is used to indicate that there is no flow via a callable.
17
17
*
18
18
* The interpretation of a row is similar to API-graphs with a left-to-right
72
72
* which classes the interpreted elements should be added. For example, for
73
73
* sources "remote" indicates a default remote flow source, and for summaries
74
74
* "taint" indicates a default additional taint step and "value" indicates a
75
- * globally applicable value-preserving step.
75
+ * globally applicable value-preserving step. For neutrals the kind can be `summary`,
76
+ * `source` or `sink` to indicate that the neutral is neutral with respect to
77
+ * flow (no summary), source (is not a source) or sink (is not a sink).
76
78
* 9. The `provenance` column is a tag to indicate the origin and verification of a model.
77
79
* The format is {origin}-{verification} or just "manual" where the origin describes
78
80
* the origin of the model and verification describes how the model has been verified.
@@ -104,7 +106,7 @@ predicate sinkModel = Extensions::sinkModel/9;
104
106
predicate summaryModel = Extensions:: summaryModel / 10 ;
105
107
106
108
/** Holds if a model exists indicating there is no flow for the given parameters. */
107
- predicate neutralModel = Extensions:: neutralModel / 5 ;
109
+ predicate neutralModel = Extensions:: neutralModel / 6 ;
108
110
109
111
private predicate relevantNamespace ( string namespace ) {
110
112
sourceModel ( namespace , _, _, _, _, _, _, _, _) or
@@ -218,6 +220,11 @@ module ModelValidation {
218
220
not kind = [ "local" , "remote" , "file" , "file-write" ] and
219
221
result = "Invalid kind \"" + kind + "\" in source model."
220
222
)
223
+ or
224
+ exists ( string kind | neutralModel ( _, _, _, _, kind , _) |
225
+ not kind = [ "summary" , "source" , "sink" ] and
226
+ result = "Invalid kind \"" + kind + "\" in neutral model."
227
+ )
221
228
}
222
229
223
230
private string getInvalidModelSignature ( ) {
@@ -232,7 +239,7 @@ module ModelValidation {
232
239
summaryModel ( namespace , type , _, name , signature , ext , _, _, _, provenance ) and
233
240
pred = "summary"
234
241
or
235
- neutralModel ( namespace , type , name , signature , provenance ) and
242
+ neutralModel ( namespace , type , name , signature , _ , provenance ) and
236
243
ext = "" and
237
244
pred = "neutral"
238
245
|
@@ -275,7 +282,7 @@ private predicate elementSpec(
275
282
or
276
283
summaryModel ( namespace , type , subtypes , name , signature , ext , _, _, _, _)
277
284
or
278
- neutralModel ( namespace , type , name , signature , _) and ext = "" and subtypes = false
285
+ neutralModel ( namespace , type , name , signature , _, _ ) and ext = "" and subtypes = false
279
286
}
280
287
281
288
private predicate elementSpec (
0 commit comments