@@ -22,29 +22,10 @@ import DoubleFree::PathGraph
2222 */
2323predicate isFree ( DataFlow:: Node n , Expr e ) { isFree ( _, n , e , _) }
2424
25- /**
26- * `dealloc1` is a deallocation expression and `e` is an expression such
27- * that is deallocated by a deallocation expression, and the `(dealloc1, e)` pair
28- * should be excluded by the `FlowFromFree` library.
29- *
30- * Note that `e` is not necessarily the expression deallocated by `dealloc1`. It will
31- * be bound to the second deallocation as identified by the `FlowFromFree` library.
32- */
33- bindingset [ dealloc1, e]
34- predicate isExcludeFreePair ( DeallocationExpr dealloc1 , Expr e ) {
35- exists ( DeallocationExpr dealloc2 | isFree ( _, _, e , dealloc2 ) |
36- dealloc1 .( FunctionCall ) .getTarget ( ) .hasGlobalName ( "MmFreePagesFromMdl" ) and
37- // From https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-mmfreepagesfrommdl:
38- // "After calling MmFreePagesFromMdl, the caller must also call ExFreePool
39- // to release the memory that was allocated for the MDL structure."
40- isExFreePoolCall ( dealloc2 , _)
41- )
42- }
43-
4425module DoubleFreeParam implements FlowFromFreeParamSig {
4526 predicate isSink = isFree / 2 ;
4627
47- predicate isExcluded = isExcludeFreePair / 2 ;
28+ predicate isExcluded = isExcludedMmFreePageFromMdl / 2 ;
4829
4930 predicate sourceSinkIsRelated = defaultSourceSinkIsRelated / 2 ;
5031}
0 commit comments