Skip to content
This repository was archived by the owner on Nov 1, 2023. It is now read-only.

Commit 4caaf8f

Browse files
authored
Remove old libfuzzer dotnet template (#2875)
### Context The original `libfuzzer dotnet` job template was a proof of concept that demonstrated how the `libfuzzer_fuzz` task could be used to express fuzzing via the (pre SharpFuzz 2.0) `libfuzzer-dotnet` tool. It (and its associated integration test) used a harness that linked an older version of SharpFuzz, and which is incompatible with LibFuzzerDotnetLoader (which requires SharpFuzz 2.0 or greater). ### Changes - Rename `libfuzzer dotnet_dll` job template to `libfuzzer dotnet`, making it the _only_ `libfuzzer-dotnet` template - Remove integration tests and docs for the old proof-of-concept job type ### Notice This is a breaking change. Closes #2874.
1 parent 42c4f62 commit 4caaf8f

File tree

11 files changed

+2
-458
lines changed

11 files changed

+2
-458
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,6 @@ jobs:
507507
(cd trivial-crash ; make )
508508
cp -r trivial-crash/fuzz.exe trivial-crash/seeds artifacts/linux-trivial-crash
509509
510-
mkdir -p artifacts/linux-libfuzzer-dotnet
511-
(cd libfuzzer-dotnet; make)
512-
cp -r libfuzzer-dotnet/my-fuzzer libfuzzer-dotnet/inputs artifacts/linux-libfuzzer-dotnet/
513-
514510
mkdir -p artifacts/linux-libfuzzer-dlopen
515511
(cd libfuzzer-dlopen; make)
516512
cp -r libfuzzer-dlopen/{fuzz.exe,*.so,seeds} artifacts/linux-libfuzzer-dlopen/

docs/how-to/fuzzing-dotnet-with-libfuzzer.md

Lines changed: 0 additions & 234 deletions
This file was deleted.

src/cli/onefuzz/templates/libfuzzer.py

Lines changed: 0 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -568,138 +568,6 @@ def merge(
568568
return helper.job
569569

570570
def dotnet(
571-
self,
572-
project: str,
573-
name: str,
574-
build: str,
575-
pool_name: PoolName,
576-
*,
577-
setup_dir: Directory,
578-
target_harness: str,
579-
vm_count: int = 1,
580-
inputs: Optional[Directory] = None,
581-
reboot_after_setup: bool = False,
582-
duration: int = 24,
583-
target_workers: Optional[int] = None,
584-
target_options: Optional[List[str]] = None,
585-
fuzzing_target_options: Optional[List[str]] = None,
586-
target_env: Optional[Dict[str, str]] = None,
587-
tags: Optional[Dict[str, str]] = None,
588-
wait_for_running: bool = False,
589-
wait_for_files: Optional[List[ContainerType]] = None,
590-
existing_inputs: Optional[Container] = None,
591-
readonly_inputs: Optional[Container] = None,
592-
debug: Optional[List[TaskDebugFlag]] = None,
593-
ensemble_sync_delay: Optional[int] = None,
594-
check_fuzzer_help: bool = True,
595-
expect_crash_on_failure: bool = False,
596-
notification_config: Optional[NotificationConfig] = None,
597-
) -> Optional[Job]:
598-
"""
599-
libfuzzer-dotnet task
600-
"""
601-
602-
# ensure containers exist
603-
if existing_inputs:
604-
self.onefuzz.containers.get(existing_inputs)
605-
606-
if readonly_inputs:
607-
self.onefuzz.containers.get(readonly_inputs)
608-
609-
harness = "libfuzzer-dotnet"
610-
611-
pool = self.onefuzz.pools.get(pool_name)
612-
if pool.os != OS.linux:
613-
raise Exception("libfuzzer-dotnet jobs are only compatible on linux")
614-
615-
target_exe = File(os.path.join(setup_dir, harness))
616-
if not os.path.exists(target_exe):
617-
raise Exception(f"missing harness: {target_exe}")
618-
619-
assembly_path = os.path.join(setup_dir, target_harness)
620-
if not os.path.exists(assembly_path):
621-
raise Exception(f"missing assembly: {target_harness}")
622-
623-
self._check_is_libfuzzer(target_exe)
624-
if target_options is None:
625-
target_options = []
626-
target_options = [
627-
"--target_path={setup_dir}/" + "{target_harness}"
628-
] + target_options
629-
630-
helper = JobHelper(
631-
self.onefuzz,
632-
self.logger,
633-
project,
634-
name,
635-
build,
636-
duration,
637-
pool_name=pool_name,
638-
target_exe=target_exe,
639-
)
640-
641-
helper.add_tags(tags)
642-
helper.define_containers(
643-
ContainerType.setup,
644-
ContainerType.inputs,
645-
ContainerType.crashes,
646-
)
647-
648-
if existing_inputs:
649-
helper.containers[ContainerType.inputs] = existing_inputs
650-
else:
651-
helper.define_containers(ContainerType.inputs)
652-
653-
if readonly_inputs:
654-
helper.containers[ContainerType.readonly_inputs] = readonly_inputs
655-
656-
fuzzer_containers = [
657-
(ContainerType.setup, helper.containers[ContainerType.setup]),
658-
(ContainerType.crashes, helper.containers[ContainerType.crashes]),
659-
(ContainerType.inputs, helper.containers[ContainerType.inputs]),
660-
]
661-
662-
helper.create_containers()
663-
helper.setup_notifications(notification_config)
664-
665-
helper.upload_setup(setup_dir, target_exe)
666-
if inputs:
667-
helper.upload_inputs(inputs)
668-
helper.wait_on(wait_for_files, wait_for_running)
669-
670-
# Build `target_options` for the `libfuzzer_fuzz` task.
671-
#
672-
# This allows passing arguments like `-runs` to the target only when
673-
# invoked in persistent fuzzing mode, and not test case repro mode.
674-
libfuzzer_fuzz_target_options = target_options.copy()
675-
676-
if fuzzing_target_options:
677-
libfuzzer_fuzz_target_options += fuzzing_target_options
678-
679-
self.onefuzz.tasks.create(
680-
helper.job.job_id,
681-
TaskType.libfuzzer_fuzz,
682-
harness,
683-
fuzzer_containers,
684-
pool_name=pool_name,
685-
reboot_after_setup=reboot_after_setup,
686-
duration=duration,
687-
vm_count=vm_count,
688-
target_options=libfuzzer_fuzz_target_options,
689-
target_env=target_env,
690-
target_workers=target_workers,
691-
tags=tags,
692-
debug=debug,
693-
ensemble_sync_delay=ensemble_sync_delay,
694-
check_fuzzer_help=check_fuzzer_help,
695-
expect_crash_on_failure=expect_crash_on_failure,
696-
)
697-
698-
self.logger.info("done creating tasks")
699-
helper.wait()
700-
return helper.job
701-
702-
def dotnet_dll(
703571
self,
704572
project: str,
705573
name: str,

0 commit comments

Comments
 (0)