Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/cli/onefuzz/templates/libfuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ def basic(
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
Expand All @@ -372,6 +373,9 @@ def basic(
if readonly_inputs:
self.onefuzz.containers.get(readonly_inputs)

if crashes:
self.onefuzz.containers.get(crashes)

if dryrun:
return None

Expand Down Expand Up @@ -412,6 +416,9 @@ def basic(
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)

Expand Down Expand Up @@ -635,6 +642,7 @@ def dotnet(
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)

Expand All @@ -645,6 +653,9 @@ def dotnet(
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
Expand Down Expand Up @@ -698,6 +709,9 @@ def dotnet(
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"
Expand Down Expand Up @@ -855,6 +869,7 @@ def qemu_user(
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)
Expand Down Expand Up @@ -907,6 +922,10 @@ def qemu_user(
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]),
Expand Down