Class ContextSensitivePathBuilder
java.lang.Object
soot.jimple.infoflow.data.pathBuilders.AbstractAbstractionPathBuilder
soot.jimple.infoflow.data.pathBuilders.ConcurrentAbstractionPathBuilder
soot.jimple.infoflow.data.pathBuilders.ContextSensitivePathBuilder
- All Implemented Interfaces:
IAbstractionPathBuilder,IMemoryBoundedSolver
- Direct Known Subclasses:
DefaultPathBuilderFactory.RepeatableContextSensitivePathBuilder
Class for reconstructing abstraction paths from sinks to source. This builder
is context-sensitive which makes it more precise than the
ContextInsensitivePathBuilder, but also a bit slower.- Author:
- Steven Arzt
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumprotected classTask for tracking back the path from sink to source.Nested classes/interfaces inherited from interface soot.jimple.infoflow.data.pathBuilders.IAbstractionPathBuilder
IAbstractionPathBuilder.OnPathBuilderResultAvailableNested classes/interfaces inherited from interface soot.jimple.infoflow.memory.IMemoryBoundedSolver
IMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConcurrentHashSet<SourceContextAndPath>protected ConcurrentHashSet<SourceContextAndPath>Fields inherited from class soot.jimple.infoflow.data.pathBuilders.ConcurrentAbstractionPathBuilder
executor, resultsFields inherited from class soot.jimple.infoflow.data.pathBuilders.AbstractAbstractionPathBuilder
config, logger, manager, resultAvailableHandlers -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidTries to fill up deferred paths toward a source.protected booleancheckForSource(Abstraction abs, SourceContextAndPath scap) Checks whether the given abstraction is a source.protected voidMethod that is called to shut down the executorvoidComputes the path of tainted data between the source and the sinkprotected RunnablecreateSourceFindingTask(Abstraction abstraction) Gets the constructed result pathsprotected RunnableGets the task that computes the result paths for a single abstraction.protected voidMethod that is called when the taint paths have been computedvoidreset()Resets the solver to its initial state after it has been forcefully terminated.voidIncrementally runs the path builder after some paths have already been computed.voidshutdown()Terminates the internal executor and cleans up all resources that were usedprotected booleanSpecifies whether the class shall create separate path reconstruction tasks for the neighbors of the abstractions that arrive at the sinkMethods inherited from class soot.jimple.infoflow.data.pathBuilders.ConcurrentAbstractionPathBuilder
addStatusListener, forceTerminate, getTerminationReason, isKilled, isTerminated, scheduleDependentTaskMethods inherited from class soot.jimple.infoflow.data.pathBuilders.AbstractAbstractionPathBuilder
addResultAvailableHandler
-
Field Details
-
pathCache
-
deferredPaths
-
sourceReachingScaps
-
-
Constructor Details
-
ContextSensitivePathBuilder
Creates a new instance of theContextSensitivePathBuilderclass- Parameters:
manager- The data flow manager that gives access to the icfg and other objects
-
-
Method Details
-
checkForSource
Checks whether the given abstraction is a source. If so, a result entry is created.- Parameters:
abs- The abstraction to checkscap- The path leading up to the current abstraction- Returns:
- True if the current abstraction is a source, otherwise false
-
runIncrementalPathComputation
public void runIncrementalPathComputation()Description copied from interface:IAbstractionPathBuilderIncrementally runs the path builder after some paths have already been computed. This method is usually called after the taint propagation has finished when incremental path building has been used in between. -
computeTaintPaths
Description copied from interface:IAbstractionPathBuilderComputes the path of tainted data between the source and the sink- Specified by:
computeTaintPathsin interfaceIAbstractionPathBuilder- Overrides:
computeTaintPathsin classConcurrentAbstractionPathBuilder- Parameters:
res- The data flow tracker results
-
reset
public void reset()Description copied from interface:IMemoryBoundedSolverResets the solver to its initial state after it has been forcefully terminated. After calling this method, the solver is expected to accept new tasks.- Specified by:
resetin interfaceIMemoryBoundedSolver- Overrides:
resetin classConcurrentAbstractionPathBuilder
-
buildPathsFromCache
protected void buildPathsFromCache()Tries to fill up deferred paths toward a source. -
onTaintPathsComputed
protected void onTaintPathsComputed()Method that is called when the taint paths have been computed -
cleanupExecutor
protected void cleanupExecutor()Method that is called to shut down the executor -
shutdown
public void shutdown()Terminates the internal executor and cleans up all resources that were used -
getTaintPathTask
Description copied from class:ConcurrentAbstractionPathBuilderGets the task that computes the result paths for a single abstraction. If the concrete path building algorithm does not want to handle the given abstraction, it can return null to not execute anything.- Specified by:
getTaintPathTaskin classConcurrentAbstractionPathBuilder- Parameters:
abs- The abstraction for which to compute the result paths
-
createSourceFindingTask
-
getResults
Description copied from interface:IAbstractionPathBuilderGets the constructed result paths- Specified by:
getResultsin interfaceIAbstractionPathBuilder- Overrides:
getResultsin classConcurrentAbstractionPathBuilder- Returns:
- The constructed result paths
-
triggerComputationForNeighbors
protected boolean triggerComputationForNeighbors()Description copied from class:ConcurrentAbstractionPathBuilderSpecifies whether the class shall create separate path reconstruction tasks for the neighbors of the abstractions that arrive at the sink- Specified by:
triggerComputationForNeighborsin classConcurrentAbstractionPathBuilder- Returns:
- True if separate path reconstruction tasks shall be started for each neighbor of each abstraction that reaches a sink, false if only the abstraction itself shall trigger a path reconstruction task
-