Skip to content

Commit 849c5ff

Browse files
authored
Merge branch 'main' into actions/fix/code-injection-privileged-context
2 parents 3a92d58 + 2665d83 commit 849c5ff

File tree

190 files changed

+3623
-1659
lines changed

Some content is hidden

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

190 files changed

+3623
-1659
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.1.1
1+
8.4.2

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bazel_dep(name = "rules_shell", version = "0.5.0")
2323
bazel_dep(name = "bazel_skylib", version = "1.8.1")
2424
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "absl")
2525
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
26-
bazel_dep(name = "fmt", version = "10.0.0")
26+
bazel_dep(name = "fmt", version = "12.1.0-codeql.1")
2727
bazel_dep(name = "rules_kotlin", version = "2.1.3-codeql.1")
2828
bazel_dep(name = "gazelle", version = "0.40.0")
2929
bazel_dep(name = "rules_dotnet", version = "0.19.2-codeql.1")

config/identical-files.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,5 +276,12 @@
276276
"Python model summaries test extension": [
277277
"python/ql/test/library-tests/dataflow/model-summaries/InlineTaintTest.ext.yml",
278278
"python/ql/test/library-tests/dataflow/model-summaries/NormalDataflowTest.ext.yml"
279+
],
280+
"XML discard predicates": [
281+
"javascript/ql/lib/semmle/javascript/internal/OverlayXml.qll",
282+
"java/ql/lib/semmle/code/java/internal/OverlayXml.qll",
283+
"go/ql/lib/semmle/go/internal/OverlayXml.qll",
284+
"python/ql/lib/semmle/python/internal/OverlayXml.qll",
285+
"csharp/ql/lib/semmle/code/csharp/internal/OverlayXml.qll"
279286
]
280287
}

cpp/ql/lib/cpp.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,4 @@ import semmle.code.cpp.Preprocessor
7474
import semmle.code.cpp.Iteration
7575
import semmle.code.cpp.NameQualifiers
7676
import DefaultOptions
77+
private import semmle.code.cpp.internal.Overlay
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/**
2+
* Defines entity discard predicates for C++ overlay analysis.
3+
*/
4+
5+
/**
6+
* Holds always for the overlay variant and never for the base variant.
7+
* This local predicate is used to define local predicates that behave
8+
* differently for the base and overlay variant.
9+
*/
10+
overlay[local]
11+
predicate isOverlay() { databaseMetadata("isOverlay", "true") }
12+
13+
overlay[local]
14+
private string getLocationFilePath(@location_default loc) {
15+
exists(@file file | locations_default(loc, file, _, _, _, _) | files(file, result))
16+
}
17+
18+
/**
19+
* Gets the file path for an element with a single location.
20+
*/
21+
overlay[local]
22+
private string getSingleLocationFilePath(@element e) {
23+
// @var_decl has a direct location in the var_decls relation
24+
exists(@location_default loc | var_decls(e, _, _, _, loc) | result = getLocationFilePath(loc))
25+
//TODO: add other kinds of elements with single locations
26+
}
27+
28+
/**
29+
* Gets the file path for an element with potentially multiple locations.
30+
*/
31+
overlay[local]
32+
private string getMultiLocationFilePath(@element e) {
33+
// @variable gets its location(s) from its @var_decl(s)
34+
exists(@var_decl vd, @location_default loc | var_decls(vd, e, _, _, loc) |
35+
result = getLocationFilePath(loc)
36+
)
37+
//TODO: add other kinds of elements with multiple locations
38+
}
39+
40+
/**
41+
* A local helper predicate that holds in the base variant and never in the
42+
* overlay variant.
43+
*/
44+
overlay[local]
45+
private predicate holdsInBase() { not isOverlay() }
46+
47+
/**
48+
* Discards an element from the base variant if:
49+
* - It has a single location in a changed file, or
50+
* - All of its locations are in changed files.
51+
*/
52+
overlay[discard_entity]
53+
private predicate discardElement(@element e) {
54+
holdsInBase() and
55+
(
56+
overlayChangedFiles(getSingleLocationFilePath(e))
57+
or
58+
forex(string path | path = getMultiLocationFilePath(e) | overlayChangedFiles(path))
59+
)
60+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.304"
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.304"
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "8.0.401"
4+
}
5+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import pytest
2+
3+
@pytest.mark.skip(reason=".NET 10 info command crashes")
14
def test1(codeql, csharp):
25
codeql.database.create()
36

7+
@pytest.mark.skip(reason=".NET 10 info command crashes")
48
def test2(codeql, csharp):
59
codeql.database.create(build_mode="none")
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "9.0.304"
4+
}
5+
}

0 commit comments

Comments
 (0)