Commit Graph

3353 Commits

Author SHA1 Message Date
yoff
de05bfbce3 java: address review comments
- do not use `getQualifiedName`
- use camelCase
- rework alert predicates
2025-10-21 13:25:26 +02:00
yoff
715acefacc Apply suggestions from code review
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2025-10-21 12:52:59 +02:00
yoff
3a0a8999d5 java: fix ql alerts 2025-10-17 01:52:23 +02:00
yoff
61a3e9630f java: rewrite conflict detection
- favour unary predicates over binary ones
(the natural "conflicting access" is binary)
- switch to a dual solution to trade recursion through forall for simple existentials.

Co-authored-by: Anders Schack-Mulligen <aschackmull@github.com>
2025-10-17 01:43:04 +02:00
yoff
5109babd92 java: add qldoc
These interfaces were previously in a .ql file.
Also, use the XXAccess variants.
2025-10-09 14:20:28 +02:00
yoff
1ad239459f java: move shared code into Concurrency.qll 2025-10-09 13:36:35 +02:00
yoff
f90e9dbb5e java: favour inline_late over inline
This gives much greater control over the join-order
2025-10-09 13:01:25 +02:00
yoff
830f02af1f java: fixes from the CI bots 2025-10-09 09:37:31 +02:00
yoff
93fc287ef1 java: add auto-generated overlay annotations 2025-10-09 09:25:57 +02:00
yoff
a1671ea8af java: small cleanups
- add missing qldoc
- remove use of `getErasure`
- remove use of `getTypeDescriptor`
- define `ExposedField`
2025-10-09 09:16:25 +02:00
yoff
821b1de5b3 java: inline char pred 2025-10-09 09:16:25 +02:00
yoff
01ddc11fa7 java: address some review comments 2025-10-09 09:16:25 +02:00
yoff
77734f83d5 java: better detection of thread safe fields.
Identified by triage of DCA results.
Previously, we did not use the erased type, so would not recgnize `CompletableFuture<R>`.
We now also recognize safe initializers.
2025-10-09 09:16:25 +02:00
yoff
096d5f2a56 java: implement SCC contraction of the call graph
Our monitor analysis would be fooled by cycles in the call graph,
since it required all edges on a path to a conflicting access to be either
 - targetting a method where the access is monitored (recursively) or
 - monitored locally, that is the call is monitored in the calling method
For access to be monitored (first case) all outgoing edges (towards an access) need
to satisfy this property. For a loop, that is too strong, only edges out of the loop
actually need to be protected. This led to FPs.
2025-10-09 09:14:16 +02:00
yoff
fe487e8bf0 java: add ThreadSafe query (P3)
Co-authored-by: Raúl Pardo <raul.pardo@protonmail.com>
Co-authored-by: SimonJorgensenMancofi <simon.jorgensen@mancofi.dk>
Co-authored-by: Bjørnar Haugstad Jåtten <bjornjaat@hotmail.com>
2025-10-09 09:14:16 +02:00
Alex Eyers-Taylor
77d4af153d Java: Make some query libraries local. 2025-10-07 18:24:37 +01:00
Alex Eyers-Taylor
542bdf0792 Java: Use Overlay dataflow in java. 2025-10-07 17:52:12 +01:00
Alex Eyers-Taylor
c49e2ab2da DataFlow: Add code to do overlay informed dataflow. 2025-10-07 17:52:12 +01:00
Anders Schack-Mulligen
11665bea0a Java: Allow taint-read-steps for array sources. 2025-10-07 10:10:02 +02:00
Anders Schack-Mulligen
ca7d56023a ControlFlow: Rename getAPhiInput to getAnInput. 2025-10-03 15:29:31 +02:00
Kasper Svendsen
b52fff2f81 Merge pull request #20505 from kaspersv/kaspersv/future-proof-java-discarding2
Overlay: Discard Java config and XML base entities in overlay extracted files
2025-09-29 13:01:08 +02:00
Kasper Svendsen
f02da68c55 Overlay: Discard base XML entities in overlay extracted files 2025-09-23 12:27:51 +02:00
Kasper Svendsen
718c0abdb6 Overlay: Discard base config entities in overlay extracted files 2025-09-23 12:27:51 +02:00
Simon Friis Vindum
7d6e2060e5 Adapt all languages to changes in shared library 2025-09-22 14:18:58 +02:00
Kasper Svendsen
97d62950a8 Merge pull request #20484 from kaspersv/kaspersv/future-proof-java-discarding
Overlay: Future-proof Java config & XML discard predicates
2025-09-22 08:16:44 +02:00
Alexander Eyers-Taylor
c1c0828082 Merge pull request #20378 from github/alexet/java-regex-local
Jave: Use force local to make parsing local after global regex finding.
2025-09-19 13:48:43 +01:00
Kasper Svendsen
dbb9a26f78 Overlay: Future-proof Java XML discarding 2025-09-18 11:37:38 +02:00
Kasper Svendsen
3cd737e40d Overlay: Future-proof Java config discarding 2025-09-18 10:57:22 +02:00
Alex Eyers-Taylor
34b40a14e8 Java: Make a TC overlay caller. 2025-09-17 16:22:22 +01:00
Alex Eyers-Taylor
2201974844 Jave: Use force local to make parsing local after global regex finding. 2025-09-16 15:55:04 +01:00
Anders Schack-Mulligen
f9ffee010f Java: Minor nullness cleanup. 2025-09-12 15:41:17 +02:00
Anders Schack-Mulligen
60d07cf30d Java: Clean up IntegerGuards.qll 2025-09-12 15:41:16 +02:00
Anders Schack-Mulligen
03321ff910 Java: Replace nullness implementation. 2025-09-12 15:41:16 +02:00
Anders Schack-Mulligen
4a8ffea0f6 Shared: Add control flow reachability lib. 2025-09-12 15:41:15 +02:00
Anders Schack-Mulligen
924a8eac5c Java: Improve precision of SuccessorType labels in CFG. 2025-09-12 13:38:21 +02:00
Anders Schack-Mulligen
db1f399067 Java: Preparatory Nullness refactor. 2025-09-12 13:38:20 +02:00
Anders Schack-Mulligen
e8ddac08b7 Merge pull request #20377 from aschackmull/java/preconditions
Java: Consolidate Assertions.qll and Preconditions.qll.
2025-09-12 13:37:41 +02:00
Alex Eyers-Taylor
d5ee91b1e8 Java: Adress comments form code review. 2025-09-11 17:14:08 +01:00
Alex Eyers-Taylor
dcc5572767 Java: Hnalde global files as exceptions rather than annotating them
This allows us to merge them without redundent annoations for now.
2025-09-10 17:26:54 +01:00
Alex Eyers-Taylor
5c19aad012 Java: Make Virtual Dispatch Global, but keep SSA local.
Use forceLocal to achive this.
2025-09-10 17:26:54 +01:00
Anders Schack-Mulligen
3815503314 Java: Consolidate Assertions.qll and Preconditions.qll. 2025-09-10 15:42:18 +02:00
Anders Schack-Mulligen
4c1fa58367 Java: Fix more broken performance. 2025-09-08 14:12:00 +02:00
idrissrio
ed9ed43923 Java: Address review comment. Improve getAnImportedType definition 2025-09-06 12:38:44 +02:00
idrissrio
1caf18ede1 Java: Address review comment. Improve module-import documentation 2025-09-06 12:38:43 +02:00
idrissrio
c5ee0f3c22 Java: Add ModuleImportDeclaration QL class 2025-09-06 12:38:39 +02:00
Idriss Riouak
e719dd912d Merge pull request #20116 from github/idrissrio/compact-soruce-file
Java: Add support to Compact Source Files
2025-09-05 12:01:48 +02:00
idrissrio
fc1b9277b3 Java: extend definition of isCompilerGenerated for classes 2025-09-05 10:19:04 +02:00
idrissrio
81b1e73e18 Java: Add isImplict predicate to CompilationUnit and Class 2025-09-05 10:18:57 +02:00
Kasper Svendsen
dd99a2d3bd Merge pull request #20294 from github/kaspersv/discard-fields-and-classes
Overlay: Add discarding for Java classes, interfaces & fields
2025-09-04 10:05:15 +02:00
Anders Schack-Mulligen
f833fe0e6e Merge pull request #20300 from aschackmull/cfg/successortype
Shared: Add a shared SuccessorType implementation
2025-09-02 14:09:35 +02:00