Commit Graph

1364 Commits

Author SHA1 Message Date
REDMOND\brodes
a2fe19af38 Initial progress on key agreement. 2025-04-04 16:00:05 -04:00
REDMOND\brodes
697c9f0bb0 Elliptic curve AVCs are incorrect, but I'm not sure how to fix them generally. Putting in a stop gap to use 'isCipherAVC' for now. 2025-04-04 09:02:09 -04:00
Anders Schack-Mulligen
ea8cd6f758 Merge pull request #19160 from aschackmull/ssa/deprecate-definitionext
Ssa: Deprecate the public DefinitionExt and PhiReadNode
2025-04-04 09:23:08 +02:00
Anders Schack-Mulligen
ce19972aef SSA: Reinstate consistency check. 2025-04-03 16:16:20 +02:00
Asger F
c49ffa01ee JS: Enable post-processed inline expectations for query predicates 2025-04-03 13:24:17 +02:00
Anders Schack-Mulligen
6ac4cb71cb SSA: Add change note. 2025-04-03 09:57:48 +02:00
Anders Schack-Mulligen
34554fd000 SSA: Deprecate the public DefinitionExt. 2025-04-03 09:47:50 +02:00
REDMOND\brodes
66a60296b8 Merge branch 'brodes/cipher_operation' into brodes/elliptic_curves 2025-04-02 13:46:12 -04:00
Nicolas Will
50507586ac Refactor output artifact type 2025-04-02 19:44:57 +02:00
Tom Hvitved
a01b211f79 Merge pull request #19185 from hvitved/rust/ssa-capture-psudeo-read-dominate
Rust: Fix `capturedCallRead`
2025-04-02 19:16:55 +02:00
Taus
f461763938 Merge pull request #19186 from github/tausbn/actions-fix-gettargetpath-performance
Actions: Fix bad performance in `getTargetPath`
2025-04-02 12:53:56 +02:00
Anders Schack-Mulligen
47b1c3d3ce Merge pull request #19154 from aschackmull/ssa/variablecapture
Ssa: Replace phi-read references in VariableCapture with default use-use flow
2025-04-02 10:16:17 +02:00
REDMOND\brodes
ac96649a02 Misc. modifications to support elliptic curves and hooking them up to keygeneration. 2025-04-01 16:15:49 -04:00
Taus
8afdf25e9a Actions: Mark helper predicate as noinline. 2025-04-01 14:50:00 +00:00
Taus
c9fc7882e6 Actions: Fix bad performance in getTargetPath
Seen on `github/codeql`, some queries had very poor performance:
```
 [2/24 eval 36m4s] Evaluation done; writing results to
codeql/actions-queries/Security/CWE-312/ExcessiveSecretsExposure.bqrs
```

Investigating further lead to the following worrying sequence of joins
(after I ran out of patience and cancelled the query):
```
[2025-04-01 12:31:03] Tuple counts for
Yaml::YamlInclude.getTargetPath/0#dispred#32565107#fb#reorder_1_0/2@i6#9f4b2jw1
after 8m40s:
...
    559418    ~33%        {1} r5 = SCAN
`Yaml::YamlNode.getLocation/0#dispred#24555c57#prev_delta` OUTPUT In.1
...
    909345525 ~821%       {3} r7 = JOIN r5 WITH
`Yaml::YamlNode.getLocation/0#dispred#24555c57#prev` CARTESIAN PRODUCT
OUTPUT Rhs.1, Lhs.0 'result', Rhs.0
    909342139 ~779%       {3}    | JOIN WITH
`Locations::Location.getFile/0#dispred#dcf38c8d#prev` ON FIRST 1 OUTPUT
Rhs.1, Lhs.1 'result', Lhs.2
    909338753 ~794%       {3}    | JOIN WITH containerparent_10#join_rhs
ON FIRST 1 OUTPUT Rhs.1, Lhs.1 'result', Lhs.2
    909335367 ~824%       {3}    | JOIN WITH
`FileSystem::Container.getAbsolutePath/0#dispred#d234e6fa` ON FIRST 1
OUTPUT Lhs.2, Lhs.1 'result', Rhs.1
    883246724 ~812%       {3}    | JOIN WITH
`Yaml::YamlNode.getDocument/0#dispred#ee1eb3bf#bf_10#join_rhs` ON FIRST
1 OUTPUT Rhs.1 'this', Lhs.1 'result', Lhs.2
    760047185 ~838%       {5}    | JOIN WITH yaml_scalars ON FIRST 1
OUTPUT Lhs.1 'result', Lhs.0 'this', Rhs.2, _, Lhs.2
    0         ~0%         {4}    | REWRITE WITH Tmp.3 := "/", Out.3 :=
(In.4 ++ Tmp.3 ++ InOut.2), TEST Out.3 = InOut.0 KEEPING 4
                        {4}    | REWRITE WITH NOT [TEST InOut.2
startsWith "/"]
...
```

The culprit turned out to be the following method on class `YamlInclude`
```ql
private string getTargetPath() {
    exists(string path | path = this.getValue() |
    if path.matches("/%")
    then result = path
    else
        result =

this.getDocument().getLocation().getFile().getParentContainer().getAbsolutePath()
+ "/" +
            path
    )
}
```

Basically, in the `else` branch, the evaluator was producing all
possible values of `result` before filtering out the ones where the
`path` component started with a forward slash.

To fix this, I opted to factor out the logic into two helper predicates,
each accounting for whether `this.getValue()` does or does not start
with a `/`. With this, evaluating the original query from a clean cache
takes roughly 3.3s.
2025-04-01 13:59:19 +00:00
Tom Hvitved
9dea9f5046 SSA: Make phiWithoutTwoPriorRefs consistency check more informative 2025-04-01 15:07:46 +02:00
github-actions[bot]
10205cb990 Post-release preparation for codeql-cli-2.21.0 2025-04-01 11:30:43 +00:00
github-actions[bot]
84f6564cc0 Release preparation for version 2.21.0 2025-03-31 17:35:15 +00:00
Anders Schack-Mulligen
b4daba30a5 SSA: Remove dead code. 2025-03-31 10:49:10 +02:00
Anders Schack-Mulligen
70e53c2f8b SSA: Push includeWriteDefsInFlowStep constraint into newtype. 2025-03-31 10:49:10 +02:00
Anders Schack-Mulligen
ca6444ce98 VariableCapture: Replace phi-read reference with SSA data flow integration module. 2025-03-31 10:49:09 +02:00
Anders Schack-Mulligen
a8b19d2b21 Merge pull request #19147 from aschackmull/ssa/writedef-source-refactor
Ssa: Refactor data flow integration to make the input signature simpler
2025-03-31 10:07:09 +02:00
Paolo Tranquilli
96f7dc7eb4 Merge pull request #19083 from github/redsun82/rust-analyzer-update
Rust: update rust-analyzer from `0.0.266` to `0.0.270`
2025-03-28 15:04:09 +01:00
Simon Friis Vindum
884c828452 Merge pull request #19102 from paldepind/rust-ti-refactor
Shared, type inference: Add inference for type parameters with constraints (base type mentions)
2025-03-28 13:58:16 +01:00
Simon Friis Vindum
989c14485d Rust: Minor doc tweaks based on PR comments 2025-03-28 13:39:42 +01:00
Paolo Tranquilli
76b1349068 Merge branch 'main' into redsun82/rust-analyzer-update 2025-03-28 13:36:48 +01:00
Anders Schack-Mulligen
0d1ac7789b SSA/Ruby: Address review comments. 2025-03-28 13:27:56 +01:00
Simon Friis Vindum
623bc232bf Rust: Address PR comments 2025-03-28 13:04:55 +01:00
Anders Schack-Mulligen
5a986f5327 SSA: Remove empty predicates and dead code. 2025-03-28 12:00:38 +01:00
Anders Schack-Mulligen
1ded4df3fd SSA: Add an alternative to ssaDefAssigns/ssaDefInitializesParam. 2025-03-28 11:57:26 +01:00
Anders Schack-Mulligen
0c74f21107 Merge pull request #19044 from aschackmull/ssa/useuse-trim
Ssa: Trim the use-use relation to skip irrelevant nodes
2025-03-28 11:55:34 +01:00
Anders Schack-Mulligen
c6cee489e4 SSA: Address review comments. 2025-03-28 10:53:03 +01:00
Michael Nebel
8763d18c91 C#: Correct printing of out and ref notes in the model generator. 2025-03-26 15:06:26 +01:00
Nicolas Will
bec69ca106 Refactor consumer and generic source model 2025-03-26 13:27:32 +01:00
Paolo Tranquilli
7cfed3c4a7 Merge branch 'main' into redsun82/rust-analyzer-update 2025-03-25 18:29:39 +01:00
Simon Friis Vindum
520e27ccfa Shared: Fix typos in qldoc 2025-03-25 15:49:03 +01:00
Simon Friis Vindum
54e7bb7f1a Rust: Fix a bad join by adding bindingset to resolveTypeMentionRoot 2025-03-25 14:26:24 +01:00
Anders Schack-Mulligen
d5d0274ce7 Java/SSA: Keep proper distinction between cached stages. 2025-03-25 13:43:55 +01:00
Anders Schack-Mulligen
4d04391b70 C++: Keep all phi input back edges. 2025-03-25 13:21:13 +01:00
Anders Schack-Mulligen
0162b84d20 SSA: Fix a poor join-order and avoid SSA recomputation. 2025-03-25 12:31:03 +01:00
Anders Schack-Mulligen
36532bc58c SSA: Skip identity steps. 2025-03-25 12:31:02 +01:00
Anders Schack-Mulligen
4e2ad9712c SSA: Skip phi nodes with unique successor. 2025-03-25 12:31:02 +01:00
Anders Schack-Mulligen
669f9261f1 SSA: Skip irrelevant phi input nodes. 2025-03-25 12:31:01 +01:00
Anders Schack-Mulligen
c778bf6343 SSA: Rename SsaInputDefinitionExt 2025-03-25 12:31:01 +01:00
Anders Schack-Mulligen
5aa7029934 SSA: Add support for skipping WriteDefinitions in use-use. 2025-03-25 12:31:00 +01:00
Simon Friis Vindum
06c8963f70 Shared: Infer types for type parameters with contraints 2025-03-25 09:03:44 +01:00
Simon Friis Vindum
ba9edf8d25 Shared: Refactor type inference 2025-03-25 06:32:36 +01:00
Simon Friis Vindum
7dc49da6b0 Shared: Fix path in qldoc
Co-authored-by: Anders Schack-Mulligen <aschackmull@users.noreply.github.com>
2025-03-24 11:38:15 +01:00
Nicolas Will
e9c3e14fab Merge branch 'brodes/cipher_operation' of https://github.com/nicolaswill/codeql into brodes/cipher_operation 2025-03-22 08:01:06 +01:00
Nicolas Will
fb7c003398 Add initial MAC support for JCA, refactor hashes 2025-03-22 08:01:03 +01:00