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
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
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
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
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
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
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
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
Jonas Jensen
d19c77d473
C++: Indirection for security.TaintTracking impl
...
This change should make it easier to switch to the IR-based
`DefaultTaintTracking` code without getting a large and conflict-prone
diff.
2020-01-17 12:04:53 +01:00
Jonas Jensen
5d08a0e338
Merge pull request #2558 from MathiasVP/ast-classes-should-not-be-abstract
...
C++: Ast classes should not be abstract
2020-01-17 08:47:55 +01:00
Geoffrey White
3c41ed56a1
CPP: Support taint to return value derefs instead.
2020-01-16 18:15:21 +00:00
Robert Marsh
e0406190a1
Merge branch 'master' into getPhiOperandDefinition-perf-2
2020-01-16 07:23:59 -08:00
Robert Marsh
c942da524c
C++/C#: Sync
2020-01-16 07:16:57 -08:00
Robert Marsh
1b5d33023e
C++: actually fix Chi total operands
2020-01-16 07:15:08 -08:00
Jonas Jensen
f4d0c5e905
C++ IR: Support for global virtual dispatch
...
The IR data flow library now supports virtual dispatch with a library
that's similar to `security.TaintTracking`. In particular, it should
have the same performance characteristics. The main difference is that
non-recursive callers of `flowsFrom` now pass `_` instead of `true` for
`boolean allowFromArg`. This change allows flow through `return` to
actually work.
2020-01-16 14:51:28 +01:00
Geoffrey White
ef47563139
CPP: Support flow of pointed-to things through function calls.
2020-01-16 11:08:19 +00:00
Mathias Vorreiter Pedersen
87c59e0017
C++: Overrideable taint sources in DefaultTaintTracking
2020-01-16 11:10:43 +01:00
Mathias Vorreiter Pedersen
603b1c26a7
Merge branch 'master' into ast-classes-should-not-be-abstract
2020-01-16 10:16:03 +01:00
Dave Bartolomeo
48301e1187
Merge pull request #2594 from rdmarsh2/ir-overlappingVariableMemoryLocations
...
C++: compute overlap on irvars with vvar indexes
2020-01-15 13:06:33 -07:00
Geoffrey White
04af2ace94
CPP: Add DataFlow to strdup.
2020-01-15 19:18:37 +00:00
Geoffrey White
9b5be995d2
CPP: Split Strdup model into it's own class and file.
2020-01-15 18:38:33 +00:00
Geoffrey White
ce389ca791
CPP: Add tests for strdup.
2020-01-15 18:26:24 +00:00
Robert Marsh
a91f10fe40
Merge pull request #2629 from dbartol/dbartol/missing-vvars
...
C++/C#: Fix missing virtual variables
2020-01-15 08:32:43 -08:00
Tom Hvitved
f7278d36e1
Merge pull request #2498 from aschackmull/java/taint-getter
...
Java/C++/C#: Add support for taint-getter/setter summaries in data flow.
2020-01-15 09:55:19 +01:00
Dave Bartolomeo
e60f902c36
C++/C#: Fix missing virtual variables
...
The aliased SSA code was assuming that, for every automatic variable, there would be at least one memory access that reads or writes the entire variable. We've encountered a couple cases where that isn't true due to extractor issues. As a workaround, we now always create the `VariableMemoryLocation` for every local variable.
I've also added a sanity test to detect this condition in the future.
Along the way, I had to fix a perf issue in the PrintIR code. When determining the ID of a result based on line number, we were considering all `Instruction`s generated for a particular line, regardless of whether they were all in the same `IRFunction`. In addition, the predicate had what appeared to be a bad join order that made it take forever on large snapshots. I've scoped it down to just consider `Instruction`s in the same function, and outlined that predicate to fix the join order issue. This causes some numbering changes, but they're for the better. I don't think there was actually any nondeterminism there before, but now the numbering won't depend on the number of instantiations of a template, either.
2020-01-14 17:57:15 -07:00
Robert Marsh
42be28b211
C++: autoformat
2020-01-14 13:17:57 -08:00
Robert Marsh
5a5832b7de
Merge pull request #2569 from jbj/ir-total-chi-flow
...
C++: IR data flow through total chi operands
2020-01-14 12:47:58 -08:00
Anders Schack-Mulligen
241b8a05e4
Java/C++/C#: Address review comment.
2020-01-14 11:59:55 +01:00
Anders Schack-Mulligen
041bcc5812
Java/C++/C#: Small perf improvement and simplification.
2020-01-13 17:00:56 +01:00
Jonas Jensen
b8ee5a63db
Merge pull request #2614 from geoffw0/arithun
...
CPP: Speed up ArithmeticUncontrolled.ql
2020-01-13 15:25:12 +01:00