Jonas Jensen
b08de6c051
Merge pull request #3482 from MathiasVP/getlim-taint-source
...
C++: Add GetDelim as taint step
2020-05-15 15:54:29 +02:00
Mathias Vorreiter Pedersen
866b1361ec
C++: Accept tests
2020-05-15 11:12:47 +02:00
Mathias Vorreiter Pedersen
90d473d886
C++: Demonstrate lack of taint through getdelim
2020-05-15 11:01:27 +02:00
Mathias Vorreiter Pedersen
fe682556bf
Merge pull request #3475 from jbj/field-conflation-memcpy
...
C++: Test field conflation with array in struct
2020-05-14 17:53:32 +02:00
Jonas Jensen
a380dc113f
C++: Test field conflation with array in struct
2020-05-14 16:29:39 +02:00
Mathias Vorreiter Pedersen
1c2b8563ae
C++: Remove 'flow' value from testcases
2020-05-14 15:33:02 +02:00
Mathias Vorreiter Pedersen
5f9b96cde9
C++: Fix off-by-one in test annotation
2020-05-14 15:12:00 +02:00
Mathias Vorreiter Pedersen
f414b277ba
C++: Modify complex.cpp test to account for longer access paths in the dataflow library
2020-05-14 13:58:04 +02:00
Mathias Vorreiter Pedersen
f5f3405ec3
C++: Modify IR field flow tests to use InlineExpectationsTest.qll
2020-05-14 11:11:21 +02:00
Mathias Vorreiter Pedersen
34314d0cb6
C++: Annotation field flow tests with [IR] and [AST]
2020-05-13 15:16:02 +02:00
Mathias Vorreiter Pedersen
df6abdc074
Merge pull request #3389 from jbj/dataflow-defbyref-to-field
...
C++: Post-update flow through &, *, +, ...
2020-05-12 08:30:33 +02:00
Jonas Jensen
88eeca39fb
Merge commit '52d8acc1a198c5ea29c1dddceda1d6c0fb75de14' into dataflow-defbyref-to-field
...
This is a partial merge from master. In particular, it takes in #3382
and #3385 .
2020-05-07 16:46:11 +02:00
Mathias Vorreiter Pedersen
594f3b1807
C++: Add testcase for #3110
2020-05-07 14:39:53 +02:00
Jonas Jensen
1b1095ee75
C++: Post-update flow through &, *, +, ...
...
Flow from a definition by reference of a field into its object was
working inconsistently and in a very syntax-dependent way. For a
function `f` receiving a reference, `f(a->x)` could propagate data back
to `a` via the _reverse read_ mechanism in the shared data-flow library,
but for a function `g` receiving a pointer, `g(&a->x)` would not work.
And `f((*a).x)` would not work either.
In all cases, the issue was that the shared data-flow library propagates
data backwards between `PostUpdateNode`s only, but there is no
`PostUpdateNode` for `a->x` in `g(&a->x)`. This pull request inserts
such post-update nodes where appropriate and links them to their
neighbors. In this exapmle, flow back from the output parameter of `g`
passes first to the `PostUpdateNode` of `&`, then to the (new)
`PostUpdateNode` of `a->x`, and finally, as a _reverse read_ with the
appropriate field projection, to `a`.
2020-05-01 15:40:19 +02:00
Jonas Jensen
36bdcfa42d
C++: Remove an unneeded local-flow case
...
This case was added in dccc0f4db . The surrounding code has changed a lot
since then, and the case no longer seems to have an effect except to
create some dead ends and possibly cycles in the local flow graph.
2020-05-01 15:08:15 +02:00
Jonas Jensen
5f74c24d4d
C++: Test definitions through &, *, ...
2020-05-01 11:04:49 +02:00
Jonas Jensen
4ddf12119d
C++: Don't suppress consistency checks for calls
...
See https://github.com/github/codeql/pull/3162#discussion_r400849713 .
2020-05-01 11:04:42 +02:00
Jonas Jensen
796041af72
C++: Refactor PartialDefinition charpred
...
This class used `newtype` for seemingly no reason. The new code is
shorter and should be faster as well.
2020-04-28 17:10:25 +02:00
Jonas Jensen
20c956e0a9
Merge pull request #3320 from Semmle/rdmarsh/cpp/taint-tracking-util-port
...
C++: move logic from DefaultTaintTracking into TaintTrackingUtil
2020-04-27 11:34:03 +02:00
Robert Marsh
9e0d6e8aa0
C++: move taint step cases to TaintTrackingUtil
2020-04-22 01:38:00 -07:00
Mathias Vorreiter Pedersen
a6e619ce5b
C++: Add field flow through single-field structs and accept tests
2020-04-20 08:52:46 +02:00
Mathias Vorreiter Pedersen
6fca23bc8b
C++: Demonstrate lack of flow through single-field structs
2020-04-20 08:50:31 +02:00
Mathias Vorreiter Pedersen
8c03423f3e
C++: Accept test output
2020-04-17 12:03:16 +02:00
Mathias Vorreiter Pedersen
62e2ffe623
C++: Make PartialDefinitionNode private and add/update comments based on review comments
2020-04-16 17:19:12 +02:00
Mathias Vorreiter Pedersen
f02feac33a
C++: Add flow from #3220
2020-04-15 11:34:19 +02:00
Mathias Vorreiter Pedersen
209e084820
Merge branch 'master' into ir-flow-fields
2020-04-15 10:51:45 +02:00
Mathias Vorreiter Pedersen
cde34c9b1b
C++: Accept test output which I previously forgot to accept
2020-04-13 16:19:21 +02:00
Robert Marsh
c38ccaaab6
Merge branch 'master' into rdmarsh/cpp/ir-flow-through-outparams
2020-04-08 12:32:35 -07:00
Mathias Vorreiter Pedersen
52b179aee5
Merge branch 'master' into ir-flow-fields
2020-04-07 21:27:17 +02:00
Mathias Vorreiter Pedersen
d56284fe8f
C++: Move added flow from simpleLocalFlowStep to simpleInstructionLocalFlowStep and remove flow that could cause field conflation
2020-04-07 16:00:40 +02:00
Mathias Vorreiter Pedersen
5719967a8e
C++: Remove single-field case from PostUpdateNode and accept tests
2020-04-07 12:03:28 +02:00
Geoffrey White
d5accc70e1
C++: Add a test similar to issues/44.
2020-04-06 16:47:24 +01:00
Mathias Vorreiter Pedersen
c577541850
C++: Fix reverse read dataflow consistency failure and accept tests
2020-04-06 15:50:08 +02:00
Mathias Vorreiter Pedersen
317734f41e
C++: Attach PostUpdateNodes to Chi nodes following aschackmull's suggestion
2020-04-05 22:35:26 +02:00
Jonas Jensen
16c7a35b1c
Merge pull request #3195 from geoffw0/taintstring
...
C++: Model taint flow through std::string constructor and c_str()
2020-04-03 12:05:07 +02:00
Robert Marsh
a8e191248e
Merge branch 'master' into rdmarsh/cpp/ir-flow-through-outparams
...
Merge IR SSA test additions
2020-04-02 15:30:20 -07:00
Geoffrey White
73171682b7
C++: Switch to taint flow as suggested in the old PR.
2020-04-02 19:49:41 +01:00
Geoffrey White
b14b52d0ac
C++: Add models for std::string (as in old PR).
2020-04-02 19:49:41 +01:00
Geoffrey White
69f6790c83
C++: Add a test of taint through std::strings, based on the one in the old PR.
2020-04-02 19:49:31 +01:00
Mathias Vorreiter Pedersen
a273917e51
Merge branch 'master' into init-dynamic-alloc-newexpr
2020-04-02 14:11:03 +02:00
Mathias Vorreiter Pedersen
af9e05b9cd
C++: Accept test
2020-04-02 10:57:11 +02:00
Mathias Vorreiter Pedersen
020c273dc9
Merge branch 'master' into ir-flow-fields
2020-04-02 10:45:58 +02:00
Robert Marsh
a061811939
Merge branch 'master' into rdmarsh/cpp/ir-flow-through-outparams
...
Pick up new test for user-defined swap functions
2020-04-01 17:32:55 -07:00
Geoffrey White
7a98919879
C++: Add a non-standard swap to taint tests.
2020-04-01 17:14:38 +01:00
Robert Marsh
25f3f67c4a
Merge branch 'master' into rdmarsh/cpp/ir-flow-through-outparams
...
Fixes test conflicts and reveals a bug in parameter handling
2020-03-31 12:54:00 -07:00
Mathias Vorreiter Pedersen
f06ae6e9de
C++: Accept more test output
2020-03-31 19:49:04 +02:00
Mathias Vorreiter Pedersen
688464a00f
C++: Add testcases with new and accept output
2020-03-31 12:22:07 +02:00
Jonas Jensen
531ef64c5d
C++: Fix other copies of the argHasPostUpdate test
2020-03-30 17:45:53 +02:00
Jonas Jensen
dd322be238
C++: Remove noise from argHasPostUpdate check
...
This consistency check seems to have value for AST data flow, but I've
disabled it on the IR for now.
This commit also includes two unrelated changes that seem to fix a
semantic merge conflict.
2020-03-30 15:51:11 +02:00
Tom Hvitved
9fa9c10361
Merge pull request #2921 from aschackmull/dataflow/consistency-checks
...
Java: Add data-flow consistency checks.
2020-03-30 12:47:41 +02:00