Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge rc/3.11 into main #14367

Merged
merged 59 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
abf2b12
Release preparation for version 2.14.4
invalid-email-address Sep 5, 2023
163252d
Merge pull request #14147 from github/release-prep/2.14.4
cklin Sep 5, 2023
e08a873
JS: Tolerate TypeScript files being requested out of order
asgerf Sep 8, 2023
ea384b3
JS: Change note
asgerf Sep 8, 2023
e6a6a79
Revert "C#: Bump all dependencies"
hvitved Sep 6, 2023
354a55c
Merge pull request #14169 from hvitved/backport-fix
hvitved Sep 8, 2023
d5442ec
C++: Add regression test.
MathiasVP Sep 8, 2023
0be61be
C++: Handle flow out of post-update nodes when there's another use of…
MathiasVP Sep 8, 2023
9f89c63
C++: Accept test changes.
MathiasVP Sep 8, 2023
e1ffc8d
Merge pull request #14171 from MathiasVP/fix-dataflow-out-of-post-upd…
rdmarsh2 Sep 8, 2023
1a575ef
Merge pull request #14167 from asgerf/ts/tolerate-out-of-order-requests
cklin Sep 8, 2023
d699880
Post-release preparation for codeql-cli-2.14.4
invalid-email-address Sep 8, 2023
6fe9b70
C#: Poor mans quoting of arguments on windows.
michaelnebel Sep 8, 2023
7bcaa49
C#: Add integration test with quoted arguments.
michaelnebel Sep 6, 2023
d792175
Merge pull request #14174 from github/post-release-prep/codeql-cli-2.…
cklin Sep 12, 2023
edf6a80
Merge pull request #14185 from michaelnebel/csharp/quotinghotfixrc
dbartol Sep 13, 2023
c6b8c44
fix out of bounds string access in isUsingDecl
erik-krogh Sep 13, 2023
b019fb3
Merge pull request #14212 from erik-krogh/usingOutOfBounds-hotfix
erik-krogh Sep 13, 2023
cc3a76f
fix out of bounds string access in isUsingDecl
erik-krogh Sep 13, 2023
d8fb875
Merge pull request #14214 from github/cklin/pick-js-fix-2.14.5
cklin Sep 13, 2023
264e57f
Merge pull request #14222 from github/mergeback-codeql-cli-2.14.5
cklin Sep 14, 2023
d7278be
Go: Update `versionRe` to include patch version
mbg Sep 8, 2023
8dd7602
Merge pull request #14234 from github/mbg/go/1.21-update-version-regex
mbg Sep 15, 2023
7595523
Make general updates, add framework for new article
felicitymay Sep 11, 2023
4779c23
Draft content for VS Code extension
felicitymay Sep 12, 2023
8218397
Rename private beta article
felicitymay Sep 12, 2023
73ecb11
Update name of renamed article and add to index
felicitymay Sep 12, 2023
fde0459
Rename again
felicitymay Sep 12, 2023
67ff5ae
Add changes from Michael
felicitymay Sep 13, 2023
075cbfd
Split information extensions and predicates into 2 articles
felicitymay Sep 13, 2023
e865574
Add bare content from Google doc
felicitymay Sep 13, 2023
8c8bbde
Fix a few more typos
felicitymay Sep 13, 2023
7be0b2e
Fix Sphinx bugs
felicitymay Sep 13, 2023
34e5c5c
Start edits on using extension
felicitymay Sep 14, 2023
b42ab24
Try to fix sphinx errors
felicitymay Sep 14, 2023
488b824
Add first draft of CodeQL model editor
felicitymay Sep 14, 2023
93eff2a
A few more updates
felicitymay Sep 14, 2023
a4f3e5e
Apply suggestions from code review
felicitymay Sep 15, 2023
6b90ce0
Updates for review comments
felicitymay Sep 15, 2023
854c126
Update docs/codeql/codeql-language-guides/extensible-predicates.rst
felicitymay Sep 15, 2023
d10903a
Apply suggestions from code review
felicitymay Sep 15, 2023
c910293
Add missing language code
felicitymay Sep 15, 2023
d5c79d4
Add missing blank line
felicitymay Sep 15, 2023
ac26330
Apply suggestions from code review
felicitymay Sep 18, 2023
12a86f5
Update docs/codeql/codeql-language-guides/data-extensions-to-model-ja…
felicitymay Sep 18, 2023
da29336
Revert article name
felicitymay Sep 18, 2023
839f2a6
Remove unneeded link
felicitymay Sep 18, 2023
c2fa37e
Apply suggestions from code review
felicitymay Sep 18, 2023
1228a83
Rename article file
felicitymay Sep 18, 2023
7372562
Fix heading indicator syntax length
felicitymay Sep 18, 2023
7ed4f5b
Update docs/codeql/codeql-language-guides/customizing-library-models-…
felicitymay Sep 18, 2023
31b0c42
Merge pull request #14207 from github/felicitymay-11595-VS-code-docs
felicitymay Sep 18, 2023
0a36707
Release preparation for version 2.14.6
invalid-email-address Sep 19, 2023
2501a70
Merge pull request #14256 from github/release-prep/2.14.6
alexet Sep 19, 2023
3acf524
Post-release preparation for codeql-cli-2.14.6
invalid-email-address Sep 20, 2023
79b044d
Merge pull request #14271 from github/post-release-prep/codeql-cli-2.…
alexet Sep 27, 2023
f3847b3
Merge branch 'main' into henrymercer/rc-3.11-mergeback
henrymercer Oct 3, 2023
da92da2
Bump minor versions of packs we regularly release
henrymercer Oct 3, 2023
ecd8561
C#: Undo poor mans quoting fix as it conflicts with the permanent sol…
michaelnebel Oct 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions cpp/ql/lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## 0.9.3

No user-facing changes.

## 0.9.2

### Deprecated APIs

* `getAllocatorCall` on `DeleteExpr` and `DeleteArrayExpr` has been deprecated. `getDeallocatorCall` should be used instead.

### New Features

* Added `DeleteOrDeleteArrayExpr` as a super type of `DeleteExpr` and `DeleteArrayExpr`

### Minor Analysis Improvements

* `delete` and `delete[]` are now modeled as calls to the relevant `operator delete` in the IR. In the case of a dynamic delete call a new instruction `VirtualDeleteFunctionAddress` is used to represent a function that dispatches to the correct delete implementation.
* Only the 2 level indirection of `argv` (corresponding to `**argv`) is consided for `FlowSource`.

## 0.9.1

No user-facing changes.
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions cpp/ql/lib/change-notes/2023-08-29-delete-ir.md

This file was deleted.

14 changes: 14 additions & 0 deletions cpp/ql/lib/change-notes/released/0.9.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## 0.9.2

### Deprecated APIs

* `getAllocatorCall` on `DeleteExpr` and `DeleteArrayExpr` has been deprecated. `getDeallocatorCall` should be used instead.

### New Features

* Added `DeleteOrDeleteArrayExpr` as a super type of `DeleteExpr` and `DeleteArrayExpr`

### Minor Analysis Improvements

* `delete` and `delete[]` are now modeled as calls to the relevant `operator delete` in the IR. In the case of a dynamic delete call a new instruction `VirtualDeleteFunctionAddress` is used to represent a function that dispatches to the correct delete implementation.
* Only the 2 level indirection of `argv` (corresponding to `**argv`) is consided for `FlowSource`.
3 changes: 3 additions & 0 deletions cpp/ql/lib/change-notes/released/0.9.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.9.3

No user-facing changes.
2 changes: 1 addition & 1 deletion cpp/ql/lib/codeql-pack.release.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.9.1
lastReleaseVersion: 0.9.3
2 changes: 1 addition & 1 deletion cpp/ql/lib/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: codeql/cpp-all
version: 0.9.2-dev
version: 0.10.0-dev
groups: cpp
dbscheme: semmlecode.cpp.dbscheme
extractor: cpp
Expand Down
79 changes: 69 additions & 10 deletions cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaInternals.qll
Original file line number Diff line number Diff line change
Expand Up @@ -645,12 +645,24 @@ private predicate adjustForPointerArith(PostUpdateNode pun, UseOrPhi use) {
)
}

/**
* Holds if `nodeFrom` flows to `nodeTo` because there is `def-use` or
* `use-use` flow from `defOrUse` to `use`.
*
* `uncertain` is `true` if the `defOrUse` is an uncertain definition.
*/
private predicate localSsaFlow(
SsaDefOrUse defOrUse, Node nodeFrom, UseOrPhi use, Node nodeTo, boolean uncertain
) {
nodeToDefOrUse(nodeFrom, defOrUse, uncertain) and
adjacentDefRead(defOrUse, use) and
useToNode(use, nodeTo) and
nodeFrom != nodeTo
}

private predicate ssaFlowImpl(SsaDefOrUse defOrUse, Node nodeFrom, Node nodeTo, boolean uncertain) {
exists(UseOrPhi use |
nodeToDefOrUse(nodeFrom, defOrUse, uncertain) and
adjacentDefRead(defOrUse, use) and
useToNode(use, nodeTo) and
nodeFrom != nodeTo
localSsaFlow(defOrUse, nodeFrom, use, nodeTo, uncertain)
or
// Initial global variable value to a first use
nodeFrom.(InitialGlobalValue).getGlobalDef() = defOrUse and
Expand Down Expand Up @@ -728,15 +740,62 @@ private predicate isArgumentOfCallable(DataFlowCall call, Node n) {
)
}

/** Holds if there is def-use or use-use flow from `pun` to `nodeTo`. */
predicate postUpdateFlow(PostUpdateNode pun, Node nodeTo) {
exists(UseOrPhi use, Node preUpdate |
/**
* Holds if there is use-use flow from `pun`'s pre-update node to `n`.
*/
private predicate postUpdateNodeToFirstUse(PostUpdateNode pun, Node n) {
exists(UseOrPhi use |
adjustForPointerArith(pun, use) and
useToNode(use, nodeTo) and
useToNode(use, n)
)
}

private predicate stepUntilNotInCall(DataFlowCall call, Node n1, Node n2) {
isArgumentOfCallable(call, n1) and
exists(Node mid | localSsaFlow(_, n1, _, mid, _) |
isArgumentOfCallable(call, mid) and
stepUntilNotInCall(call, mid, n2)
or
not isArgumentOfCallable(call, mid) and
mid = n2
)
}

bindingset[n1, n2]
pragma[inline_late]
private predicate isArgumentOfSameCall(DataFlowCall call, Node n1, Node n2) {
isArgumentOfCallable(call, n1) and isArgumentOfCallable(call, n2)
}

/**
* Holds if there is def-use or use-use flow from `pun` to `nodeTo`.
*
* Note: This is more complex than it sounds. Consider a call such as:
* ```cpp
* write_first_argument(x, x);
* sink(x);
* ```
* Assume flow comes out of the first argument to `write_first_argument`. We
* don't want flow to go to the `x` that's also an argument to
* `write_first_argument` (because we just flowed out of that function, and we
* don't want to flow back into it again).
*
* We do, however, want flow from the output argument to `x` on the next line, and
* similarly we want flow from the second argument of `write_first_argument` to `x`
* on the next line.
*/
predicate postUpdateFlow(PostUpdateNode pun, Node nodeTo) {
exists(Node preUpdate, Node mid |
preUpdate = pun.getPreUpdateNode() and
not exists(DataFlowCall call |
isArgumentOfCallable(call, preUpdate) and isArgumentOfCallable(call, nodeTo)
postUpdateNodeToFirstUse(pun, mid)
|
exists(DataFlowCall call |
isArgumentOfSameCall(call, preUpdate, mid) and
stepUntilNotInCall(call, mid, nodeTo)
)
or
not isArgumentOfSameCall(_, preUpdate, mid) and
nodeTo = mid
)
}

Expand Down
16 changes: 16 additions & 0 deletions cpp/ql/src/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 0.7.5

No user-facing changes.

## 0.7.4

### New Queries

* Added a new query, `cpp/invalid-pointer-deref`, to detect out-of-bounds pointer reads and writes.

### Minor Analysis Improvements

* The "Comparison where assignment was intended" query (`cpp/compare-where-assign-meant`) no longer reports comparisons that appear in macro expansions.
* Some queries that had repeated results corresponding to different levels of indirection for `argv` now only have a single result.
* The `cpp/non-constant-format` query no longer considers an assignment on the right-hand side of another assignment to be a source of non-constant format strings. As a result, the query may now produce fewer results.

## 0.7.3

No user-facing changes.
Expand Down
4 changes: 0 additions & 4 deletions cpp/ql/src/change-notes/2023-08-21-invalid-pointer-deref.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 11 additions & 0 deletions cpp/ql/src/change-notes/released/0.7.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## 0.7.4

### New Queries

* Added a new query, `cpp/invalid-pointer-deref`, to detect out-of-bounds pointer reads and writes.

### Minor Analysis Improvements

* The "Comparison where assignment was intended" query (`cpp/compare-where-assign-meant`) no longer reports comparisons that appear in macro expansions.
* Some queries that had repeated results corresponding to different levels of indirection for `argv` now only have a single result.
* The `cpp/non-constant-format` query no longer considers an assignment on the right-hand side of another assignment to be a source of non-constant format strings. As a result, the query may now produce fewer results.
3 changes: 3 additions & 0 deletions cpp/ql/src/change-notes/released/0.7.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.7.5

No user-facing changes.
2 changes: 1 addition & 1 deletion cpp/ql/src/codeql-pack.release.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.7.3
lastReleaseVersion: 0.7.5
10 changes: 5 additions & 5 deletions cpp/ql/src/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: codeql/cpp-queries
version: 0.7.4-dev
groups:
version: 0.8.0-dev
groups:
- cpp
- queries
dependencies:
codeql/cpp-all: ${workspace}
codeql/suite-helpers: ${workspace}
codeql/util: ${workspace}
codeql/cpp-all: ${workspace}
codeql/suite-helpers: ${workspace}
codeql/util: ${workspace}
suites: codeql-suites
extractor: cpp
defaultSuiteFile: codeql-suites/cpp-code-scanning.qls
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WARNING: Module TaintedWithPath has been deprecated and may be removed in future (tainted.ql:10,8-47)
WARNING: Predicate tainted has been deprecated and may be removed in future (tainted.ql:21,3-28)
failures
testFailures
failures
8 changes: 8 additions & 0 deletions cpp/ql/test/library-tests/dataflow/dataflow-tests/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,4 +788,12 @@ void test_sometimes_calls_sink_switch() {
sometimes_calls_sink_switch(source(), 1);
sometimes_calls_sink_switch(0, 0);
sometimes_calls_sink_switch(source(), 0);
}

void intPointerSource(int *ref_source, const int* another_arg);

void test() {
MyStruct a;
intPointerSource(a.content, a.content);
indirect_sink(a.content); // $ ast ir
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@
| test.cpp:595:8:595:9 | xs | test.cpp:597:9:597:10 | xs |
| test.cpp:733:7:733:7 | x | test.cpp:734:41:734:41 | x |
| test.cpp:733:7:733:7 | x | test.cpp:735:8:735:8 | x |
| test.cpp:796:12:796:12 | a | test.cpp:797:20:797:20 | a |
| test.cpp:796:12:796:12 | a | test.cpp:797:31:797:31 | a |
| test.cpp:796:12:796:12 | a | test.cpp:798:17:798:17 | a |
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edges
| overflowdestination.cpp:50:52:50:54 | src indirection | overflowdestination.cpp:53:15:53:17 | src indirection |
| overflowdestination.cpp:50:52:50:54 | src indirection | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
| overflowdestination.cpp:53:9:53:12 | memcpy output argument | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
| overflowdestination.cpp:54:9:54:12 | memcpy output argument | overflowdestination.cpp:54:9:54:12 | memcpy output argument |
| overflowdestination.cpp:57:52:57:54 | src indirection | overflowdestination.cpp:64:16:64:19 | src2 indirection |
| overflowdestination.cpp:73:8:73:10 | fgets output argument | overflowdestination.cpp:75:30:75:32 | src indirection |
| overflowdestination.cpp:73:8:73:10 | fgets output argument | overflowdestination.cpp:76:30:76:32 | src indirection |
Expand Down
8 changes: 8 additions & 0 deletions csharp/ql/campaigns/Solorigate/lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.6.5

No user-facing changes.

## 1.6.4

No user-facing changes.

## 1.6.3

No user-facing changes.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.6.4

No user-facing changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.6.5

No user-facing changes.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.6.3
lastReleaseVersion: 1.6.5
8 changes: 4 additions & 4 deletions csharp/ql/campaigns/Solorigate/lib/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: codeql/csharp-solorigate-all
version: 1.6.4-dev
version: 1.7.0-dev
groups:
- csharp
- solorigate
- csharp
- solorigate
library: true
dependencies:
codeql/csharp-all: ${workspace}
codeql/csharp-all: ${workspace}
warnOnImplicitThis: true
8 changes: 8 additions & 0 deletions csharp/ql/campaigns/Solorigate/src/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 1.6.5

No user-facing changes.

## 1.6.4

No user-facing changes.

## 1.6.3

No user-facing changes.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.6.4

No user-facing changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.6.5

No user-facing changes.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.6.3
lastReleaseVersion: 1.6.5
10 changes: 5 additions & 5 deletions csharp/ql/campaigns/Solorigate/src/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: codeql/csharp-solorigate-queries
version: 1.6.4-dev
version: 1.7.0-dev
groups:
- csharp
- solorigate
- csharp
- solorigate
defaultSuiteFile: codeql-suites/solorigate.qls
dependencies:
codeql/csharp-all: ${workspace}
codeql/csharp-solorigate-all: ${workspace}
codeql/csharp-all: ${workspace}
codeql/csharp-solorigate-all: ${workspace}
warnOnImplicitThis: true
10 changes: 10 additions & 0 deletions csharp/ql/lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.7.5

No user-facing changes.

## 0.7.4

### Minor Analysis Improvements

* The `--nostdlib` extractor option for the standalone extractor has been removed.

## 0.7.3

### Minor Analysis Improvements
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
category: minorAnalysis
---
* The `--nostdlib` extractor option for the standalone extractor has been removed.
## 0.7.4

### Minor Analysis Improvements

* The `--nostdlib` extractor option for the standalone extractor has been removed.
3 changes: 3 additions & 0 deletions csharp/ql/lib/change-notes/released/0.7.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.7.5

No user-facing changes.
2 changes: 1 addition & 1 deletion csharp/ql/lib/codeql-pack.release.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.7.3
lastReleaseVersion: 0.7.5
Loading