mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-14 11:08:06 +00:00
add non-x86_64 architecture libfuzzer target support using qemu-user (#600)
This commit is contained in:
@ -42,6 +42,7 @@ BUILD = "0"
|
||||
class TemplateType(Enum):
|
||||
libfuzzer = "libfuzzer"
|
||||
libfuzzer_dotnet = "libfuzzer_dotnet"
|
||||
libfuzzer_qemu_user = "libfuzzer_qemu_user"
|
||||
afl = "afl"
|
||||
radamsa = "radamsa"
|
||||
|
||||
@ -57,6 +58,7 @@ class Integration(BaseModel):
|
||||
check_asan_log: Optional[bool] = Field(default=False)
|
||||
disable_check_debugger: Optional[bool] = Field(default=False)
|
||||
reboot_after_setup: Optional[bool] = Field(default=False)
|
||||
test_repro: Optional[bool] = Field(default=True)
|
||||
|
||||
|
||||
TARGETS: Dict[str, Integration] = {
|
||||
@ -84,6 +86,15 @@ TARGETS: Dict[str, Integration] = {
|
||||
use_setup=True,
|
||||
wait_for_files=[ContainerType.inputs, ContainerType.crashes],
|
||||
),
|
||||
"linux-libfuzzer-aarch64-crosscompile": Integration(
|
||||
template=TemplateType.libfuzzer_qemu_user,
|
||||
os=OS.linux,
|
||||
target_exe="fuzz.exe",
|
||||
inputs="inputs",
|
||||
use_setup=True,
|
||||
wait_for_files=[ContainerType.inputs, ContainerType.crashes],
|
||||
test_repro=False,
|
||||
),
|
||||
"linux-libfuzzer-rust": Integration(
|
||||
template=TemplateType.libfuzzer,
|
||||
os=OS.linux,
|
||||
@ -237,6 +248,17 @@ class TestOnefuzz:
|
||||
duration=1,
|
||||
vm_count=1,
|
||||
)
|
||||
elif config.template == TemplateType.libfuzzer_qemu_user:
|
||||
job = self.of.template.libfuzzer.qemu_user(
|
||||
self.project,
|
||||
target,
|
||||
BUILD,
|
||||
self.pools[config.os].name,
|
||||
inputs=inputs,
|
||||
target_exe=target_exe,
|
||||
duration=1,
|
||||
vm_count=1,
|
||||
)
|
||||
elif config.template == TemplateType.radamsa:
|
||||
job = self.of.template.radamsa.basic(
|
||||
self.project,
|
||||
@ -407,6 +429,10 @@ class TestOnefuzz:
|
||||
has_cdb = bool(which("cdb.exe"))
|
||||
has_gdb = bool(which("gdb"))
|
||||
for job_id in self.successful_jobs:
|
||||
if not TARGETS[self.target_jobs[job_id]].test_repro:
|
||||
self.logger.info("skipping repro for %s", self.target_jobs[job_id])
|
||||
continue
|
||||
|
||||
if self.job_os[job_id] == OS.linux and not has_gdb:
|
||||
self.logger.warning(
|
||||
"missing gdb in path, not launching repro: %s",
|
||||
|
Reference in New Issue
Block a user