Package soot.jimple.infoflow.problems
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final Map<soot.Unit,Set<Abstraction>> protected final org.slf4j.Loggerprotected final InfoflowManagerprotected INativeCallHandlerprotected final PropagationRuleManagerprotected final TaintPropagationResultsprotected IInfoflowSolverprotected TaintPropagationHandlerprotected ITaintPropagationWrapperprotected Abstraction -
Constructor Summary
ConstructorsConstructorDescriptionAbstractInfoflowProblem(InfoflowManager manager, Abstraction zeroValue, IPropagationRuleManagerFactory ruleManagerFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddInitialSeeds(soot.Unit unit, Set<Abstraction> seeds) Adds the given initial seeds to the information flow problembooleanbooleanbooleanwe need this option as we start directly at the sources, but need to go backward in the call stackMap<soot.Unit,Set<Abstraction>> Gets the initial seeds with which this information flow problem has been configuredGets the rules that FlowDroid uses internally to conduct specific analysis tasks such as handling sources or sinksGets the results of the data flow analysisGets the taint propagation handlerprotected Abstractionprotected booleanhasAnotherReferenceOnBase(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 indexbooleanGets whether this information flow problem has initial seedsMap<soot.Unit,Set<Abstraction>> booleanisCallSiteActivatingTaint(soot.Unit callSite, soot.Unit activationUnit) protected booleanisExceptionHandler(soot.Unit u) Checks whether the given unit is the start of an exception handlerprotected booleanisExcluded(soot.SootMethod sm) Checks whether the given method is excluded from the data flow analysis, i.e., should not be analyzedprotected booleanisInitialMethod(soot.SootMethod sm) Gets whether the given method is an entry point, i.e. one of the initial seeds belongs to the given methodprotected 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 functionprotected booleanregisterActivationCallSite(soot.Unit callSite, soot.SootMethod callee, Abstraction activationAbs) voidvoidsetNativeCallHandler(INativeCallHandler handler) Sets the handler class to be used for modeling the effects of native methods on the taint statevoidsetSolver(IInfoflowSolver solver) voidSets a handler which is invoked whenever a taint is propagatedvoidsetTaintWrapper(ITaintPropagationWrapper wrapper) Sets the taint wrapper that shall be used for applying external library modelsvoidsetZeroValue(Abstraction zeroValue) Methods inherited from class heros.template.DefaultIFDSTabulationProblem
createFlowFunctionsFactory, flowFunctions, numThreads, recordEdges, zeroValue
-
Field Details
-
manager
-
initialSeeds
-
taintWrapper
-
ncHandler
-
logger
protected final org.slf4j.Logger logger -
zeroValue
-
solver
-
taintPropagationHandler
-
propagationRules
-
results
-
-
Constructor Details
-
AbstractInfoflowProblem
public AbstractInfoflowProblem(InfoflowManager manager, Abstraction zeroValue, IPropagationRuleManagerFactory ruleManagerFactory)
-
-
Method Details
-
setSolver
-
setZeroValue
-
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:
followReturnsPastSeedsin interfaceheros.SolverConfiguration- Overrides:
followReturnsPastSeedsin classheros.template.DefaultIFDSTabulationProblem<soot.Unit,Abstraction, soot.SootMethod, IInfoflowCFG>
-
setTaintWrapper
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
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
-
autoAddZero
public boolean autoAddZero()- Specified by:
autoAddZeroin interfaceheros.SolverConfiguration- Overrides:
autoAddZeroin classheros.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
-
interproceduralCFG
- Specified by:
interproceduralCFGin interfaceheros.IFDSTabulationProblem<soot.Unit,Abstraction, soot.SootMethod, IInfoflowCFG> - Overrides:
interproceduralCFGin classheros.template.DefaultIFDSTabulationProblem<soot.Unit,Abstraction, soot.SootMethod, IInfoflowCFG>
-
addInitialSeeds
Adds the given initial seeds to the information flow problem- Parameters:
unit- The unit to be considered as a seedseeds- 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
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
Sets a handler which is invoked whenever a taint is propagated- Parameters:
handler- The handler to be invoked when propagating taints
-
getTaintPropagationHandler
Gets the taint propagation handler- Returns:
- taint propagation handler
-
createZeroValue
- Specified by:
createZeroValuein classheros.template.DefaultIFDSTabulationProblem<soot.Unit,Abstraction, soot.SootMethod, IInfoflowCFG>
-
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 methodstmt- The statement that has just been processedincoming- The incoming abstraction from which the outbound ones were computedoutgoing- The outbound abstractions to be propagated onfunctionType- 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:
computeValuesin interfaceheros.SolverConfiguration- Overrides:
computeValuesin classheros.template.DefaultIFDSTabulationProblem<soot.Unit,Abstraction, soot.SootMethod, IInfoflowCFG>
-
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
Gets the results of the data flow analysis -
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 expractualBase- the base to look forignoreIndex- the index to ignore- Returns:
- true if there is another reference
-