Skip to content

Commit 65e471f

Browse files
committed
XNU NFS: Use TaintTracking library
This library wasn't available on LGTM when the query was written, but it's there now.
1 parent b433ee2 commit 65e471f

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

ql_demos/cpp/XNU_NFS_Boot_CVE-2018-4136_CVE-2018-4160/BCopyNegativeSize.ql

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
*/
99

1010
import cpp
11-
import semmle.code.cpp.dataflow.DataFlow
11+
import semmle.code.cpp.dataflow.TaintTracking
1212
import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis
1313
import DataFlow::PathGraph
1414

15-
class MyCfg extends DataFlow::Configuration {
15+
class MyCfg extends TaintTracking::Configuration {
1616
MyCfg() {
1717
this = "MyCfg"
1818
}
@@ -27,12 +27,8 @@ class MyCfg extends DataFlow::Configuration {
2727
override predicate isSource(DataFlow::Node source) {
2828
source.asExpr().(FunctionCall).getTarget().getName() = "mbuf_data"
2929
}
30-
31-
override predicate isAdditionalFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
32-
node2.asExpr() = node1.asExpr().getParent()
33-
}
3430
}
3531

36-
from DataFlow::PathNode sink, DataFlow::PathNode source, MyCfg dataFlow
37-
where dataFlow.hasFlowPath(source, sink)
32+
from DataFlow::PathNode sink, DataFlow::PathNode source, MyCfg cfg
33+
where cfg.hasFlowPath(source, sink)
3834
select sink, source, sink, "The size argument of bcopy might be negative."

0 commit comments

Comments
 (0)