Skip to content

Commit 5b1b60c

Browse files
authored
Merge pull request github#16797 from MathiasVP/yml-for-allocation-and-deallocation
C++: Add extensible predicates to `Allocation` and `Deallocation`
2 parents 25d520a + 36d59ce commit 5b1b60c

16 files changed

+280
-165
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: feature
3+
---
4+
* It is now possible to extend the classes `AllocationFunction` and `DeallocationFunction` via data extensions. Extensions of these classes should be added to the `lib/ext/allocation` and `lib/ext/deallocation` directories respectively.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: allocationFunctionModel
5+
data:
6+
- ["", "", False, "kmem_alloc", "0", "", "", True]
7+
- ["", "", False, "kmem_zalloc", "0", "", "", True]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: allocationFunctionModel
5+
data:
6+
- ["", "", False, "g_malloc", "0", "", "", True]
7+
- ["", "", False, "g_try_malloc", "0", "", "", True]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: allocationFunctionModel
5+
data:
6+
- ["", "", False, "CRYPTO_malloc", "0", "", "", True]
7+
- ["", "", False, "CRYPTO_zalloc", "0", "", "", True]
8+
- ["", "", False, "CRYPTO_secure_malloc", "0", "", "", True]
9+
- ["", "", False, "CRYPTO_secure_zalloc", "0", "", "", True]
10+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: allocationFunctionModel
5+
data:
6+
- ["", "", False, "malloc", "0", "", "", True]
7+
- ["std", "", False, "malloc", "0", "", "", True]
8+
- ["bsl", "", False, "malloc", "0", "", "", True]
9+
- ["", "", False, "alloca", "0", "", "", False]
10+
- ["", "", False, "__builtin_alloca", "0", "", "", False]
11+
- ["", "", False, "_alloca", "0", "", "", False]
12+
- ["", "", False, "_malloca", "0", "", "", False]
13+
- ["", "", False, "calloc", "1", "0", "", True]
14+
- ["std", "", False, "calloc", "1", "0", "", True]
15+
- ["bsl", "", False, "calloc", "1", "0", "", True]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: allocationFunctionModel
5+
data:
6+
- ["", "", False, "MmAllocateContiguousMemory", "0", "", "", True]
7+
- ["", "", False, "MmAllocateContiguousNodeMemory", "0", "", "", True]
8+
- ["", "", False, "MmAllocateContiguousMemorySpecifyCache", "0", "", "", True]
9+
- ["", "", False, "MmAllocateContiguousMemorySpecifyCacheNode", "0", "", "", True]
10+
- ["", "", False, "MmAllocateNonCachedMemory", "0", "", "", True]
11+
- ["", "", False, "MmAllocateMappingAddress", "0", "", "", True]
12+
- ["", "", False, "CoTaskMemAlloc", "0", "", "", True]
13+
- ["", "", False, "ExAllocatePool", "1", "", "", True]
14+
- ["", "", False, "ExAllocatePool2", "1", "", "", True]
15+
- ["", "", False, "ExAllocatePool3", "1", "", "", True]
16+
- ["", "", False, "ExAllocatePoolWithTag", "1", "", "", True]
17+
- ["", "", False, "ExAllocatePoolWithTagPriority", "1", "", "", True]
18+
- ["", "", False, "ExAllocatePoolWithQuota", "1", "", "", True]
19+
- ["", "", False, "ExAllocatePoolWithQuotaTag", "1", "", "", True]
20+
- ["", "", False, "ExAllocatePoolZero", "1", "", "", True]
21+
- ["", "", False, "IoAllocateMdl", "1", "", "", True]
22+
- ["", "", False, "IoAllocateErrorLogEntry", "1", "", "", True]
23+
- ["", "", False, "LocalAlloc", "1", "", "", True]
24+
- ["", "", False, "GlobalAlloc", "1", "", "", True]
25+
- ["", "", False, "VirtualAlloc", "1", "", "", True]
26+
- ["", "", False, "HeapAlloc", "2", "", "", True]
27+
- ["", "", False, "MmAllocatePagesForMdl", "3", "", "", True]
28+
- ["", "", False, "MmAllocatePagesForMdlEx", "3", "", "", True]
29+
- ["", "", False, "MmAllocateNodePagesForMdlEx", "3", "", "", True]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: allocationFunctionModel
5+
data: []
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: deallocationFunctionModel
5+
data:
6+
- ["", "", False, "pool_put", "1"]
7+
- ["", "", False, "pool_cache_put", "1"]
8+
- ["", "", False, "kmem_free", "0"]
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: deallocationFunctionModel
5+
data:
6+
- ["", "", False, "free", "0"]
7+
- ["std", "", False, "free", "0"]
8+
- ["bsl", "", False, "free", "0"]
9+
- ["", "", False, "realloc", "0"]
10+
- ["std", "", False, "realloc", "0"]
11+
- ["bsl", "", False, "realloc", "0"]
12+
- ["", "", False, "CRYPTO_free", "0"]
13+
- ["", "", False, "CRYPTO_secure_free", "0"]
14+
- ["", "", False, "g_free", "0"]
15+
- ["", "", False, "ExFreePool", "0"]
16+
- ["", "", False, "ExFreePoolWithTag", "0"]
17+
- ["", "", False, "ExDeleteTimer", "0"]
18+
- ["", "", False, "IoFreeIrp", "0"]
19+
- ["", "", False, "IoFreeMdl", "0"]
20+
- ["", "", False, "IoFreeErrorLogEntry", "0"]
21+
- ["", "", False, "IoFreeWorkItem", "0"]
22+
- ["", "", False, "MmFreeContiguousMemory", "0"]
23+
- ["", "", False, "MmFreeContiguousMemorySpecifyCache", "0"]
24+
- ["", "", False, "MmFreeNonCachedMemory", "0"]
25+
- ["", "", False, "MmFreeMappingAddress", "0"]
26+
- ["", "", False, "MmFreePagesFromMdl", "0"]
27+
- ["", "", False, "MmUnmapReservedMapping", "0"]
28+
- ["", "", False, "MmUnmapLockedPages", "0"]
29+
- ["", "", False, "NdisFreeGenericObject", "0"]
30+
- ["", "", False, "NdisFreeMemory", "0"]
31+
- ["", "", False, "NdisFreeMemoryWithTag", "0"]
32+
- ["", "", False, "NdisFreeMdl", "0"]
33+
- ["", "", False, "NdisFreeNetBufferListPool", "0"]
34+
- ["", "", False, "NdisFreeNetBufferPool", "0"]
35+
- ["", "", False, "LocalFree", "0"]
36+
- ["", "", False, "GlobalFree", "0"]
37+
- ["", "", False, "LocalReAlloc", "0"]
38+
- ["", "", False, "GlobalReAlloc", "0"]
39+
- ["", "", False, "VirtualFree", "0"]
40+
- ["", "", False, "CoTaskMemFree", "0"]
41+
- ["", "", False, "CoTaskMemRealloc", "0"]
42+
- ["", "", False, "SysFreeString", "0"]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/cpp-all
4+
extensible: deallocationFunctionModel
5+
data:
6+
- ["", "", False, "ExFreePool", "0"]
7+
- ["", "", False, "ExFreePoolWithTag", "0"]
8+
- ["", "", False, "ExDeleteTimer", "0"]
9+
- ["", "", False, "IoFreeIrp", "0"]
10+
- ["", "", False, "IoFreeMdl", "0"]
11+
- ["", "", False, "IoFreeErrorLogEntry", "0"]
12+
- ["", "", False, "IoFreeWorkItem", "0"]
13+
- ["", "", False, "MmFreeContiguousMemory", "0"]
14+
- ["", "", False, "MmFreeContiguousMemorySpecifyCache", "0"]
15+
- ["", "", False, "MmFreeNonCachedMemory", "0"]
16+
- ["", "", False, "MmFreeMappingAddress", "0"]
17+
- ["", "", False, "MmFreePagesFromMdl", "0"]
18+
- ["", "", False, "MmUnmapReservedMapping", "0"]
19+
- ["", "", False, "MmUnmapLockedPages", "0"]
20+
- ["", "", False, "NdisFreeGenericObject", "0"]
21+
- ["", "", False, "NdisFreeMemory", "0"]
22+
- ["", "", False, "NdisFreeMemoryWithTag", "0"]
23+
- ["", "", False, "NdisFreeMdl", "0"]
24+
- ["", "", False, "NdisFreeNetBufferListPool", "0"]
25+
- ["", "", False, "NdisFreeNetBufferPool", "0"]
26+
- ["", "", False, "LocalFree", "0"]
27+
- ["", "", False, "GlobalFree", "0"]
28+
- ["", "", False, "LocalReAlloc", "0"]
29+
- ["", "", False, "GlobalReAlloc", "0"]
30+
- ["", "", False, "VirtualFree", "0"]
31+
- ["", "", False, "CoTaskMemFree", "0"]
32+
- ["", "", False, "CoTaskMemRealloc", "0"]
33+
- ["", "", False, "SysFreeString", "0"]
34+
- ["", "", False, "ExFreeToLookasideListEx", "1"]
35+
- ["", "", False, "ExFreeToPagedLookasideList", "1"]
36+
- ["", "", False, "ExFreeToNPagedLookasideList", "1"]
37+
- ["", "", False, "NdisFreeMemoryWithTagPriority", "1"]
38+
- ["", "", False, "StorPortFreeMdl", "1"]
39+
- ["", "", False, "StorPortFreePool", "1"]
40+
- ["", "", False, "HeapFree", "2"]
41+
- ["", "", False, "HeapReAlloc", "2"]

0 commit comments

Comments
 (0)