mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-17 04:18:07 +00:00
Add option to specify a known crash container (#2950)
* add option to upload known crash directory * specify a container instead of a directory * remove crash upload
This commit is contained in:
@ -357,6 +357,7 @@ class Libfuzzer(Command):
|
||||
analyzer_env: Optional[Dict[str, str]] = None,
|
||||
tools: Optional[Container] = None,
|
||||
extra_container: Optional[Container] = None,
|
||||
crashes: Optional[Container] = None,
|
||||
) -> Optional[Job]:
|
||||
"""
|
||||
Basic libfuzzer job
|
||||
@ -372,6 +373,9 @@ class Libfuzzer(Command):
|
||||
if readonly_inputs:
|
||||
self.onefuzz.containers.get(readonly_inputs)
|
||||
|
||||
if crashes:
|
||||
self.onefuzz.containers.get(crashes)
|
||||
|
||||
if dryrun:
|
||||
return None
|
||||
|
||||
@ -412,6 +416,9 @@ class Libfuzzer(Command):
|
||||
if readonly_inputs:
|
||||
helper.containers[ContainerType.readonly_inputs] = readonly_inputs
|
||||
|
||||
if crashes:
|
||||
helper.containers[ContainerType.crashes] = crashes
|
||||
|
||||
if analyzer_exe is not None:
|
||||
helper.define_containers(ContainerType.analysis)
|
||||
|
||||
@ -635,6 +642,7 @@ class Libfuzzer(Command):
|
||||
expect_crash_on_failure: bool = False,
|
||||
notification_config: Optional[NotificationConfig] = None,
|
||||
extra_container: Optional[Container] = None,
|
||||
crashes: Optional[Container] = None,
|
||||
) -> Optional[Job]:
|
||||
pool = self.onefuzz.pools.get(pool_name)
|
||||
|
||||
@ -645,6 +653,9 @@ class Libfuzzer(Command):
|
||||
if readonly_inputs:
|
||||
self.onefuzz.containers.get(readonly_inputs)
|
||||
|
||||
if crashes:
|
||||
self.onefuzz.containers.get(crashes)
|
||||
|
||||
# We _must_ proactively specify the OS based on pool.
|
||||
#
|
||||
# This is because managed DLLs are always (Windows-native) PE files, so the job
|
||||
@ -698,6 +709,9 @@ class Libfuzzer(Command):
|
||||
if readonly_inputs:
|
||||
helper.containers[ContainerType.readonly_inputs] = readonly_inputs
|
||||
|
||||
if crashes:
|
||||
helper.containers[ContainerType.crashes] = crashes
|
||||
|
||||
# Assumes that `libfuzzer-dotnet` and supporting tools were uploaded upon deployment.
|
||||
fuzzer_tools_container = Container(
|
||||
"dotnet-fuzzing-linux" if platform == OS.linux else "dotnet-fuzzing-windows"
|
||||
@ -855,6 +869,7 @@ class Libfuzzer(Command):
|
||||
check_retry_count: Optional[int] = 300,
|
||||
check_fuzzer_help: bool = True,
|
||||
extra_container: Optional[Container] = None,
|
||||
crashes: Optional[Container] = None,
|
||||
) -> Optional[Job]:
|
||||
"""
|
||||
libfuzzer tasks, wrapped via qemu-user (PREVIEW FEATURE)
|
||||
@ -907,6 +922,10 @@ class Libfuzzer(Command):
|
||||
else:
|
||||
helper.define_containers(ContainerType.inputs)
|
||||
|
||||
if crashes:
|
||||
self.onefuzz.containers.get(crashes)
|
||||
helper.containers[ContainerType.crashes] = crashes
|
||||
|
||||
fuzzer_containers = [
|
||||
(ContainerType.setup, helper.containers[ContainerType.setup]),
|
||||
(ContainerType.crashes, helper.containers[ContainerType.crashes]),
|
||||
|
Reference in New Issue
Block a user