pub enum ControllerRequest {
Show 14 variants
Configure {
options: Options,
responder: ControllerConfigureResponder,
},
GetOptions {
responder: ControllerGetOptionsResponder,
},
AddToCorpus {
corpus: Corpus,
input: Input,
responder: ControllerAddToCorpusResponder,
},
ReadCorpus {
corpus: Corpus,
corpus_reader: ClientEnd<CorpusReaderMarker>,
responder: ControllerReadCorpusResponder,
},
WriteDictionary {
dictionary: Input,
responder: ControllerWriteDictionaryResponder,
},
ReadDictionary {
responder: ControllerReadDictionaryResponder,
},
AddMonitor {
monitor: ClientEnd<MonitorMarker>,
responder: ControllerAddMonitorResponder,
},
Fuzz {
responder: ControllerFuzzResponder,
},
TryOne {
test_input: Input,
responder: ControllerTryOneResponder,
},
Minimize {
test_input: Input,
responder: ControllerMinimizeResponder,
},
Cleanse {
test_input: Input,
responder: ControllerCleanseResponder,
},
Merge {
responder: ControllerMergeResponder,
},
GetStatus {
responder: ControllerGetStatusResponder,
},
WatchArtifact {
responder: ControllerWatchArtifactResponder,
},
}Expand description
Provides the management interface for fuzzing.
This protocol is implemented by the fuzzing engine. Clients for this
protocol are provided by fuchsia.fuzzer/ControllerProvider.Connect.
The channel is closed when the fuzzer is no longer needed, and on error. Clients should exit and not attempt to reconnect.
Variants§
Configure
Sets various execution and error detection parameters. This may be
called multiple times; only the most recently received options are used.
If the Options parameter omits one or more fields, those parameters
are unchanged in the fuzzer. Until the initial call to this method, the
fuzzer should assume the default values for Options.
- request
optionsthe execution and error detection parameters.
- error one of the following:
- error
ZX_ERR_BAD_STATEif a long-running call such asExecute,Cleanse,Minimize,Fuzz, orMergeis in progress.ZX_ERR_NOT_SUPPORTEDif a value provided for an option is not supported by the engine. Check the logs for additional details.
GetOptions
Gets the current values for the various execution and error detection parameters.
- response
optionsthe execution and error detection parameters.
Fields
responder: ControllerGetOptionsResponderAddToCorpus
Writes the provided input to either the “seed” or “live” corpus.
Returns an error if transferring the input fails; see Input for
details.
- request
corpusthe type of corpus to add to. - request
inputthe sequence of bytes to add as a test input.
- error one of the following:
ZX_ERR_INVALID_ARGSif corpus type is invalid.- A socket error if transferring the input fails.
ReadCorpus
Connects a corpus_reader for either the “seed” or “live” corpus.
- request
corpusthe type of corpus to read from. - request
corpus_readerthe client used to send test inputs.
WriteDictionary
Parses and loads an AFL-style dictionary. Invalid entries are logged and skipped.
See also:
- https://github.com/mirrorer/afl/blob/master/dictionaries/README.dictionaries
- request
dictionarythe AFL-style dictionary
- error one of the following:
- A socket error if transferring the input fails.
*
ZX_ERR_INVALID_ARGSif parsing the dictionary fails.
- A socket error if transferring the input fails.
*
ReadDictionary
Returns the current dictionary as an Input, which may be empty.
- response
dictionarythe current AFL-style dictionary.
Fields
responder: ControllerReadDictionaryResponderAddMonitor
Installs a Monitor to push status. To pull status instead, use
GetStatus.
- request
monitorthe client used to send status updates.
Fuzz
Runs the normal fuzzing feedback loop:
- Selects an input from the corpus.
- Mutates the input.
- Uses the
TargetAdapterto execute the input. - Checks feedback from the
InstrumentedProcesses. - If the input produced useful feedback, adds it to the corpus.
This call returns quickly, but the loop continues until one of three conditions is met:
- The configured, non-zero number of
runshas been reached. - The configured, non-zero
durationelapses. - An error is detected, and returned.
See Result for more details on long running workflows such as this
one.
- error
ZX_ERR_BAD_STATEif another long-running workflow is in progress.
Fields
responder: ControllerFuzzResponderTryOne
Executes the target code with a single test_input.
See Result for more details on long running workflows such as this
one.
- request
inputthe sequence of bytes to use with the fuzz target.
- error one of the following:
ZX_ERR_BAD_STATEif another long-running workflow is in progress.- A socket error if transferring the input fails.
Minimize
Attempts to find the smallest input that produces the same error as the
given test_input,
constrained by the configured total_time and/or runs options.
See Result for more details on long running workflows such as this
one.
- request
inputthe sequence of bytes to minimize.
- error one of the following:
ZX_ERR_BAD_STATEif another long-running workflow is in progress.- A socket error if transferring the input fails.
ZX_ERR_INVALID_ARGSif the providedtest_inputdoes not cause an error.
Cleanse
Attempts to replace bytes of the given test_input with “filler” bytes,
e.g. \x00, \xFF, without changing the error produced.
See Result for more details on long running workflows such as this
one.
To preserve backwards compatibility with libFuzzer and ClusterFuzz, an input that produces no result is not considered an error, and is returned as-is.
- request
inputthe sequence of bytes to cleanse.
- error one of the following:
ZX_ERR_BAD_STATEif another long-running workflow is in progress.- A socket error if transferring the input fails.
Merge
Attempts to shrink the corpora. Inputs from the seed corpus will be preserved. All other inputs will be sorted by amount of feedback produced and input size, and only those inputs that add new feedback not seen earlier in the sequence will be kept.
See Result for more details on long running workflows such as this
one.
- error one of the following:
ZX_ERR_BAD_STATEif another long-running workflow is in progress.ZX_ERR_INVALID_ARGSif an input in the seed corpus causes an error. Inputs in the live corpus that cause errors are skipped.
Fields
responder: ControllerMergeResponderGetStatus
Returns various fuzzing metrics, e.g. total coverage, speed, etc.
- response
statusthe current value of fuzzing metrics.
Fields
responder: ControllerGetStatusResponderWatchArtifact
Returns the results of a long-running workflow.
This method uses the
“hanging get” pattern.
Upon the first call for a given connection, it will immediately return
the controller’s current artifact. Upon subsequent calls, it will block
until the controller’s artifact changes before returning. Clients should
use GetStatus to ensure the fuzzer is not idle before making a
blocking call to WatchArtifact.
Combined with the Status.running value obtained from GetStatus, this
allows a (re-)connecting client to infer the state of the fuzzer:
- If the fuzzer is idle and has an empty artifact, then it is unchanged since the last connection, if any.
- If the fuzzer is running and has an empty artifact, then it is
performing a long-running workflow started by a previous connection.
The client may call
WatchArtifactagain to wait for the workflow to complete. - If the fuzzer is idle and has a non-empty artifact, then it has completed a long-running workflow since the last connection.
It is not an error for clients to disconnect while waiting for a response from this method. This method is intended to allow clients to resume waiting for a long-running workflow to complete after intentionally or inadvertently being disconnected for an indefinite amount of time.
- response
artifactthe most recent result and/or error-causing input.
Fields
responder: ControllerWatchArtifactResponderImplementations§
Source§impl ControllerRequest
impl ControllerRequest
pub fn into_configure(self) -> Option<(Options, ControllerConfigureResponder)>
pub fn into_get_options(self) -> Option<ControllerGetOptionsResponder>
pub fn into_add_to_corpus( self, ) -> Option<(Corpus, Input, ControllerAddToCorpusResponder)>
pub fn into_read_corpus( self, ) -> Option<(Corpus, ClientEnd<CorpusReaderMarker>, ControllerReadCorpusResponder)>
pub fn into_write_dictionary( self, ) -> Option<(Input, ControllerWriteDictionaryResponder)>
pub fn into_read_dictionary(self) -> Option<ControllerReadDictionaryResponder>
pub fn into_add_monitor( self, ) -> Option<(ClientEnd<MonitorMarker>, ControllerAddMonitorResponder)>
pub fn into_fuzz(self) -> Option<ControllerFuzzResponder>
pub fn into_try_one(self) -> Option<(Input, ControllerTryOneResponder)>
pub fn into_minimize(self) -> Option<(Input, ControllerMinimizeResponder)>
pub fn into_cleanse(self) -> Option<(Input, ControllerCleanseResponder)>
pub fn into_merge(self) -> Option<ControllerMergeResponder>
pub fn into_get_status(self) -> Option<ControllerGetStatusResponder>
pub fn into_watch_artifact(self) -> Option<ControllerWatchArtifactResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL