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

C++: Model Microsoft's "Active Template Library" #18136

Merged
merged 65 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
fe9feb9
C++: We will need all these types.
MathiasVP Nov 26, 2024
16e5fa3
C++: Add failing tests with U_STRINGorID.
MathiasVP Nov 26, 2024
bf36f00
C++: Add model. Observe that flow still fails.
MathiasVP Nov 26, 2024
f688470
C++: Since isConstructedFrom only holds for templates we need to expl…
MathiasVP Nov 26, 2024
749602c
C++: Add failing tests with CA2AEX and friends.
MathiasVP Nov 26, 2024
763b991
C++: Add models.
MathiasVP Nov 26, 2024
2c7d0de
C++: Accept test changes.
MathiasVP Nov 26, 2024
c00f84d
C++: Work around the 'wrong' function name for conversion operators.
MathiasVP Nov 26, 2024
4f2cd81
C++: Accept test changes.
MathiasVP Nov 26, 2024
1cd426e
C++: Add failing tests with 'CAtlArray'.
MathiasVP Nov 27, 2024
0f8df1c
C++: Add MaD model for 'CAtlArray'.
MathiasVP Nov 27, 2024
c604a93
C++: Add failing tests with 'CAtlList'.
MathiasVP Nov 27, 2024
2b8ef5a
C++: Add MaD model for 'CAtlList'.
MathiasVP Nov 27, 2024
68ee8da
C++: Add failing tests with 'CComBSTR'.
MathiasVP Nov 27, 2024
9b00484
C++: Add MaD model for 'CComBSTR'.
MathiasVP Nov 27, 2024
948be09
C++: Add an taint step from object to field for 'CComBSTR's.
MathiasVP Nov 27, 2024
e831cb5
C++: Add failing tests with 'CComSafeArray'.
MathiasVP Nov 27, 2024
5f05417
C++: Add MaD model for 'CComSafeArray'.
MathiasVP Nov 27, 2024
1a79290
C++: Add failing tests with 'CPathT'.
MathiasVP Nov 27, 2024
3543619
C++: Add MaD model for 'CPathT'.
MathiasVP Nov 27, 2024
c61395b
C++: Add implicit read of the 'm_strPath' member.
MathiasVP Nov 27, 2024
029c013
C++: Add failing tests with 'CSimpleArray'.
MathiasVP Nov 27, 2024
02b88d5
C++: Add MaD model for 'CSimpleArray'.
MathiasVP Nov 27, 2024
12674ea
C++: Add failing tests with 'CSimpleMap'.
MathiasVP Nov 27, 2024
74b6c9d
C++: Add MaD model for 'CSimpleMap'.
MathiasVP Nov 27, 2024
1ea879a
C++: Add failing tests for 'CUrl'.
MathiasVP Nov 27, 2024
300e3ea
C++: Add MaD model for 'CUrl'.
MathiasVP Nov 27, 2024
e73fccd
C++: Add more types that we'll need for later.
MathiasVP Nov 27, 2024
dee47f2
C++: Add a failing test with 'CAtlFile'.
MathiasVP Nov 27, 2024
74eae4a
C++: Add a MaD model for 'CAtlFile' and mark reads as local flow sour…
MathiasVP Nov 27, 2024
ac0599c
C++: Add a failing test with 'CAtlFileMapping'.
MathiasVP Nov 27, 2024
3709151
C++: Add a MaD model for 'CAtlFileMappingBase' and mark reads as loca…
MathiasVP Nov 27, 2024
67ba85a
C++: Add failing tests for 'CAtlTemporaryFile'.
MathiasVP Nov 27, 2024
33212da
C++: Add a MaD model for 'CAtlTemporaryFile' and mark reads as local …
MathiasVP Nov 27, 2024
5aada39
C++: Add failing tests for 'CRegKey'.
MathiasVP Nov 27, 2024
d69de0c
C++: Add a MaD model for 'CRegKey' and mark query calls as local flow…
MathiasVP Nov 27, 2024
19e7c37
C++: Update the final test changes. Nothing exciting here.
MathiasVP Nov 27, 2024
0242874
C++: Add change note.
MathiasVP Nov 27, 2024
3c0af49
C++: Fix bug introduced in an earlier commit and accept test changes.…
MathiasVP Nov 27, 2024
2c58279
C++: Add QLDoc to 'isClassConstructedFrom' and 'isFunctionConstructed…
MathiasVP Dec 3, 2024
0c8245f
Update cpp/ql/test/library-tests/dataflow/taint-tests/atl.cpp
MathiasVP Dec 3, 2024
593e223
C++: Update test changes after 0c8245f727e8fc7fac2b5731dcbc5e4d7bd86fdc.
MathiasVP Dec 3, 2024
3abb904
C++: Fix testcase to reveal problematic models.
MathiasVP Dec 3, 2024
c3086d4
C++: Fix models and accept test changes.
MathiasVP Dec 3, 2024
8d035e6
C++: Fix test.
MathiasVP Dec 4, 2024
de75e03
C++: Remove taint to POSITIONs.
MathiasVP Dec 4, 2024
9dc3aec
C++: Remove more taint to POSITIONs.
MathiasVP Dec 4, 2024
c7dee4b
C++: Remove more taint to POSITIONs.
MathiasVP Dec 4, 2024
279a30c
C++: Make 'SetAt' a value-preserving step.
MathiasVP Dec 4, 2024
4f00e22
C++: Accept more test changes.
MathiasVP Dec 4, 2024
d0bf3b8
C++: Add missing MaD row for move constructor.
MathiasVP Dec 6, 2024
904db38
C++: Add missing space between type name and '&'.
MathiasVP Dec 6, 2024
f7b55e0
C++: 'Attach' is value-preserving.
MathiasVP Dec 6, 2024
6388a9a
C++: Delete duplicated MaD row.
MathiasVP Dec 6, 2024
66de42c
C++: Fix MaD row for 'operator&' on 'CComBSTR's.
MathiasVP Dec 6, 2024
3d0a205
C++: Fix 'BSTRToArray' stub and MaD model.
MathiasVP Dec 6, 2024
59f4b3c
C++: Get rid of the model for 'Create'.
MathiasVP Dec 6, 2024
d735a14
C++: Also flow to the return value of 'operator='.
MathiasVP Dec 9, 2024
d3dc318
C++: Make 'GetValueAt' a value-preserving step.
MathiasVP Dec 9, 2024
db86f6a
C++: Fix annotation.
MathiasVP Dec 9, 2024
674dbce
C++: Add taint flow through 'CRegKey::Create'.
MathiasVP Dec 9, 2024
7f87a25
C++: Fix 'QueryMultiStringValue' model.
MathiasVP Dec 9, 2024
184dfc2
C++: Fix 'QueryStringValue' model.
MathiasVP Dec 9, 2024
5f33733
C++: Fix 'QueryValue' model.
MathiasVP Dec 9, 2024
8bdd10c
C++: Fix spurious columns in 'CRegKey'.
MathiasVP Dec 9, 2024
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
22 changes: 22 additions & 0 deletions cpp/ql/lib/ext/CPathT.model.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: summaryModel
data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance
- ["", "CPathT", True, "CPathT", "", "", "Argument[*1]", "Argument[-1]", "value", "manual"]
geoffw0 marked this conversation as resolved.
Show resolved Hide resolved
- ["", "CPathT", True, "AddExtension", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
- ["", "CPathT", True, "Append", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
- ["", "CPathT", True, "Combine", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
- ["", "CPathT", True, "Combine", "", "", "Argument[*1]", "Argument[-1]", "taint", "manual"]
- ["", "CPathT", True, "CommonPrefix", "", "", "Argument[*0]", "ReturnValue", "taint", "manual"]
- ["", "CPathT", True, "CommonPrefix", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
geoffw0 marked this conversation as resolved.
Show resolved Hide resolved
- ["", "CPathT", True, "GetExtension", "", "", "Argument[-1]", "ReturnValue[*]", "taint", "manual"]
- ["", "CPathT", True, "RelativePathTo", "", "", "Argument[*0]", "ReturnValue[-1]", "taint", "manual"]
- ["", "CPathT", True, "RelativePathTo", "", "", "Argument[*2]", "ReturnValue[-1]", "taint", "manual"]
- ["", "CPathT", True, "RenameExtension", "", "", "Argument[*0]", "ReturnValue[-1]", "taint", "manual"]
# Note: These don't work currently since we cannot use the template parameter in the name of the function
# - ["", "CPathT<T>", True, "operator const T&", "", "", "Argument[-1]", "ReturnValue[*]", "value", "manual"]
# - ["", "CPathT<T>", True, "operator T&", "", "", "Argument[-1]", "ReturnValue[*]", "value", "manual"]
- ["", "CPathT", True, "operator PCXSTR", "", "", "Argument[-1]", "ReturnValue[*]", "value", "manual"]
- ["", "CPathT", True, "operator +=", "", "", "Argument[-1]", "ReturnValue[*]", "value", "manual"]
- ["", "CPathT", True, "operator +=", "", "", "Argument[*0]", "ReturnValue[*]", "value", "manual"]
2 changes: 1 addition & 1 deletion cpp/ql/test/library-tests/dataflow/taint-tests/atl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,6 @@ void test_CPathT() {
CPath p;
auto p2 = p.CommonPrefix(x);
sink(p2.m_strPath); // $ MISSING: ir
sink(p2.GetExtension()); // $ MISSING: ir
sink(p2.GetExtension()); // $ ir
}
}