Class AbstractInfoflowProblem

java.lang.Object
heros.template.DefaultIFDSTabulationProblem<soot.Unit,D,soot.SootMethod,I>
soot.jimple.toolkits.ide.DefaultJimpleIFDSTabulationProblem<Abstraction,IInfoflowCFG>
soot.jimple.infoflow.problems.AbstractInfoflowProblem
All Implemented Interfaces:
heros.IFDSTabulationProblem<soot.Unit,Abstraction,soot.SootMethod,IInfoflowCFG>, heros.SolverConfiguration
Direct Known Subclasses:
AliasProblem, BackwardsAliasProblem, BackwardsInfoflowProblem, InfoflowProblem

public abstract class AbstractInfoflowProblem extends soot.jimple.toolkits.ide.DefaultJimpleIFDSTabulationProblem<Abstraction,IInfoflowCFG>
abstract super class which - concentrates functionality used by InfoflowProblem and AliasProblem - contains helper functions which should not pollute the naturally large InfofflowProblems
  • Field Details

  • Constructor Details

  • Method Details

    • setSolver

      public void setSolver(IInfoflowSolver solver)
    • setZeroValue

      public void setZeroValue(Abstraction zeroValue)
    • followReturnsPastSeeds

      public boolean followReturnsPastSeeds()
      we need this option as we start directly at the sources, but need to go backward in the call stack
      Specified by:
      followReturnsPastSeeds in interface heros.SolverConfiguration
      Overrides:
      followReturnsPastSeeds in class heros.template.DefaultIFDSTabulationProblem<soot.Unit,Abstraction,soot.SootMethod,IInfoflowCFG>
    • setTaintWrapper

      public void setTaintWrapper(ITaintPropagationWrapper wrapper)
      Sets the taint wrapper that shall be used for applying external library models
      Parameters:
      wrapper - The taint wrapper that shall be used for applying external library models
    • setNativeCallHandler

      public void setNativeCallHandler(INativeCallHandler handler)
      Sets the handler class to be used for modeling the effects of native methods on the taint state
      Parameters:
      handler - The native call handler to use
    • isInitialMethod

      protected boolean isInitialMethod(soot.SootMethod sm)
      Gets whether the given method is an entry point, i.e. one of the initial seeds belongs to the given method
      Parameters:
      sm - The method to check
      Returns:
      True if the given method is an entry point, otherwise false
    • initialSeeds

      public Map<soot.Unit,Set<Abstraction>> initialSeeds()
    • autoAddZero

      public boolean autoAddZero()
      Specified by:
      autoAddZero in interface heros.SolverConfiguration
      Overrides:
      autoAddZero in class heros.template.DefaultIFDSTabulationProblem<soot.Unit,Abstraction,soot.SootMethod,IInfoflowCFG>
    • isCallSiteActivatingTaint

      public boolean isCallSiteActivatingTaint(soot.Unit callSite, soot.Unit activationUnit)
    • registerActivationCallSite

      protected boolean registerActivationCallSite(soot.Unit callSite, soot.SootMethod callee, Abstraction activationAbs)
    • setActivationUnitsToCallSites

      public void setActivationUnitsToCallSites(AbstractInfoflowProblem other)
    • interproceduralCFG

      public IInfoflowCFG interproceduralCFG()
      Specified by:
      interproceduralCFG in interface heros.IFDSTabulationProblem<soot.Unit,Abstraction,soot.SootMethod,IInfoflowCFG>
      Overrides:
      interproceduralCFG in class heros.template.DefaultIFDSTabulationProblem<soot.Unit,Abstraction,soot.SootMethod,IInfoflowCFG>
    • addInitialSeeds

      public void addInitialSeeds(soot.Unit unit, Set<Abstraction> seeds)
      Adds the given initial seeds to the information flow problem
      Parameters:
      unit - The unit to be considered as a seed
      seeds - The abstractions with which to start at the given seed
    • hasInitialSeeds

      public boolean hasInitialSeeds()
      Gets whether this information flow problem has initial seeds
      Returns:
      True if this information flow problem has initial seeds, otherwise false
    • getInitialSeeds

      public Map<soot.Unit,Set<Abstraction>> getInitialSeeds()
      Gets the initial seeds with which this information flow problem has been configured
      Returns:
      The initial seeds with which this information flow problem has been configured.
    • setTaintPropagationHandler

      public void setTaintPropagationHandler(TaintPropagationHandler handler)
      Sets a handler which is invoked whenever a taint is propagated
      Parameters:
      handler - The handler to be invoked when propagating taints
    • getTaintPropagationHandler

      public TaintPropagationHandler getTaintPropagationHandler()
      Gets the taint propagation handler
      Returns:
      taint propagation handler
    • createZeroValue

      public Abstraction createZeroValue()
      Specified by:
      createZeroValue in class heros.template.DefaultIFDSTabulationProblem<soot.Unit,Abstraction,soot.SootMethod,IInfoflowCFG>
    • getZeroValue

      protected Abstraction getZeroValue()
    • isExceptionHandler

      protected boolean isExceptionHandler(soot.Unit u)
      Checks whether the given unit is the start of an exception handler
      Parameters:
      u - The unit to check
      Returns:
      True if the given unit is the start of an exception handler, otherwise false
    • notifyOutFlowHandlers

      protected Set<Abstraction> notifyOutFlowHandlers(soot.Unit stmt, Abstraction d1, Abstraction incoming, Set<Abstraction> outgoing, TaintPropagationHandler.FlowFunctionType functionType)
      Notifies the outbound flow handlers, if any, about the computed result abstractions for the current flow function
      Parameters:
      d1 - The abstraction at the beginning of the method
      stmt - The statement that has just been processed
      incoming - The incoming abstraction from which the outbound ones were computed
      outgoing - The outbound abstractions to be propagated on
      functionType - The type of flow function that was computed
      Returns:
      The outbound flow abstracions, potentially changed by the flow handlers
    • computeValues

      public boolean computeValues()
      Specified by:
      computeValues in interface heros.SolverConfiguration
      Overrides:
      computeValues in class heros.template.DefaultIFDSTabulationProblem<soot.Unit,Abstraction,soot.SootMethod,IInfoflowCFG>
    • getManager

      public InfoflowManager getManager()
    • isExcluded

      protected boolean isExcluded(soot.SootMethod sm)
      Checks whether the given method is excluded from the data flow analysis, i.e., should not be analyzed
      Parameters:
      sm - The method to check
      Returns:
      True if the method is excluded and shall not be analyzed, otherwise false
    • getResults

      public TaintPropagationResults getResults()
      Gets the results of the data flow analysis
    • getPropagationRules

      public PropagationRuleManager getPropagationRules()
      Gets the rules that FlowDroid uses internally to conduct specific analysis tasks such as handling sources or sinks
      Returns:
      The propagation rule manager
    • hasAnotherReferenceOnBase

      protected boolean hasAnotherReferenceOnBase(soot.jimple.InvokeExpr e, soot.Value actualBase, int ignoreIndex)
      Checks whether the arguments of a given invoke expression has a reference to a given base object while ignoring the given index
      Parameters:
      e - the invoke expr
      actualBase - the base to look for
      ignoreIndex - the index to ignore
      Returns:
      true if there is another reference