Class InfoflowSolver
java.lang.Object
soot.jimple.infoflow.solver.AbstractIFDSSolver<N,D>
soot.jimple.infoflow.solver.gcSolver.IFDSSolver<soot.Unit,Abstraction,IInfoflowCFG>
soot.jimple.infoflow.solver.gcSolver.InfoflowSolver
- All Implemented Interfaces:
IMemoryBoundedSolver,IInfoflowSolver
public class InfoflowSolver
extends IFDSSolver<soot.Unit,Abstraction,IInfoflowCFG>
implements IInfoflowSolver
We are subclassing the JimpleIFDSSolver because we need the same executor for
both the forward and the backward analysis Also we need to be able to insert
edges containing new taint information
-
Nested Class Summary
Nested classes/interfaces inherited from interface soot.jimple.infoflow.memory.IMemoryBoundedSolver
IMemoryBoundedSolver.IMemoryBoundedSolverStatusNotification -
Field Summary
Fields inherited from class soot.jimple.infoflow.solver.gcSolver.IFDSSolver
DEBUG, DEFAULT_CACHE_BUILDER, endSummary, executor, ffCache, flowFunctions, followReturnsPastSeeds, garbageCollector, icfg, incoming, initialSeeds, jumpFunctions, logger, memoryManager, numThreads, propagationCount, sleepTime, solverId, solverPeerGroup, zeroValueFields inherited from class soot.jimple.infoflow.solver.AbstractIFDSSolver
shorteningMode -
Constructor Summary
ConstructorsConstructorDescriptionInfoflowSolver(AbstractInfoflowProblem problem, InterruptableExecutor executor, int sleepTime) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddIncoming(soot.SootMethod m, Abstraction d3, soot.Unit n, Abstraction d1, Abstraction d2) voidapplySummary(soot.SootMethod callee, Abstraction d3, soot.Unit callSite, Abstraction d2, Abstraction d1) Calls applyEndSummaryOnCall in the current solvervoidcleanup()Cleans up some unused memory.protected Set<Abstraction>computeCallFlowFunction(heros.FlowFunction<Abstraction> flowFunction, Abstraction d1, Abstraction d2) Computes the call flow function for the given call-site abstractionprotected Set<Abstraction>computeCallToReturnFlowFunction(heros.FlowFunction<Abstraction> flowFunction, Abstraction d1, Abstraction d2) Computes the call-to-return flow function for the given call-site abstractionprotected Set<Abstraction>computeNormalFlowFunction(heros.FlowFunction<Abstraction> flowFunction, Abstraction d1, Abstraction d2) Computes the normal flow function for the given set of start and end abstractions.protected Set<Abstraction>computeReturnFlowFunction(heros.FlowFunction<Abstraction> retFunction, Abstraction d1, Abstraction d2, soot.Unit callSite, Collection<Abstraction> callerSideDs) Computes the return flow function for the given set of caller-side abstractions.Set<EndSummary<soot.Unit,Abstraction>> endSummary(soot.SootMethod m, Abstraction d3) Gets the end summary of the given method for the given incoming abstractionprotected InterruptableExecutorFactory method for this solver's thread-pool executor.longGets the number of edges propagated by the solverGets the IFDS problem solved by this solverSet<IncomingRecord<soot.Unit,Abstraction>> incoming(Abstraction d1, soot.SootMethod m) voidinjectContext(IInfoflowSolver otherSolver, soot.SootMethod callee, Abstraction d3, soot.Unit callSite, Abstraction d2, Abstraction d1) Injects the given calling context into the incoming setbooleanprocessEdge(heros.solver.PathEdge<soot.Unit, Abstraction> edge) Schedules the given edge for processing in the solverprotected voidprocessExit(heros.solver.PathEdge<soot.Unit, Abstraction> edge) Lines 21-32 of the algorithm.voidSets a handler that will be called when a followReturnsPastSeeds case happens, i.e., a taint leaves a method for which we have not seen any callersMethods inherited from class soot.jimple.infoflow.solver.gcSolver.IFDSSolver
addFunction, addStatusListener, applyEndSummaryOnCall, awaitCompletionComputeValuesAndShutdown, createGarbageCollector, forceTerminate, getDebugName, getMemoryManager, getTerminationReason, isKilled, isTerminated, printStats, propagate, reset, scheduleEdgeProcessing, setMaxAbstractionPathLength, setMaxCalleesPerCallSite, setMaxJoinPointAbstractions, setMemoryManager, setPeerGroup, setSolverId, solve, submitInitialSeeds, terminateMethods inherited from class soot.jimple.infoflow.solver.AbstractIFDSSolver
setPredecessorShorteningMode, shortenPredecessorsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface soot.jimple.infoflow.solver.IInfoflowSolver
getMemoryManager, setMaxAbstractionPathLength, setMaxCalleesPerCallSite, setMaxJoinPointAbstractions, setMemoryManager, setPeerGroup, setPredecessorShorteningMode, setSolverId, solve, terminate
-
Constructor Details
-
InfoflowSolver
public InfoflowSolver(AbstractInfoflowProblem problem, InterruptableExecutor executor, int sleepTime)
-
-
Method Details
-
getExecutor
Description copied from class:IFDSSolverFactory method for this solver's thread-pool executor.- Overrides:
getExecutorin classIFDSSolver<soot.Unit,Abstraction, IInfoflowCFG>
-
processEdge
Description copied from interface:IInfoflowSolverSchedules the given edge for processing in the solver- Specified by:
processEdgein interfaceIInfoflowSolver- Parameters:
edge- The edge to schedule for processing- Returns:
- True if the edge was scheduled, otherwise (e.g., if the edge has already been processed earlier) false
-
injectContext
public void injectContext(IInfoflowSolver otherSolver, soot.SootMethod callee, Abstraction d3, soot.Unit callSite, Abstraction d2, Abstraction d1) Description copied from interface:IInfoflowSolverInjects the given calling context into the incoming set- Specified by:
injectContextin interfaceIInfoflowSolvercallee- methodd3- calling contextcallSite- call sited2- incoming abstraction at the call sited1- calling context at the call site
-
incoming
- Overrides:
incomingin classIFDSSolver<soot.Unit,Abstraction, IInfoflowCFG>
-
addIncoming
public boolean addIncoming(soot.SootMethod m, Abstraction d3, soot.Unit n, Abstraction d1, Abstraction d2) - Overrides:
addIncomingin classIFDSSolver<soot.Unit,Abstraction, IInfoflowCFG>
-
applySummary
public void applySummary(soot.SootMethod callee, Abstraction d3, soot.Unit callSite, Abstraction d2, Abstraction d1) Description copied from interface:IInfoflowSolverCalls applyEndSummaryOnCall in the current solver- Specified by:
applySummaryin interfaceIInfoflowSolver- Parameters:
callee- methodd3- calling contextcallSite- call sited2- incoming abstraction at the call sited1- calling context at the call site
-
computeReturnFlowFunction
protected Set<Abstraction> computeReturnFlowFunction(heros.FlowFunction<Abstraction> retFunction, Abstraction d1, Abstraction d2, soot.Unit callSite, Collection<Abstraction> callerSideDs) Description copied from class:IFDSSolverComputes the return flow function for the given set of caller-side abstractions.- Overrides:
computeReturnFlowFunctionin classIFDSSolver<soot.Unit,Abstraction, IInfoflowCFG> - Parameters:
retFunction- The return flow function to computed1- The abstraction at the beginning of the calleed2- The abstraction at the exit node in the calleecallSite- The call sitecallerSideDs- The abstractions at the call site- Returns:
- The set of caller-side abstractions at the return site
-
computeNormalFlowFunction
protected Set<Abstraction> computeNormalFlowFunction(heros.FlowFunction<Abstraction> flowFunction, Abstraction d1, Abstraction d2) Description copied from class:IFDSSolverComputes the normal flow function for the given set of start and end abstractions.- Overrides:
computeNormalFlowFunctionin classIFDSSolver<soot.Unit,Abstraction, IInfoflowCFG> - Parameters:
flowFunction- The normal flow function to computed1- The abstraction at the method's start noded2- The abstraction at the current node- Returns:
- The set of abstractions at the successor node
-
computeCallToReturnFlowFunction
protected Set<Abstraction> computeCallToReturnFlowFunction(heros.FlowFunction<Abstraction> flowFunction, Abstraction d1, Abstraction d2) Description copied from class:IFDSSolverComputes the call-to-return flow function for the given call-site abstraction- Overrides:
computeCallToReturnFlowFunctionin classIFDSSolver<soot.Unit,Abstraction, IInfoflowCFG> - Parameters:
flowFunction- The call-to-return flow function to computed1- The abstraction at the current method's start node.d2- The abstraction at the call site- Returns:
- The set of caller-side abstractions at the return site
-
computeCallFlowFunction
protected Set<Abstraction> computeCallFlowFunction(heros.FlowFunction<Abstraction> flowFunction, Abstraction d1, Abstraction d2) Description copied from class:IFDSSolverComputes the call flow function for the given call-site abstraction- Overrides:
computeCallFlowFunctionin classIFDSSolver<soot.Unit,Abstraction, IInfoflowCFG> - Parameters:
flowFunction- The call flow function to computed1- The abstraction at the current method's start node.d2- The abstraction at the call site- Returns:
- The set of caller-side abstractions at the callee's start node
-
cleanup
public void cleanup()Description copied from interface:IInfoflowSolverCleans up some unused memory. Results will still be available afterwards, but no intermediate computation values.- Specified by:
cleanupin interfaceIInfoflowSolver
-
endSummary
Description copied from interface:IInfoflowSolverGets the end summary of the given method for the given incoming abstraction- Specified by:
endSummaryin interfaceIInfoflowSolver- Overrides:
endSummaryin classIFDSSolver<soot.Unit,Abstraction, IInfoflowCFG> - Parameters:
m- The method for which to get the end summaryd3- The incoming fact (context) for which to get the end summary- Returns:
- The end summary of the given method for the given incoming abstraction
-
processExit
Description copied from class:IFDSSolverLines 21-32 of the algorithm. Stores callee-side summaries. Also, at the side of the caller, propagates intra-procedural flows to return sites using those newly computed summaries.- Overrides:
processExitin classIFDSSolver<soot.Unit,Abstraction, IInfoflowCFG> - Parameters:
edge- an edge whose target node resembles a method exits
-
setFollowReturnsPastSeedsHandler
Description copied from interface:IInfoflowSolverSets a handler that will be called when a followReturnsPastSeeds case happens, i.e., a taint leaves a method for which we have not seen any callers- Specified by:
setFollowReturnsPastSeedsHandlerin interfaceIInfoflowSolver- Parameters:
handler- The handler to be called when a followReturnsPastSeeds case happens
-
getPropagationCount
public long getPropagationCount()Description copied from interface:IInfoflowSolverGets the number of edges propagated by the solver- Specified by:
getPropagationCountin interfaceIInfoflowSolver- Returns:
- The number of edges propagated by the solver
-
getTabulationProblem
Description copied from interface:IInfoflowSolverGets the IFDS problem solved by this solver- Specified by:
getTabulationProblemin interfaceIInfoflowSolver- Returns:
- The IFDS problem solved by this solver
-