Skip to content

Commit 8211ba9

Browse files
committed
Merge branch 'main' into modernsec3
2 parents 54a4b89 + 2923993 commit 8211ba9

File tree

507 files changed

+5021
-3096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

507 files changed

+5021
-3096
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extensions": [
3-
"rust-lang.rust",
3+
"rust-lang.rust-analyzer",
44
"bungcip.better-toml",
55
"github.vscode-codeql",
66
"hbenl.vscode-test-explorer",
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Test tree-sitter-extractor
2+
3+
on:
4+
push:
5+
paths:
6+
- "shared/tree-sitter-extractor/**"
7+
- .github/workflows/tree-sitter-extractor-test.yml
8+
branches:
9+
- main
10+
- "rc/*"
11+
pull_request:
12+
paths:
13+
- "shared/tree-sitter-extractor/**"
14+
- .github/workflows/tree-sitter-extractor-test.yml
15+
branches:
16+
- main
17+
- "rc/*"
18+
19+
env:
20+
CARGO_TERM_COLOR: always
21+
22+
defaults:
23+
run:
24+
working-directory: shared/tree-sitter-extractor
25+
26+
jobs:
27+
test:
28+
steps:
29+
- uses: actions/checkout@v3
30+
- name: Check formatting
31+
run: cargo fmt --all -- --check
32+
- name: Run tests
33+
run: cargo test --verbose
34+
- name: Run clippy
35+
fmt:
36+
steps:
37+
- uses: actions/checkout@v3
38+
- name: Check formatting
39+
run: cargo fmt --check
40+
clippy:
41+
steps:
42+
- uses: actions/checkout@v3
43+
- name: Run clippy
44+
run: cargo clippy -- --no-deps -D warnings

cpp/ql/lib/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.7.1
2+
3+
No user-facing changes.
4+
15
## 0.7.0
26

37
### Breaking Changes
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: feature
3+
---
4+
* A new predicate `BarrierGuard::getAnIndirectBarrierNode` has been added to the new dataflow library (`semmle.code.cpp.dataflow.new.DataFlow`) to mark indirect expressions as barrier nodes using the `BarrierGuard` API.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The new dataflow (`semmle.code.cpp.dataflow.new.DataFlow`) and taint-tracking libraries (`semmle.code.cpp.dataflow.new.TaintTracking`) now support tracking flow through static local variables.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: majorAnalysis
3+
---
4+
* In the intermediate representation, handling of control flow after non-returning calls has been improved. This should remove false positives in queries that use the intermedite representation or libraries based on it, including the new data flow library.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.7.1
2+
3+
No user-facing changes.

cpp/ql/lib/codeql-pack.release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
lastReleaseVersion: 0.7.0
2+
lastReleaseVersion: 0.7.1

cpp/ql/lib/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cpp-all
2-
version: 0.7.1-dev
2+
version: 0.7.2-dev
33
groups: cpp
44
dbscheme: semmlecode.cpp.dbscheme
55
extractor: cpp

cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -961,8 +961,16 @@ predicate recordDataFlowCallSite(DataFlowCall call, DataFlowCallable callable) {
961961
/**
962962
* A `Node` at which a cast can occur such that the type should be checked.
963963
*/
964-
class CastingNode extends Node {
964+
class CastingNode instanceof Node {
965965
CastingNode() { castingNode(this) }
966+
967+
string toString() { result = super.toString() }
968+
969+
predicate hasLocationInfo(
970+
string filepath, int startline, int startcolumn, int endline, int endcolumn
971+
) {
972+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
973+
}
966974
}
967975

968976
private predicate readStepWithTypes(
@@ -1110,9 +1118,17 @@ LocalCallContext getLocalCallContext(CallContext ctx, DataFlowCallable callable)
11101118
* The value of a parameter at function entry, viewed as a node in a data
11111119
* flow graph.
11121120
*/
1113-
class ParamNode extends Node {
1121+
class ParamNode instanceof Node {
11141122
ParamNode() { parameterNode(this, _, _) }
11151123

1124+
string toString() { result = super.toString() }
1125+
1126+
predicate hasLocationInfo(
1127+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1128+
) {
1129+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1130+
}
1131+
11161132
/**
11171133
* Holds if this node is the parameter of callable `c` at the specified
11181134
* position.
@@ -1121,9 +1137,17 @@ class ParamNode extends Node {
11211137
}
11221138

11231139
/** A data-flow node that represents a call argument. */
1124-
class ArgNode extends Node {
1140+
class ArgNode instanceof Node {
11251141
ArgNode() { argumentNode(this, _, _) }
11261142

1143+
string toString() { result = super.toString() }
1144+
1145+
predicate hasLocationInfo(
1146+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1147+
) {
1148+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1149+
}
1150+
11271151
/** Holds if this argument occurs at the given position in the given call. */
11281152
final predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {
11291153
argumentNode(this, call, pos)
@@ -1134,9 +1158,17 @@ class ArgNode extends Node {
11341158
* A node from which flow can return to the caller. This is either a regular
11351159
* `ReturnNode` or a `PostUpdateNode` corresponding to the value of a parameter.
11361160
*/
1137-
class ReturnNodeExt extends Node {
1161+
class ReturnNodeExt instanceof Node {
11381162
ReturnNodeExt() { returnNodeExt(this, _) }
11391163

1164+
string toString() { result = super.toString() }
1165+
1166+
predicate hasLocationInfo(
1167+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1168+
) {
1169+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1170+
}
1171+
11401172
/** Gets the kind of this returned value. */
11411173
ReturnKindExt getKind() { returnNodeExt(this, result) }
11421174
}
@@ -1145,8 +1177,16 @@ class ReturnNodeExt extends Node {
11451177
* A node to which data can flow from a call. Either an ordinary out node
11461178
* or a post-update node associated with a call argument.
11471179
*/
1148-
class OutNodeExt extends Node {
1180+
class OutNodeExt instanceof Node {
11491181
OutNodeExt() { outNodeExt(this) }
1182+
1183+
string toString() { result = super.toString() }
1184+
1185+
predicate hasLocationInfo(
1186+
string filepath, int startline, int startcolumn, int endline, int endcolumn
1187+
) {
1188+
super.hasLocationInfo(filepath, startline, startcolumn, endline, endcolumn)
1189+
}
11501190
}
11511191

11521192
/**

0 commit comments

Comments
 (0)