3579 Commits

Author SHA1 Message Date
Geoffrey White
974994ed49 CPP: Slight rearrange. 2020-01-22 16:11:51 +00:00
Geoffrey White
1a6f7febe7 CPP: Add tests of taint through qualifiers. 2020-01-22 16:11:13 +00:00
Jonas Jensen
adc557fd66 C++: Reformat a predicate
This allows adding a multi-line case without the auto-formatting changes
becoming too disruptive.
2020-01-22 16:50:25 +01:00
Jonas Jensen
3827411095 Merge branch 'dbartol/NoEscape' into HEAD 2020-01-22 16:21:24 +01:00
Jonas Jensen
66914e52c6 C++: accept test changes 2020-01-22 14:08:05 +01:00
Jonas Jensen
5ae1e2c4e8 C++: Autoformat 2020-01-22 14:07:55 +01:00
Jonas Jensen
6cdca29aa6 C++: Flow through read side effects
Until we have better tracking of indirections, these flow rules conflate
pointers and their contents.
2020-01-22 13:27:10 +01:00
Jonas Jensen
c24bceddcd C++: Add ReadSideEffectInstruction to IR
There was already a `WriteSideEffectInstruction` class that served as a
superclass for all the specific write side effects. This new class
serves the same purpose for read side effects.
2020-01-22 13:27:10 +01:00
Jonas Jensen
2aaf41a0d8 C++: Test lack of flow through read side effect 2020-01-22 13:27:10 +01:00
Tom Hvitved
d5daee4450 Merge pull request #2661 from aschackmull/java/remove-dataflowlocation
Java/C++/C#: Remove DataFlowLocation as it's no longer needed.
2020-01-22 12:11:24 +01:00
Dave Bartolomeo
9d35ff73c4 C++/C#: Make escape analysis unsound by default
When building SSA, we'll be assuming that stack variables do not escape, at least until we improve our alias analysis. I've added a new `IREscapeAnalysisConfiguration` class to allow the query to control this, and a new `UseSoundEscapeAnalysis.qll` module that can be imported to switch to the sound escape analysis. I've cloned the existing IR and SSA tests to have both sound and unsound versions. There were relatively few diffs in the IR dump tests, and the sanity tests still give the same results after one change described below.

Assuming that stack variables do not escape exposed an existing bug where we do not emit an `Uninitialized` instruction for the temporary variables used by `return` statements and `throw` expressions, even if the initializer is a constructor call or array initializer. I've refactored the code for handling elements that initialize a variable to share a common base class. I added a test case for returning an object initialized by constructor call, and ensured that the IR diffs for the existing `throw` test cases are correct.
2020-01-22 00:15:30 -07:00
Anders Schack-Mulligen
9cc0d3d1f4 Java/C++/C#: Remove DataFlowLocation as it's no longer needed. 2020-01-21 15:08:39 +01:00
Jonas Jensen
84811f66a2 C++: autoformat 2020-01-21 13:21:16 +01:00
Jonas Jensen
6d46e4d946 C++: Wire up models to DefaultTaintTracking
This adds support for arg-to-arg and arg-to-return taint.
2020-01-21 12:04:45 +01:00
Jonas Jensen
fa00e96ba8 C++: Test IR taint through library functions 2020-01-21 12:03:43 +01:00
Jonas Jensen
5ac56c2e3a C++: Add DataFlow::Node.asDefiningArgument in IR 2020-01-21 11:52:06 +01:00
Geoffrey White
80997a3323 Merge pull request #2655 from Semmle/jbj-patch-1
C++: Fix typo in MallocSizeExpr
2020-01-21 09:44:41 +00:00
Jonas Jensen
cdcd3ed748 Merge pull request #2647 from geoffw0/modelpure
CPP: Improve strlen model
2020-01-21 09:42:10 +01:00
Jonas Jensen
0568ed6451 C++: Fix typo in MallocSizeExpr
The first argument is index 0, not 1.
2020-01-21 09:09:49 +01:00
Mathias Vorreiter Pedersen
c9cc459baf C++: Rename .qlhelp to .qhelp 2020-01-20 21:17:53 +01:00
Mathias Vorreiter Pedersen
fddd3660ab C++: Fix formatting in example 2020-01-20 16:05:16 +01:00
Geoffrey White
4f02183dc2 CPP: Re-layout test. 2020-01-20 15:00:09 +00:00
Geoffrey White
2133fbd155 CPP: Fix the nulltermination test. 2020-01-20 14:55:52 +00:00
Geoffrey White
952b9e1581 CPP: Use hasGlobalName where appropriate. 2020-01-20 14:24:38 +00:00
Mathias Vorreiter Pedersen
13fc8741d4 C++: Include malloc example in qlhelp 2020-01-20 13:28:00 +01:00
Geoffrey White
79811fcccd Merge pull request #2642 from jbj/TaintTracking-indirection
C++: Indirection for security.TaintTracking impl
2020-01-20 12:25:51 +00:00
Geoffrey White
5a20e85598 Merge pull request #2638 from jbj/ir-dispatch
C++ IR: Support for global virtual dispatch
2020-01-20 12:04:09 +00:00
Mathias Vorreiter Pedersen
a43131a987 C++: Fix formatting 2020-01-20 11:39:48 +01:00
Jonas Jensen
391b80eac4 C++: Show virtual inheritance problem in vdispatch 2020-01-20 11:17:44 +01:00
Jonas Jensen
2a0fc31b68 C++: Comment and rename getSrc -> getDispatchValue
Better clarity was requested in the PR review.
2020-01-20 11:03:03 +01:00
Jonas Jensen
742bd1c6ad Merge pull request #2648 from rdmarsh2/getMemoryOperandDefinition-perf
C++: Performance fix for getMemoryOperandDefinition
2020-01-20 08:49:55 +01:00
Jonas Jensen
d3a1856793 Merge pull request #2646 from geoffw0/modelinet
CPP: Fix a mistake in Inet.qll.
2020-01-17 22:53:43 +01:00
Geoffrey White
fcea3693f9 CPP: Remove now redundant special cases. 2020-01-17 18:56:21 +00:00
Geoffrey White
200545d88c CPP: Add detail to the model. 2020-01-17 18:56:21 +00:00
Geoffrey White
77a3778eef CPP: Add some strlen variants to the PureStrFunction model. 2020-01-17 18:56:21 +00:00
Jonas Jensen
3632d51abc Merge pull request #2635 from geoffw0/modelstrdup
CPP: Model strdup
2020-01-17 19:26:26 +01:00
Geoffrey White
803da339a1 CPP: Fix a mistake in Inet.qll. 2020-01-17 17:44:42 +00:00
Geoffrey White
e4139fe427 Apply suggestions from code review
Additional corrections.

Co-Authored-By: Dave Bartolomeo <dbartol@github.com>
2020-01-17 17:20:37 +00:00
Geoffrey White
839fd8f848 CPP: Fix typo. 2020-01-17 16:10:41 +00:00
Robert Marsh
bd98427c5a C++: sync files 2020-01-17 08:05:40 -08:00
Robert Marsh
bbf191e857 C++: fix join order in hasMemoryOperandDefinition 2020-01-17 08:05:40 -08:00
Robert Marsh
d91bc4ba72 C++: pull out hasMemoryOperandDefinition (slow) 2020-01-17 08:05:26 -08:00
Dave Bartolomeo
c7e62b4a35 Merge pull request #2613 from rdmarsh2/getPhiOperandDefinition-perf-2
C++: performance fixes for getPhiOperandDefinition
2020-01-17 09:01:33 -07:00
Mathias Vorreiter Pedersen
cd644ca5f2 Merge branch 'implicit-function-declaration' of github.com:MathiasVP/ql into implicit-function-declaration 2020-01-17 14:52:23 +01:00
Mathias Vorreiter Pedersen
303c6aa5b7 C++: Added query to suites and change-notes 2020-01-17 14:51:40 +01:00
Mathias Vorreiter Pedersen
4fc325f794 C++: Raise query to warning-high 2020-01-17 13:59:25 +01:00
Mathias Vorreiter Pedersen
aaf2679bf7 Remove incorrect html tag
Co-Authored-By: Jonas Jensen <jbj@github.com>
2020-01-17 13:52:38 +01:00
Mathias Vorreiter Pedersen
e79c0820ef Fix reference
Co-Authored-By: Jonas Jensen <jbj@github.com>
2020-01-17 13:51:14 +01:00
Jonas Jensen
53e10e4c7f Merge pull request #2634 from MathiasVP/overrideable-taint-sources
C++: Overrideable taint sources in DefaultTaintTracking
2020-01-17 13:01:03 +01:00
Mathias Vorreiter Pedersen
9e71e7f2ef C++: Added .qlhelp file 2020-01-17 12:58:10 +01:00