Package soot.jimple.infoflow.data
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 Summary
FieldsModifier and TypeFieldDescriptionprotected AccessPaththe access path contains the currently tainted variable or fieldprotected soot.UnitUnit/Stmt which activates the taint when the abstraction passes itprotected soot.jimple.Stmtprotected soot.jimple.Stmtprotected booleanOnly valid for inactive abstractions.protected soot.Unitprotected booleantaint is thrown by an exception (is set to false when it reaches the catch-Stmt)protected static booleanprotected intprotected booleanprotected intprotected Set<Abstraction>protected AtomicBitSetprotected List<IInfoflowCFG.UnitContainer>The postdominators we need to pass in order to leave the current conditional branch.protected Abstractionprotected intprotected SourceContextprotected soot.UnitUnit/Stmt which indicates it origin; tells the aliasing to turn around in backwards analysis -
Constructor Summary
ConstructorsModifierConstructorDescriptionAbstraction(Collection<ISourceSinkDefinition> definitions, AccessPath sourceVal, soot.jimple.Stmt sourceStmt, Object userData, boolean exceptionThrown, boolean isImplicit) protectedAbstraction(AccessPath p, Abstraction original) Creates an abstraction as a copy of an existing abstraction, only exchanging the access path. -> only used by AbstractionWithPath -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddNeighbor(Abstraction originalAbstraction) 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.clone()Clones this data flow abstractionclone(soot.Unit currentUnit, soot.Unit callSite) Clones this data flow abstraction with the current statement and corresponding call site setbooleanderiveCondition(AccessPath ap, soot.jimple.Stmt stmt) deriveConditionalAbstractionCall(soot.Unit conditionalCallSite) deriveConditionalAbstractionEnter(IInfoflowCFG.UnitContainer postdom, soot.jimple.Stmt conditionalUnit) deriveConditionalUpdate(soot.jimple.Stmt stmt) deriveDefinitelyNewAbstraction(AccessPath p, soot.jimple.Stmt currentStmt) deriveDefinitelyNewAbstraction(AccessPath p, soot.jimple.Stmt currentStmt, boolean isImplicit) deriveInactiveAbstraction(soot.jimple.Stmt activationUnit) deriveNewAbstraction(AccessPath p, soot.jimple.Stmt currentStmt) deriveNewAbstraction(AccessPath p, soot.jimple.Stmt currentStmt, boolean isImplicit) protected AbstractionderiveNewAbstractionMutable(AccessPath p, soot.jimple.Stmt currentStmt) Derives a new abstraction that models the current local being caught as an exceptionderiveNewAbstractionOnThrow(soot.jimple.Stmt throwStmt) Derives a new abstraction that models the current local being thrown as an exceptionderiveNewAbstractionWithDominator(soot.Unit dominator) deriveNewAbstractionWithDominator(soot.Unit dominator, soot.jimple.Stmt stmt) deriveNewAbstractionWithTurnUnit(soot.Unit turnUnit) booleanentails(Abstraction other) Checks whether this abstraction entails the given abstraction, i.e. this taint also taints everything that is tainted by the given taint.booleanbooleansoot.UnitIf this abstraction supports alias analysis, this returns the active copy of the current abstraction.soot.jimple.Stmtsoot.jimple.Stmtsoot.UnitbooleanGets whether this value has been thrown as an exceptionintGets the number of neighbors already registered with this abstractionintGets the length of the path over which this node was propagatedGets the predecessor of this nodeGets the context of the taint, i.e. the statement and value of the sourcesoot.Unitstatic AbstractiongetZeroAbstraction(boolean flowSensitiveAliasing) inthashCode()static voidinitialize(InfoflowConfiguration config) Initializes the configuration for building new abstractionsinjectSourceContext(SourceContext sourceContext) booleanbooleanisDominator(soot.Unit u) booleanbooleanisTopPostdominator(soot.SootMethod sm) booleanisTopPostdominator(soot.Unit u) booleanlocalEquals(Abstraction other) Checks whether this object locally equals the given object, i.e. the both are equal modulo the access pathbooleanregisterPathFlag(int id, int maxSize) Registers that a worker thread with the given ID has already processed this abstractionremoveDominator(soot.jimple.Stmt stmt) voidsetCorrespondingCallSite(soot.jimple.Stmt callSite) voidsetDominator(soot.Unit dominator) voidsetPredecessor(Abstraction predecessor) Explicitly sets the predecessor of this node.voidsetSourceContext(SourceContext sourceContext) Only use this method if you really need to fake a source context and know what you are doing.toString()
-
Field Details
-
flowSensitiveAliasing
protected static boolean flowSensitiveAliasing -
accessPath
the access path contains the currently tainted variable or field -
predecessor
-
neighbors
-
currentStmt
protected soot.jimple.Stmt currentStmt -
correspondingCallSite
protected soot.jimple.Stmt correspondingCallSite -
sourceContext
-
activationUnit
protected soot.Unit activationUnitUnit/Stmt which activates the taint when the abstraction passes it -
turnUnit
protected soot.Unit turnUnitUnit/Stmt which indicates it origin; tells the aliasing to turn around in backwards analysis -
exceptionThrown
protected boolean exceptionThrowntaint is thrown by an exception (is set to false when it reaches the catch-Stmt) -
hashCode
protected int hashCode -
neighborHashCode
protected int neighborHashCode -
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 dependsOnCutAPOnly valid for inactive abstractions. Specifies whether an access paths has been cut during alias analysis. -
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
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 abstractionoriginal- The original abstraction to copy
-
-
Method Details
-
initialize
Initializes the configuration for building new abstractions- Parameters:
config- The configuration of the data flow solver
-
deriveInactiveAbstraction
-
deriveNewAbstraction
-
deriveDefinitelyNewAbstraction
-
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
-
deriveNewAbstractionOnThrow
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
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
-
getAccessPath
-
getActivationUnit
public soot.Unit getActivationUnit() -
getTurnUnit
public soot.Unit getTurnUnit() -
deriveNewAbstractionWithTurnUnit
-
getActiveCopy
Description copied from interface:FastSolverLinkedNodeIf this abstraction supports alias analysis, this returns the active copy of the current abstraction. Otherwise, "this" is returned.- Specified by:
getActiveCopyin interfaceFastSolverLinkedNode<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
-
dropTopPostdominator
-
getTopPostdominator
-
isTopPostdominator
public boolean isTopPostdominator(soot.Unit u) -
isTopPostdominator
public boolean isTopPostdominator(soot.SootMethod sm) -
deriveNewAbstractionWithDominator
-
deriveNewAbstractionWithDominator
-
deriveConditionalUpdate
-
deriveCondition
-
removeDominator
-
setDominator
public void setDominator(soot.Unit dominator) -
getDominator
public soot.Unit getDominator() -
isDominator
public boolean isDominator(soot.Unit u) -
clone
Description copied from interface:FastSolverLinkedNodeClones this data flow abstraction- Specified by:
clonein interfaceFastSolverLinkedNode<Abstraction,soot.Unit> - Overrides:
clonein classObject- Returns:
- A clone of the current data flow abstraction
-
clone
Description copied from interface:FastSolverLinkedNodeClones this data flow abstraction with the current statement and corresponding call site set- Specified by:
clonein interfaceFastSolverLinkedNode<Abstraction,soot.Unit> - Returns:
- A clone of the current data flow abstraction
-
equals
-
equalsWithoutContext
-
localEquals
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() -
entails
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
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
Description copied from interface:FastSolverLinkedNodeGets the predecessor of this node- Specified by:
getPredecessorin interfaceFastSolverLinkedNode<Abstraction,soot.Unit> - Returns:
- The predecessor of this node is applicable, null for source nodes
-
getNeighbors
-
getCurrentStmt
public soot.jimple.Stmt getCurrentStmt() -
addNeighbor
Description copied from interface:FastSolverLinkedNodeLinks 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:
addNeighborin interfaceFastSolverLinkedNode<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
-
setPredecessor
Description copied from interface:FastSolverLinkedNodeExplicitly sets the predecessor of this node.- Specified by:
setPredecessorin interfaceFastSolverLinkedNode<Abstraction,soot.Unit> - Parameters:
predecessor- The predecessor node to set
-
setSourceContext
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
-
getNeighborCount
public int getNeighborCount()Description copied from interface:FastSolverLinkedNodeGets the number of neighbors already registered with this abstraction- Specified by:
getNeighborCountin interfaceFastSolverLinkedNode<Abstraction,soot.Unit> - Returns:
- The number of neighbors already registered with this abstraction
-
getPathLength
public int getPathLength()Description copied from interface:FastSolverLinkedNodeGets the length of the path over which this node was propagated- Specified by:
getPathLengthin interfaceFastSolverLinkedNode<Abstraction,soot.Unit> - Returns:
- The length of the path over which this node was propagated
-