66 *
77 * The extensible relations have the following columns:
88 * - Sources:
9- * `namespace; type; subtypes; name; signature; ext; output; kind`
9+ * `namespace; type; subtypes; name; signature; ext; output; kind; provenance `
1010 * - Sinks:
11- * `namespace; type; subtypes; name; signature; ext; input; kind`
11+ * `namespace; type; subtypes; name; signature; ext; input; kind; provenance `
1212 * - Summaries:
13- * `namespace; type; subtypes; name; signature; ext; input; output; kind`
13+ * `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 *
1519 * The interpretation of a row is similar to API-graphs with a left-to-right
1620 * reading.
8791 * value, and
8892 * - flow from the _second_ indirection of the 0th argument to the first
8993 * indirection of the return value, etc.
90- * 8. The `kind` column is a tag that can be referenced from QL to determine to
94+ * 8. The `acceptingValue` column of barrier guard models specifies the condition
95+ * under which the guard blocks flow. It can be one of "true" or "false". In
96+ * the future "no-exception", "not-zero", "null", "not-null" may be supported.
97+ * 9. The `kind` column is a tag that can be referenced from QL to determine to
9198 * which classes the interpreted elements should be added. For example, for
9299 * sources "remote" indicates a default remote flow source, and for summaries
93100 * "taint" indicates a default additional taint step and "value" indicates a
94101 * globally applicable value-preserving step.
102+ * 10. The `provenance` column is a tag to indicate the origin and verification of a model.
103+ * The format is {origin}-{verification} or just "manual" where the origin describes
104+ * the origin of the model and verification describes how the model has been verified.
105+ * Some examples are:
106+ * - "df-generated": The model has been generated by the model generator tool.
107+ * - "df-manual": The model has been generated by the model generator and verified by a human.
108+ * - "manual": The model has been written by hand.
109+ * This information is used in a heuristic for dataflow analysis to determine, if a
110+ * model or source code should be used for determining flow.
95111 */
96112
97113import cpp
@@ -931,13 +947,13 @@ private module Cached {
931947
932948 private predicate barrierGuardChecks ( IRGuardCondition g , Expr e , boolean gv , TKindModelPair kmp ) {
933949 exists (
934- SourceSinkInterpretationInput:: InterpretNode n , Public:: AcceptingValue acceptingvalue ,
950+ SourceSinkInterpretationInput:: InterpretNode n , Public:: AcceptingValue acceptingValue ,
935951 string kind , string model
936952 |
937- isBarrierGuardNode ( n , acceptingvalue , kind , model ) and
953+ isBarrierGuardNode ( n , acceptingValue , kind , model ) and
938954 n .asNode ( ) .asExpr ( ) = e and
939955 kmp = TMkPair ( kind , model ) and
940- gv = convertAcceptingValue ( acceptingvalue ) .asBooleanValue ( ) and
956+ gv = convertAcceptingValue ( acceptingValue ) .asBooleanValue ( ) and
941957 n .asNode ( ) .( Private:: ArgumentNode ) .getCall ( ) .asCallInstruction ( ) = g
942958 )
943959 }
@@ -954,14 +970,14 @@ private module Cached {
954970 ) {
955971 exists (
956972 SourceSinkInterpretationInput:: InterpretNode interpretNode ,
957- Public:: AcceptingValue acceptingvalue , string kind , string model , int indirectionIndex ,
973+ Public:: AcceptingValue acceptingValue , string kind , string model , int indirectionIndex ,
958974 Private:: ArgumentNode arg
959975 |
960- isBarrierGuardNode ( interpretNode , acceptingvalue , kind , model ) and
976+ isBarrierGuardNode ( interpretNode , acceptingValue , kind , model ) and
961977 arg = interpretNode .asNode ( ) and
962978 arg .asIndirectExpr ( indirectionIndex ) = e and
963979 kmp = MkKindModelPairIntPair ( TMkPair ( kind , model ) , indirectionIndex ) and
964- gv = convertAcceptingValue ( acceptingvalue ) .asBooleanValue ( ) and
980+ gv = convertAcceptingValue ( acceptingValue ) .asBooleanValue ( ) and
965981 arg .getCall ( ) .asCallInstruction ( ) = g
966982 )
967983 }
0 commit comments