Class ContextSensitivePathBuilder

All Implemented Interfaces:
IAbstractionPathBuilder, IMemoryBoundedSolver
Direct Known Subclasses:
DefaultPathBuilderFactory.RepeatableContextSensitivePathBuilder

public class ContextSensitivePathBuilder extends ConcurrentAbstractionPathBuilder
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
  • Field Details

  • Constructor Details

    • ContextSensitivePathBuilder

      public ContextSensitivePathBuilder(InfoflowManager manager)
      Creates a new instance of the ContextSensitivePathBuilder class
      Parameters:
      manager - The data flow manager that gives access to the icfg and other objects
  • Method Details

    • checkForSource

      protected boolean checkForSource(Abstraction abs, SourceContextAndPath scap)
      Checks whether the given abstraction is a source. If so, a result entry is created.
      Parameters:
      abs - The abstraction to check
      scap - 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: IAbstractionPathBuilder
      Incrementally 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

      public void computeTaintPaths(Set<AbstractionAtSink> res)
      Description copied from interface: IAbstractionPathBuilder
      Computes the path of tainted data between the source and the sink
      Specified by:
      computeTaintPaths in interface IAbstractionPathBuilder
      Overrides:
      computeTaintPaths in class ConcurrentAbstractionPathBuilder
      Parameters:
      res - The data flow tracker results
    • reset

      public void reset()
      Description copied from interface: IMemoryBoundedSolver
      Resets 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:
      reset in interface IMemoryBoundedSolver
      Overrides:
      reset in class ConcurrentAbstractionPathBuilder
    • 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

      protected Runnable getTaintPathTask(AbstractionAtSink abs)
      Description copied from class: ConcurrentAbstractionPathBuilder
      Gets 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:
      getTaintPathTask in class ConcurrentAbstractionPathBuilder
      Parameters:
      abs - The abstraction for which to compute the result paths
    • createSourceFindingTask

      protected Runnable createSourceFindingTask(Abstraction abstraction)
    • getResults

      public InfoflowResults getResults()
      Description copied from interface: IAbstractionPathBuilder
      Gets the constructed result paths
      Specified by:
      getResults in interface IAbstractionPathBuilder
      Overrides:
      getResults in class ConcurrentAbstractionPathBuilder
      Returns:
      The constructed result paths
    • triggerComputationForNeighbors

      protected boolean triggerComputationForNeighbors()
      Description copied from class: ConcurrentAbstractionPathBuilder
      Specifies whether the class shall create separate path reconstruction tasks for the neighbors of the abstractions that arrive at the sink
      Specified by:
      triggerComputationForNeighbors in class ConcurrentAbstractionPathBuilder
      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