Provide API for KLEE to verify execution traces #84
Replies: 3 comments
-
The current version of KLEE accepts a path to a .bc file, a path to a set of traces in SARIF format, and a list of options as input on the command line to verify traces for correctness. Similar input data will be needed to use KLEE as a library. We propose a class After creating an object of the Below is a description of enum ReachWithError { // supported vulnerability types
DoubleFree = 0,
UseAfterFree,
NullPointerException,
NullCheckAfterDerefException,
Reachable,
None,
};
struct Location { // structure describing an event from a trace
// Mandatory fields
std::string filename; // the name of the source file
unsigned int startLine; // the line number in the source code
// Optional fields
std::optional<unsigned int> endLine; // the end of the range in which the event occurs. If not set, it is equal to startLine
std::optional<unsigned int> startColumn; // the column in which the event occurs
std::optional<unsigned int> endColumn; // the end of the column range in which the event occurs. If not set, it is equal to startColumn
// If startColumn and endColumn are not set simultaneously, the range is considered unlimited
};
struct Result { // structure representing a single trace
std::vector<std::reference_wrapper<const Location>> locations; // list of events from the trace
unsigned id; // unique identifier of the trace
std::unordered_set<ReachWithError> errors; // list of vulnerabilities associated with this trace
};
struct SarifReport {
std::vector<Result> results; // list of traces
}; Description of the enum Verdict {
FalsePositive,
TruePositive
};
struct AnalysisResult { // structure representing the result of checking a trace
unsigned id; // unique identifier of the trace
Verdict v; // the verdict on the trace (FP or TP)
double confidence; // confidence in the verdict
};
struct AnalysisReport {
std::vector<AnalysisResult> results; // list of check results
}; What do you think of such an API? |
Beta Was this translation helpful? Give feedback.
-
What versions of LLVM are in use in projects that intend to use KLEE as a library? If you want the API to accept an instance of |
Beta Was this translation helpful? Give feedback.
-
We are working on a solution in this branch. Now there is a prototype that we tested on a test project. This is not a finished version of the solution yet. |
Beta Was this translation helpful? Give feedback.
-
One of unique advantages of UTBOT-KLEE is ability to verify execution trace of defect (e.g. in SARIF format) is True Positive or False Positive.
But the only way to start UTBOT-KLEE is from CLI (command line interface).
Can we provide API to be able to use UTBOT-KLEE as library.
We can discuss here the format of this API.
Beta Was this translation helpful? Give feedback.
All reactions