-
Notifications
You must be signed in to change notification settings - Fork 283
Expand file tree
/
Copy pathex2.ql
More file actions
27 lines (25 loc) · 729 Bytes
/
ex2.ql
File metadata and controls
27 lines (25 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import cpp
import semmle.code.cpp.dataflow.DataFlow
class KMalloc extends Function {
KMalloc() {
getName() = "kmalloc" or
getName() = "acpi_os_allocate_zeroed" or
getName() = "kzalloc" or
getName() = "kcalloc" or
getName() = "kmalloc_array" or
getName() = "acpi_os_allocate" or
getName() = "mempool_kmalloc" or
getName() = "alloc_resource" or
getName() = "bitmap_alloc" or
getName() = "sg_kmalloc" or
getName() = "pcpu_mem_zalloc" or
getName() = "bitmap_zalloc"
}
}
from KMalloc fun, FunctionCall source
where
source = fun.getACallToThisFunction() and
not exists(IfStmt sink |
DataFlow::localExprFlow(source, sink.getControllingExpr().getAChild*())
)
select source