Class Abstraction

java.lang.Object
soot.jimple.infoflow.data.Abstraction
All Implemented Interfaces:
Cloneable, FastSolverLinkedNode<Abstraction,soot.Unit>

public class Abstraction extends Object implements Cloneable, FastSolverLinkedNode<Abstraction,soot.Unit>
The abstraction class contains all information that is necessary to track the taint.
Author:
Steven Arzt, Christian Fritz
  • Field Details

    • flowSensitiveAliasing

      protected static boolean flowSensitiveAliasing
    • accessPath

      protected AccessPath accessPath
      the access path contains the currently tainted variable or field
    • predecessor

      protected Abstraction predecessor
    • neighbors

      protected volatile Set<Abstraction> neighbors
    • currentStmt

      protected soot.jimple.Stmt currentStmt
    • correspondingCallSite

      protected soot.jimple.Stmt correspondingCallSite
    • sourceContext

      protected SourceContext sourceContext
    • activationUnit

      protected soot.Unit activationUnit
      Unit/Stmt which activates the taint when the abstraction passes it
    • turnUnit

      protected soot.Unit turnUnit
      Unit/Stmt which indicates it origin; tells the aliasing to turn around in backwards analysis
    • exceptionThrown

      protected boolean exceptionThrown
      taint is thrown by an exception (is set to false when it reaches the catch-Stmt)
    • hashCode

      protected int hashCode
    • neighborHashCode

      protected int neighborHashCode
    • postdominators

      protected List<IInfoflowCFG.UnitContainer> postdominators
      The postdominators we need to pass in order to leave the current conditional branch. Do not use the synchronized Stack class here to avoid deadlocks.
    • dominator

      protected soot.Unit dominator
    • isImplicit

      protected boolean isImplicit
    • dependsOnCutAP

      protected boolean dependsOnCutAP
      Only valid for inactive abstractions. Specifies whether an access paths has been cut during alias analysis.
    • pathFlags

      protected AtomicBitSet pathFlags
    • propagationPathLength

      protected int propagationPathLength
  • Constructor Details

    • Abstraction

      public Abstraction(Collection<ISourceSinkDefinition> definitions, AccessPath sourceVal, soot.jimple.Stmt sourceStmt, Object userData, boolean exceptionThrown, boolean isImplicit)
    • Abstraction

      protected Abstraction(AccessPath p, Abstraction original)
      Creates an abstraction as a copy of an existing abstraction, only exchanging the access path. -> only used by AbstractionWithPath
      Parameters:
      p - The access path for the new abstraction
      original - The original abstraction to copy
  • Method Details

    • initialize

      public static void initialize(InfoflowConfiguration config)
      Initializes the configuration for building new abstractions
      Parameters:
      config - The configuration of the data flow solver
    • deriveInactiveAbstraction

      public Abstraction deriveInactiveAbstraction(soot.jimple.Stmt activationUnit)
    • deriveNewAbstraction

      public Abstraction deriveNewAbstraction(AccessPath p, soot.jimple.Stmt currentStmt)
    • deriveDefinitelyNewAbstraction

      public Abstraction deriveDefinitelyNewAbstraction(AccessPath p, soot.jimple.Stmt currentStmt)
    • deriveDefinitelyNewAbstraction

      public Abstraction deriveDefinitelyNewAbstraction(AccessPath p, soot.jimple.Stmt currentStmt, boolean isImplicit)
    • deriveNewAbstraction

      public Abstraction deriveNewAbstraction(AccessPath p, soot.jimple.Stmt currentStmt, boolean isImplicit)
    • deriveNewAbstractionMutable

      protected Abstraction deriveNewAbstractionMutable(AccessPath p, soot.jimple.Stmt currentStmt)
    • deriveNewAbstractionOnThrow

      public Abstraction deriveNewAbstractionOnThrow(soot.jimple.Stmt throwStmt)
      Derives a new abstraction that models the current local being thrown as an exception
      Parameters:
      throwStmt - The statement at which the exception was thrown
      Returns:
      The newly derived abstraction
    • deriveNewAbstractionOnCatch

      public Abstraction deriveNewAbstractionOnCatch(AccessPath ap)
      Derives a new abstraction that models the current local being caught as an exception
      Parameters:
      ap - The access path in which the tainted exception is stored
      Returns:
      The newly derived abstraction
    • isAbstractionActive

      public boolean isAbstractionActive()
    • isImplicit

      public boolean isImplicit()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAccessPath

      public AccessPath getAccessPath()
    • getActivationUnit

      public soot.Unit getActivationUnit()
    • getTurnUnit

      public soot.Unit getTurnUnit()
    • deriveNewAbstractionWithTurnUnit

      public Abstraction deriveNewAbstractionWithTurnUnit(soot.Unit turnUnit)
    • getActiveCopy

      public Abstraction getActiveCopy()
      Description copied from interface: FastSolverLinkedNode
      If this abstraction supports alias analysis, this returns the active copy of the current abstraction. Otherwise, "this" is returned.
      Specified by:
      getActiveCopy in interface FastSolverLinkedNode<Abstraction,soot.Unit>
      Returns:
      The active copy if supported, otherwise the "this" reference
    • getExceptionThrown

      public boolean getExceptionThrown()
      Gets whether this value has been thrown as an exception
      Returns:
      True if this value has been thrown as an exception, otherwise false
    • deriveConditionalAbstractionEnter

      public Abstraction deriveConditionalAbstractionEnter(IInfoflowCFG.UnitContainer postdom, soot.jimple.Stmt conditionalUnit)
    • deriveConditionalAbstractionCall

      public Abstraction deriveConditionalAbstractionCall(soot.Unit conditionalCallSite)
    • dropTopPostdominator

      public Abstraction dropTopPostdominator()
    • getTopPostdominator

      public IInfoflowCFG.UnitContainer getTopPostdominator()
    • isTopPostdominator

      public boolean isTopPostdominator(soot.Unit u)
    • isTopPostdominator

      public boolean isTopPostdominator(soot.SootMethod sm)
    • deriveNewAbstractionWithDominator

      public Abstraction deriveNewAbstractionWithDominator(soot.Unit dominator, soot.jimple.Stmt stmt)
    • deriveNewAbstractionWithDominator

      public Abstraction deriveNewAbstractionWithDominator(soot.Unit dominator)
    • deriveConditionalUpdate

      public Abstraction deriveConditionalUpdate(soot.jimple.Stmt stmt)
    • deriveCondition

      public Abstraction deriveCondition(AccessPath ap, soot.jimple.Stmt stmt)
    • removeDominator

      public Abstraction removeDominator(soot.jimple.Stmt stmt)
    • setDominator

      public void setDominator(soot.Unit dominator)
    • getDominator

      public soot.Unit getDominator()
    • isDominator

      public boolean isDominator(soot.Unit u)
    • clone

      public Abstraction clone()
      Description copied from interface: FastSolverLinkedNode
      Clones this data flow abstraction
      Specified by:
      clone in interface FastSolverLinkedNode<Abstraction,soot.Unit>
      Overrides:
      clone in class Object
      Returns:
      A clone of the current data flow abstraction
    • clone

      public Abstraction clone(soot.Unit currentUnit, soot.Unit callSite)
      Description copied from interface: FastSolverLinkedNode
      Clones this data flow abstraction with the current statement and corresponding call site set
      Specified by:
      clone in interface FastSolverLinkedNode<Abstraction,soot.Unit>
      Returns:
      A clone of the current data flow abstraction
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsWithoutContext

      public boolean equalsWithoutContext(Object obj)
    • localEquals

      public boolean localEquals(Abstraction other)
      Checks whether this object locally equals the given object, i.e. the both are equal modulo the access path
      Parameters:
      other - The object to compare this object with
      Returns:
      True if this object is locally equal to the given one, otherwise false
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • entails

      public boolean entails(Abstraction other)
      Checks whether this abstraction entails the given abstraction, i.e. this taint also taints everything that is tainted by the given taint.
      Parameters:
      other - The other taint abstraction
      Returns:
      True if this object at least taints everything that is also tainted by the given object
    • getSourceContext

      public SourceContext getSourceContext()
      Gets the context of the taint, i.e. the statement and value of the source
      Returns:
      The statement and value of the source
    • dependsOnCutAP

      public boolean dependsOnCutAP()
    • getPredecessor

      public Abstraction getPredecessor()
      Description copied from interface: FastSolverLinkedNode
      Gets the predecessor of this node
      Specified by:
      getPredecessor in interface FastSolverLinkedNode<Abstraction,soot.Unit>
      Returns:
      The predecessor of this node is applicable, null for source nodes
    • getNeighbors

      public Set<Abstraction> getNeighbors()
    • getCurrentStmt

      public soot.jimple.Stmt getCurrentStmt()
    • addNeighbor

      public boolean addNeighbor(Abstraction originalAbstraction)
      Description copied from interface: FastSolverLinkedNode
      Links this node to a neighbor node, i.e., to an abstraction that would have been merged with this one of paths were not being tracked.
      Specified by:
      addNeighbor in interface FastSolverLinkedNode<Abstraction,soot.Unit>
      Returns:
      True if the neighbor was added, false if it was rejected
    • setCorrespondingCallSite

      public void setCorrespondingCallSite(soot.jimple.Stmt callSite)
    • getCorrespondingCallSite

      public soot.jimple.Stmt getCorrespondingCallSite()
    • getZeroAbstraction

      public static Abstraction getZeroAbstraction(boolean flowSensitiveAliasing)
    • setPredecessor

      public void setPredecessor(Abstraction predecessor)
      Description copied from interface: FastSolverLinkedNode
      Explicitly sets the predecessor of this node.
      Specified by:
      setPredecessor in interface FastSolverLinkedNode<Abstraction,soot.Unit>
      Parameters:
      predecessor - The predecessor node to set
    • setSourceContext

      public void setSourceContext(SourceContext sourceContext)
      Only use this method if you really need to fake a source context and know what you are doing.
      Parameters:
      sourceContext - The new source context
    • registerPathFlag

      public boolean registerPathFlag(int id, int maxSize)
      Registers that a worker thread with the given ID has already processed this abstraction
      Parameters:
      id - The ID of the worker thread
      Returns:
      True if the worker thread with the given ID has not been registered before, otherwise false
    • injectSourceContext

      public Abstraction injectSourceContext(SourceContext sourceContext)
    • getNeighborCount

      public int getNeighborCount()
      Description copied from interface: FastSolverLinkedNode
      Gets the number of neighbors already registered with this abstraction
      Specified by:
      getNeighborCount in interface FastSolverLinkedNode<Abstraction,soot.Unit>
      Returns:
      The number of neighbors already registered with this abstraction
    • getPathLength

      public int getPathLength()
      Description copied from interface: FastSolverLinkedNode
      Gets the length of the path over which this node was propagated
      Specified by:
      getPathLength in interface FastSolverLinkedNode<Abstraction,soot.Unit>
      Returns:
      The length of the path over which this node was propagated