Package soot.jimple.infoflow.aliasing
Class Aliasing
java.lang.Object
soot.jimple.infoflow.aliasing.Aliasing
Helper class for aliasing operations
- Author:
- Steven Arzt
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.google.common.cache.LoadingCache<soot.SootMethod,soot.jimple.toolkits.pointer.LocalMustAliasAnalysis> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanbaseMatches(soot.Value baseValue, Abstraction source) Checks whether the given base value matches the base of the given taint abstractionstatic booleanbaseMatchesStrict(soot.Value baseValue, Abstraction source) Checks whether the given base value matches the base of the given taint abstraction and ends there.static booleanGets whether the given access path can have aliasesbooleancanHaveAliases(soot.jimple.Stmt stmt, soot.Value val, Abstraction source) Checks whether the given newly created taint can have an alias at the given statement.booleancanHaveAliasesRightSide(soot.jimple.Stmt stmt, soot.Value val, Abstraction source) voidcomputeAliases(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 variablevoidexcludeMethodFromMustAlias(soot.SootMethod method) Adds a new method to be excluded from the must-alias analysissoot.jimple.toolkits.pointer.LocalMustAliasAnalysisgetMustAliasAnalysis(soot.jimple.Stmt stmt) getReferencedAPBase(AccessPath taintedAP, soot.SootField[] referencedFields) Matches the given access path against the given array of fieldsstatic AccessPathgetReferencedAPBase(AccessPath taintedAP, soot.SootField[] referencedFields, InfoflowManager manager) Matches the given access path against the given array of fieldsbooleanisStringConstructorCall(soot.jimple.Stmt iStmt) Checks whether the given statement is a call to a String constructormayAlias(AccessPath ap, soot.Value val) Gets whether a value and an access path may potentially point to the same runtime objectbooleanmayAlias(soot.Value val1, soot.Value val2) Gets whether two values may potentially point to the same runtime objectbooleanmustAlias(soot.Local val1, soot.Local val2, soot.jimple.Stmt position) Gets whether the two values must always point to the same runtime objectbooleanmustAlias(soot.SootField field1, soot.SootField field2) Gets whether the two fields must always point to the same runtime object
-
Field Details
-
strongAliasAnalysis
protected final com.google.common.cache.LoadingCache<soot.SootMethod,soot.jimple.toolkits.pointer.LocalMustAliasAnalysis> strongAliasAnalysis
-
-
Constructor Details
-
Aliasing
-
-
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 taintedsrc- The statement that tainted the variabletargetValue- The target value which has been taintedtaintSet- The set to which all generated alias taints shall be addedmethod- The method containing srcnewAbs- The newly generated abstraction for the variable taint
-
getReferencedAPBase
Matches the given access path against the given array of fields- Parameters:
taintedAP- The tainted access pathsreferencedFields- 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 pathsreferencedFields- The array of referenced access pathsmanager- 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 valueval2- The second value- Returns:
- True if the two values may potentially point to the same runtime object, otherwise false
-
mayAlias
Gets whether a value and an access path may potentially point to the same runtime object- Parameters:
ap- The access pathval- 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 fieldfield2- 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 valueval2- The second valueposition- 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
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 taintedsource- 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
-
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
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
Checks whether the given base value matches the base of the given taint abstraction- Parameters:
baseValue- The value to checksource- The taint abstraction to check- Returns:
- True if the given value has the same base value as the given taint abstraction, otherwise false
-
baseMatchesStrict
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 checksource- 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
-