Skip to content

Commit 6b52ba8

Browse files
committed
Add barriers and barrier guards to MaD format explanations
1 parent 6c52de9 commit 6b52ba8

File tree

8 files changed

+63
-11
lines changed

8 files changed

+63
-11
lines changed

cpp/ql/lib/semmle/code/cpp/dataflow/ExternalFlow.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* `namespace; type; subtypes; name; signature; ext; input; kind`
1111
* - Summaries:
1212
* `namespace; type; subtypes; name; signature; ext; input; output; kind`
13+
* - Barriers:
14+
* `namespace; type; subtypes; name; signature; ext; output; kind; provenance`
15+
* - BarrierGuards:
16+
* `namespace; type; subtypes; name; signature; ext; input; acceptingvalue; kind; provenance`
1317
*
1418
* The interpretation of a row is similar to API-graphs with a left-to-right
1519
* reading.
@@ -86,7 +90,11 @@
8690
* value, and
8791
* - flow from the _second_ indirection of the 0th argument to the first
8892
* indirection of the return value, etc.
89-
* 8. The `kind` column is a tag that can be referenced from QL to determine to
93+
* 8. The `acceptingvalue` column of barrier guard models specifies the condition
94+
* under which the guard accepts or blocks flow. It can be one of "true" or
95+
* "false". In future "no-exception", "not-zero", "null", "not-null" may be
96+
* supported.
97+
* 9. The `kind` column is a tag that can be referenced from QL to determine to
9098
* which classes the interpreted elements should be added. For example, for
9199
* sources "remote" indicates a default remote flow source, and for summaries
92100
* "taint" indicates a default additional taint step and "value" indicates a

csharp/ql/lib/semmle/code/csharp/dataflow/internal/ExternalFlow.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
* `namespace; type; subtypes; name; signature; ext; input; kind; provenance`
1212
* - Summaries:
1313
* `namespace; type; subtypes; name; signature; ext; input; output; kind; provenance`
14+
* - Barriers:
15+
* `namespace; type; subtypes; name; signature; ext; output; kind; provenance`
16+
* - BarrierGuards:
17+
* `namespace; type; subtypes; name; signature; ext; input; acceptingvalue; kind; provenance`
1418
* - Neutrals:
1519
* `namespace; type; name; signature; kind; provenance`
1620
* A neutral is used to indicate that a callable is neutral with respect to flow (no summary), source (is not a source) or sink (is not a sink).
@@ -69,14 +73,17 @@
6973
* - "Field[f]": Selects the contents of field `f`.
7074
* - "Property[p]": Selects the contents of property `p`.
7175
*
72-
* 8. The `kind` column is a tag that can be referenced from QL to determine to
76+
* 8. The `acceptingvalue` column of barrier guard models specifies the condition
77+
* under which the guard accepts or blocks flow. It can be one of "true" or
78+
* "false", "no-exception", "not-zero", "null", "not-null".
79+
* 9. The `kind` column is a tag that can be referenced from QL to determine to
7380
* which classes the interpreted elements should be added. For example, for
7481
* sources "remote" indicates a default remote flow source, and for summaries
7582
* "taint" indicates a default additional taint step and "value" indicates a
7683
* globally applicable value-preserving step. For neutrals the kind can be `summary`,
7784
* `source` or `sink` to indicate that the neutral is neutral with respect to
7885
* flow (no summary), source (is not a source) or sink (is not a sink).
79-
* 9. The `provenance` column is a tag to indicate the origin and verification of a model.
86+
* 10. The `provenance` column is a tag to indicate the origin and verification of a model.
8087
* The format is {origin}-{verification} or just "manual" where the origin describes
8188
* the origin of the model and verification describes how the model has been verified.
8289
* Some examples are:

go/ql/lib/semmle/go/dataflow/ExternalFlow.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
* `package; type; subtypes; name; signature; ext; input; kind; provenance`
1212
* - Summaries:
1313
* `package; type; subtypes; name; signature; ext; input; output; kind; provenance`
14+
* - Barriers:
15+
* `package; type; subtypes; name; signature; ext; output; kind; provenance`
16+
* - BarrierGuards:
17+
* `package; type; subtypes; name; signature; ext; input; acceptingvalue; kind; provenance`
1418
* - Neutrals:
1519
* `package; type; name; signature; kind; provenance`
1620
* A neutral is used to indicate that a callable is neutral with respect to flow (no summary), source (is not a source) or sink (is not a sink).
@@ -78,7 +82,11 @@
7882
* - "MapValue": Selects a value in a map.
7983
* - "Dereference": Selects the value referenced by a pointer.
8084
*
81-
* 8. The `kind` column is a tag that can be referenced from QL to determine to
85+
* 8. The `acceptingvalue` column of barrier guard models specifies the condition
86+
* under which the guard accepts or blocks flow. It can be one of "true" or
87+
* "false". In future "no-exception", "not-zero", "null", "not-null" may be
88+
* supported.
89+
* 9. The `kind` column is a tag that can be referenced from QL to determine to
8290
* which classes the interpreted elements should be added. For example, for
8391
* sources "remote" indicates a default remote flow source, and for summaries
8492
* "taint" indicates a default additional taint step and "value" indicates a

java/ql/lib/semmle/code/java/dataflow/ExternalFlow.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
* `package; type; subtypes; name; signature; ext; input; kind; provenance`
1212
* - Summaries:
1313
* `package; type; subtypes; name; signature; ext; input; output; kind; provenance`
14+
* - Barriers:
15+
* `package; type; subtypes; name; signature; ext; output; kind; provenance`
16+
* - BarrierGuards:
17+
* `package; type; subtypes; name; signature; ext; input; acceptingvalue; kind; provenance`
1418
* - Neutrals:
1519
* `package; type; name; signature; kind; provenance`
1620
* A neutral is used to indicate that a callable is neutral with respect to flow (no summary), source (is not a source) or sink (is not a sink).
@@ -69,14 +73,17 @@
6973
* in the given range. The range is inclusive at both ends.
7074
* - "ReturnValue": Selects the return value of a call to the selected element.
7175
* - "Element": Selects the collection elements of the selected element.
72-
* 8. The `kind` column is a tag that can be referenced from QL to determine to
76+
* 8. The `acceptingvalue` column of barrier guard models specifies the condition
77+
* under which the guard accepts or blocks flow. It can be one of "true" or
78+
* "false", "no-exception", "not-zero", "null", "not-null".
79+
* 9. The `kind` column is a tag that can be referenced from QL to determine to
7380
* which classes the interpreted elements should be added. For example, for
7481
* sources "remote" indicates a default remote flow source, and for summaries
7582
* "taint" indicates a default additional taint step and "value" indicates a
7683
* globally applicable value-preserving step. For neutrals the kind can be `summary`,
7784
* `source` or `sink` to indicate that the neutral is neutral with respect to
7885
* flow (no summary), source (is not a source) or sink (is not a sink).
79-
* 9. The `provenance` column is a tag to indicate the origin and verification of a model.
86+
* 10. The `provenance` column is a tag to indicate the origin and verification of a model.
8087
* The format is {origin}-{verification} or just "manual" where the origin describes
8188
* the origin of the model and verification describes how the model has been verified.
8289
* Some examples are:

javascript/ql/lib/semmle/javascript/frameworks/data/internal/ApiGraphModels.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* `type, path, kind`
1111
* - Summaries:
1212
* `type, path, input, output, kind`
13+
* - Barriers:
14+
* `type, path, kind`
15+
* - BarrierGuards:
16+
* `type, path, branch, kind`
1317
* - Types:
1418
* `type1, type2, path`
1519
*
@@ -42,7 +46,8 @@
4246
* 3. The `input` and `output` columns specify how data enters and leaves the element selected by the
4347
* first `(type, path)` tuple. Both strings are `.`-separated access paths
4448
* of the same syntax as the `path` column.
45-
* 4. The `kind` column is a tag that can be referenced from QL to determine to
49+
* 4. The `branch` column of barrier guard models specifies which branch of the guard is blocking flow. It can be "true" or "false".
50+
* 5. The `kind` column is a tag that can be referenced from QL to determine to
4651
* which classes the interpreted elements should be added. For example, for
4752
* sources `"remote"` indicates a default remote flow source, and for summaries
4853
* `"taint"` indicates a default additional taint step and `"value"` indicates a

python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModels.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* `type, path, kind`
1111
* - Summaries:
1212
* `type, path, input, output, kind`
13+
* - Barriers:
14+
* `type, path, kind`
15+
* - BarrierGuards:
16+
* `type, path, branch, kind`
1317
* - Types:
1418
* `type1, type2, path`
1519
*
@@ -42,7 +46,8 @@
4246
* 3. The `input` and `output` columns specify how data enters and leaves the element selected by the
4347
* first `(type, path)` tuple. Both strings are `.`-separated access paths
4448
* of the same syntax as the `path` column.
45-
* 4. The `kind` column is a tag that can be referenced from QL to determine to
49+
* 4. The `branch` column of barrier guard models specifies which branch of the guard is blocking flow. It can be "true" or "false".
50+
* 5. The `kind` column is a tag that can be referenced from QL to determine to
4651
* which classes the interpreted elements should be added. For example, for
4752
* sources `"remote"` indicates a default remote flow source, and for summaries
4853
* `"taint"` indicates a default additional taint step and `"value"` indicates a

ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModels.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
* `type, path, kind`
1111
* - Summaries:
1212
* `type, path, input, output, kind`
13+
* - Barriers:
14+
* `type, path, kind`
15+
* - BarrierGuards:
16+
* `type, path, branch, kind`
1317
* - Types:
1418
* `type1, type2, path`
1519
*
@@ -42,7 +46,8 @@
4246
* 3. The `input` and `output` columns specify how data enters and leaves the element selected by the
4347
* first `(type, path)` tuple. Both strings are `.`-separated access paths
4448
* of the same syntax as the `path` column.
45-
* 4. The `kind` column is a tag that can be referenced from QL to determine to
49+
* 4. The `branch` column of barrier guard models specifies which branch of the guard is blocking flow. It can be "true" or "false".
50+
* 5. The `kind` column is a tag that can be referenced from QL to determine to
4651
* which classes the interpreted elements should be added. For example, for
4752
* sources `"remote"` indicates a default remote flow source, and for summaries
4853
* `"taint"` indicates a default additional taint step and `"value"` indicates a

rust/ql/lib/codeql/rust/dataflow/internal/ModelsAsData.qll

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
* `path; input; kind; provenance`
1010
* - Summaries:
1111
* `path; input; output; kind; provenance`
12+
* - Barriers:
13+
* `path; input; kind; provenance`
14+
* - BarrierGuards:
15+
* `path; input; branch; kind; provenance`
1216
*
1317
* The interpretation of a row is similar to API-graphs with a left-to-right
1418
* reading.
@@ -34,12 +38,15 @@
3438
* - `Field[i]`: the `i`th element of a tuple.
3539
* - `Reference`: the referenced value.
3640
* - `Future`: the value being computed asynchronously.
37-
* 3. The `kind` column is a tag that can be referenced from QL to determine to
41+
* 3. The `branch` column of barrier guard models specifies which branch of the
42+
* guard is blocking flow. It can be "true" or "false". In future
43+
* "no-exception", "not-zero", "null", "not-null" may be supported.
44+
* 4. The `kind` column is a tag that can be referenced from QL to determine to
3845
* which classes the interpreted elements should be added. For example, for
3946
* sources `"remote"` indicates a default remote flow source, and for summaries
4047
* `"taint"` indicates a default additional taint step and `"value"` indicates a
4148
* globally applicable value-preserving step.
42-
* 4. The `provenance` column is mainly used internally, and should be set to `"manual"` for
49+
* 5. The `provenance` column is mainly used internally, and should be set to `"manual"` for
4350
* all custom models.
4451
*/
4552

0 commit comments

Comments
 (0)