Class Aliasing

java.lang.Object
soot.jimple.infoflow.aliasing.Aliasing

public class Aliasing extends Object
Helper class for aliasing operations
Author:
Steven Arzt
  • Field Details

    • strongAliasAnalysis

      protected final com.google.common.cache.LoadingCache<soot.SootMethod,soot.jimple.toolkits.pointer.LocalMustAliasAnalysis> strongAliasAnalysis
  • Constructor Details

  • Method Details

    • computeAliases

      public void computeAliases(Abstraction d1, soot.jimple.Stmt src, soot.Value targetValue, Set<Abstraction> taintSet, soot.SootMethod method, Abstraction newAbs)
      Computes the taints for the aliases of a given tainted variable
      Parameters:
      d1 - The context in which the variable has been tainted
      src - The statement that tainted the variable
      targetValue - The target value which has been tainted
      taintSet - The set to which all generated alias taints shall be added
      method - The method containing src
      newAbs - The newly generated abstraction for the variable taint
    • getReferencedAPBase

      public AccessPath getReferencedAPBase(AccessPath taintedAP, soot.SootField[] referencedFields)
      Matches the given access path against the given array of fields
      Parameters:
      taintedAP - The tainted access paths
      referencedFields - The array of referenced access paths
      Returns:
      The actually matched access path if a matching was possible, otherwise null
    • getReferencedAPBase

      public static AccessPath getReferencedAPBase(AccessPath taintedAP, soot.SootField[] referencedFields, InfoflowManager manager)
      Matches the given access path against the given array of fields
      Parameters:
      taintedAP - The tainted access paths
      referencedFields - The array of referenced access paths
      manager - The data flow manager
      Returns:
      The actually matched access path if a matching was possible, otherwise null
    • mayAlias

      public boolean mayAlias(soot.Value val1, soot.Value val2)
      Gets whether two values may potentially point to the same runtime object
      Parameters:
      val1 - The first value
      val2 - The second value
      Returns:
      True if the two values may potentially point to the same runtime object, otherwise false
    • mayAlias

      public AccessPath mayAlias(AccessPath ap, soot.Value val)
      Gets whether a value and an access path may potentially point to the same runtime object
      Parameters:
      ap - The access path
      val - The value
      Returns:
      The access path that actually matched if the given value and access path alias. In the simplest case, this is the given access path. When using recursive access paths, it can however also be a base expansion. If the given access path and value do not alias, null is returned.
    • mustAlias

      public boolean mustAlias(soot.SootField field1, soot.SootField field2)
      Gets whether the two fields must always point to the same runtime object
      Parameters:
      field1 - The first field
      field2 - The second field
      Returns:
      True if the two fields must always point to the same runtime object, otherwise false
    • mustAlias

      public boolean mustAlias(soot.Local val1, soot.Local val2, soot.jimple.Stmt position)
      Gets whether the two values must always point to the same runtime object
      Parameters:
      val1 - The first value
      val2 - The second value
      position - The statement at which to check for an aliasing relationship
      Returns:
      True if the two values must always point to the same runtime object, otherwise false
    • getMustAliasAnalysis

      public soot.jimple.toolkits.pointer.LocalMustAliasAnalysis getMustAliasAnalysis(soot.jimple.Stmt stmt)
    • canHaveAliases

      public boolean canHaveAliases(soot.jimple.Stmt stmt, soot.Value val, Abstraction source)
      Checks whether the given newly created taint can have an alias at the given statement. Assume a statement a.x = source(). This will check whether tainting a.<?> can induce new aliases or not.
      Parameters:
      val - The value which gets tainted
      source - The source from which the taints comes from
      Returns:
      True if the analysis must look for aliases for the newly constructed taint, otherwise false
    • canHaveAliasesRightSide

      public boolean canHaveAliasesRightSide(soot.jimple.Stmt stmt, soot.Value val, Abstraction source)
    • isStringConstructorCall

      public boolean isStringConstructorCall(soot.jimple.Stmt iStmt)
      Checks whether the given statement is a call to a String constructor
      Parameters:
      iStmt - The statement to check
      Returns:
      True if the given statement is a call to a String constructor, false otherwise
    • canHaveAliases

      public static boolean canHaveAliases(AccessPath ap)
      Gets whether the given access path can have aliases
      Parameters:
      ap - The access path to check
      Returns:
      True if the given access path can have aliases, otherwise false
    • baseMatches

      public static boolean baseMatches(soot.Value baseValue, Abstraction source)
      Checks whether the given base value matches the base of the given taint abstraction
      Parameters:
      baseValue - The value to check
      source - The taint abstraction to check
      Returns:
      True if the given value has the same base value as the given taint abstraction, otherwise false
    • baseMatchesStrict

      public static boolean baseMatchesStrict(soot.Value baseValue, Abstraction source)
      Checks whether the given base value matches the base of the given taint abstraction and ends there. So a will match a, but not a.x. Not that this function will still match a to a.*.
      Parameters:
      baseValue - The value to check
      source - The taint abstraction to check
      Returns:
      True if the given value has the same base value as the given taint abstraction and no further elements, otherwise false
    • excludeMethodFromMustAlias

      public void excludeMethodFromMustAlias(soot.SootMethod method)
      Adds a new method to be excluded from the must-alias analysis
      Parameters:
      method - The method to be excluded
    • getAliasingStrategy

      public IAliasingStrategy getAliasingStrategy()