mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-10 01:01:34 +00:00
expose minimized_stack_depth functionality in the CLI/API (#715)
This commit is contained in:
parent
92d8299412
commit
516b1e000e
@ -1702,6 +1702,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
|
|||||||
"title": "Generator Options",
|
"title": "Generator Options",
|
||||||
"type": "array"
|
"type": "array"
|
||||||
},
|
},
|
||||||
|
"minimized_stack_depth": {
|
||||||
|
"title": "Minimized Stack Depth",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"preserve_existing_outputs": {
|
"preserve_existing_outputs": {
|
||||||
"title": "Preserve Existing Outputs",
|
"title": "Preserve Existing Outputs",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
@ -2192,6 +2196,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
|
|||||||
"title": "Generator Options",
|
"title": "Generator Options",
|
||||||
"type": "array"
|
"type": "array"
|
||||||
},
|
},
|
||||||
|
"minimized_stack_depth": {
|
||||||
|
"title": "Minimized Stack Depth",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"preserve_existing_outputs": {
|
"preserve_existing_outputs": {
|
||||||
"title": "Preserve Existing Outputs",
|
"title": "Preserve Existing Outputs",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
@ -2627,6 +2635,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
|
|||||||
"title": "Generator Options",
|
"title": "Generator Options",
|
||||||
"type": "array"
|
"type": "array"
|
||||||
},
|
},
|
||||||
|
"minimized_stack_depth": {
|
||||||
|
"title": "Minimized Stack Depth",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"preserve_existing_outputs": {
|
"preserve_existing_outputs": {
|
||||||
"title": "Preserve Existing Outputs",
|
"title": "Preserve Existing Outputs",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
@ -3036,6 +3048,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
|
|||||||
"title": "Generator Options",
|
"title": "Generator Options",
|
||||||
"type": "array"
|
"type": "array"
|
||||||
},
|
},
|
||||||
|
"minimized_stack_depth": {
|
||||||
|
"title": "Minimized Stack Depth",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"preserve_existing_outputs": {
|
"preserve_existing_outputs": {
|
||||||
"title": "Preserve Existing Outputs",
|
"title": "Preserve Existing Outputs",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
@ -3472,6 +3488,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
|
|||||||
"title": "Generator Options",
|
"title": "Generator Options",
|
||||||
"type": "array"
|
"type": "array"
|
||||||
},
|
},
|
||||||
|
"minimized_stack_depth": {
|
||||||
|
"title": "Minimized Stack Depth",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"preserve_existing_outputs": {
|
"preserve_existing_outputs": {
|
||||||
"title": "Preserve Existing Outputs",
|
"title": "Preserve Existing Outputs",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
@ -4782,6 +4802,10 @@ Each event will be submitted via HTTP POST to the user provided URL.
|
|||||||
"title": "Generator Options",
|
"title": "Generator Options",
|
||||||
"type": "array"
|
"type": "array"
|
||||||
},
|
},
|
||||||
|
"minimized_stack_depth": {
|
||||||
|
"title": "Minimized Stack Depth",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"preserve_existing_outputs": {
|
"preserve_existing_outputs": {
|
||||||
"title": "Preserve Existing Outputs",
|
"title": "Preserve Existing Outputs",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
@ -311,6 +311,17 @@ libfuzzer_linux = JobTemplate(
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
UserField(
|
||||||
|
name="minimized_stack_depth",
|
||||||
|
help="Number of frames to include in the minimized stack",
|
||||||
|
type=UserFieldType.Int,
|
||||||
|
locations=[
|
||||||
|
UserFieldLocation(
|
||||||
|
op=UserFieldOperation.replace,
|
||||||
|
path="/tasks/1/task/minimized_stack_depth",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
UserField(
|
UserField(
|
||||||
name="tags",
|
name="tags",
|
||||||
help=TAGS_HELP,
|
help=TAGS_HELP,
|
||||||
|
@ -351,6 +351,9 @@ def build_task_config(
|
|||||||
if TaskFeature.report_list in definition.features:
|
if TaskFeature.report_list in definition.features:
|
||||||
config.report_list = task_config.task.report_list
|
config.report_list = task_config.task.report_list
|
||||||
|
|
||||||
|
if TaskFeature.minimized_stack_depth in definition.features:
|
||||||
|
config.minimized_stack_depth = task_config.task.minimized_stack_depth
|
||||||
|
|
||||||
if TaskFeature.expect_crash_on_failure in definition.features:
|
if TaskFeature.expect_crash_on_failure in definition.features:
|
||||||
config.expect_crash_on_failure = (
|
config.expect_crash_on_failure = (
|
||||||
task_config.task.expect_crash_on_failure
|
task_config.task.expect_crash_on_failure
|
||||||
|
@ -106,6 +106,7 @@ TASK_DEFINITIONS = {
|
|||||||
TaskFeature.target_timeout,
|
TaskFeature.target_timeout,
|
||||||
TaskFeature.check_retry_count,
|
TaskFeature.check_retry_count,
|
||||||
TaskFeature.check_fuzzer_help,
|
TaskFeature.check_fuzzer_help,
|
||||||
|
TaskFeature.minimized_stack_depth,
|
||||||
],
|
],
|
||||||
vm=VmDefinition(compare=Compare.AtLeast, value=1),
|
vm=VmDefinition(compare=Compare.AtLeast, value=1),
|
||||||
containers=[
|
containers=[
|
||||||
@ -378,6 +379,7 @@ TASK_DEFINITIONS = {
|
|||||||
TaskFeature.check_asan_log,
|
TaskFeature.check_asan_log,
|
||||||
TaskFeature.check_debugger,
|
TaskFeature.check_debugger,
|
||||||
TaskFeature.check_retry_count,
|
TaskFeature.check_retry_count,
|
||||||
|
TaskFeature.minimized_stack_depth,
|
||||||
],
|
],
|
||||||
vm=VmDefinition(compare=Compare.AtLeast, value=1),
|
vm=VmDefinition(compare=Compare.AtLeast, value=1),
|
||||||
containers=[
|
containers=[
|
||||||
@ -424,6 +426,7 @@ TASK_DEFINITIONS = {
|
|||||||
TaskFeature.check_debugger,
|
TaskFeature.check_debugger,
|
||||||
TaskFeature.check_retry_count,
|
TaskFeature.check_retry_count,
|
||||||
TaskFeature.report_list,
|
TaskFeature.report_list,
|
||||||
|
TaskFeature.minimized_stack_depth,
|
||||||
],
|
],
|
||||||
vm=VmDefinition(compare=Compare.AtLeast, value=1),
|
vm=VmDefinition(compare=Compare.AtLeast, value=1),
|
||||||
containers=[
|
containers=[
|
||||||
@ -487,6 +490,7 @@ TASK_DEFINITIONS = {
|
|||||||
TaskFeature.check_fuzzer_help,
|
TaskFeature.check_fuzzer_help,
|
||||||
TaskFeature.check_retry_count,
|
TaskFeature.check_retry_count,
|
||||||
TaskFeature.report_list,
|
TaskFeature.report_list,
|
||||||
|
TaskFeature.minimized_stack_depth,
|
||||||
],
|
],
|
||||||
vm=VmDefinition(compare=Compare.AtLeast, value=1),
|
vm=VmDefinition(compare=Compare.AtLeast, value=1),
|
||||||
containers=[
|
containers=[
|
||||||
|
@ -848,6 +848,7 @@ class Tasks(Endpoint):
|
|||||||
preserve_existing_outputs: bool = False,
|
preserve_existing_outputs: bool = False,
|
||||||
colocate: bool = False,
|
colocate: bool = False,
|
||||||
report_list: Optional[List[str]] = None,
|
report_list: Optional[List[str]] = None,
|
||||||
|
minimized_stack_depth: Optional[int] = None,
|
||||||
) -> models.Task:
|
) -> models.Task:
|
||||||
"""
|
"""
|
||||||
Create a task
|
Create a task
|
||||||
@ -912,6 +913,7 @@ class Tasks(Endpoint):
|
|||||||
wait_for_files=task_wait_for_files,
|
wait_for_files=task_wait_for_files,
|
||||||
report_list=report_list,
|
report_list=report_list,
|
||||||
preserve_existing_outputs=preserve_existing_outputs,
|
preserve_existing_outputs=preserve_existing_outputs,
|
||||||
|
minimized_stack_depth=minimized_stack_depth,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -59,6 +59,7 @@ class Libfuzzer(Command):
|
|||||||
colocate_secondary_tasks: bool = True,
|
colocate_secondary_tasks: bool = True,
|
||||||
check_fuzzer_help: bool = True,
|
check_fuzzer_help: bool = True,
|
||||||
expect_crash_on_failure: bool = True,
|
expect_crash_on_failure: bool = True,
|
||||||
|
minimized_stack_depth: Optional[int] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
||||||
regression_containers = [
|
regression_containers = [
|
||||||
@ -89,6 +90,7 @@ class Libfuzzer(Command):
|
|||||||
check_fuzzer_help=check_fuzzer_help,
|
check_fuzzer_help=check_fuzzer_help,
|
||||||
debug=debug,
|
debug=debug,
|
||||||
colocate=colocate_all_tasks or colocate_secondary_tasks,
|
colocate=colocate_all_tasks or colocate_secondary_tasks,
|
||||||
|
minimized_stack_depth=minimized_stack_depth,
|
||||||
)
|
)
|
||||||
|
|
||||||
fuzzer_containers = [
|
fuzzer_containers = [
|
||||||
@ -175,6 +177,7 @@ class Libfuzzer(Command):
|
|||||||
check_fuzzer_help=check_fuzzer_help,
|
check_fuzzer_help=check_fuzzer_help,
|
||||||
debug=debug,
|
debug=debug,
|
||||||
colocate=colocate_all_tasks or colocate_secondary_tasks,
|
colocate=colocate_all_tasks or colocate_secondary_tasks,
|
||||||
|
minimized_stack_depth=minimized_stack_depth,
|
||||||
)
|
)
|
||||||
|
|
||||||
def basic(
|
def basic(
|
||||||
@ -208,6 +211,7 @@ class Libfuzzer(Command):
|
|||||||
colocate_secondary_tasks: bool = True,
|
colocate_secondary_tasks: bool = True,
|
||||||
check_fuzzer_help: bool = True,
|
check_fuzzer_help: bool = True,
|
||||||
expect_crash_on_failure: bool = True,
|
expect_crash_on_failure: bool = True,
|
||||||
|
minimized_stack_depth: Optional[int] = None,
|
||||||
) -> Optional[Job]:
|
) -> Optional[Job]:
|
||||||
"""
|
"""
|
||||||
Basic libfuzzer job
|
Basic libfuzzer job
|
||||||
@ -288,6 +292,7 @@ class Libfuzzer(Command):
|
|||||||
colocate_secondary_tasks=colocate_secondary_tasks,
|
colocate_secondary_tasks=colocate_secondary_tasks,
|
||||||
check_fuzzer_help=check_fuzzer_help,
|
check_fuzzer_help=check_fuzzer_help,
|
||||||
expect_crash_on_failure=expect_crash_on_failure,
|
expect_crash_on_failure=expect_crash_on_failure,
|
||||||
|
minimized_stack_depth=minimized_stack_depth,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.logger.info("done creating tasks")
|
self.logger.info("done creating tasks")
|
||||||
|
@ -79,6 +79,7 @@ class TaskFeature(Enum):
|
|||||||
check_fuzzer_help = "check_fuzzer_help"
|
check_fuzzer_help = "check_fuzzer_help"
|
||||||
expect_crash_on_failure = "expect_crash_on_failure"
|
expect_crash_on_failure = "expect_crash_on_failure"
|
||||||
report_list = "report_list"
|
report_list = "report_list"
|
||||||
|
minimized_stack_depth = "minimized_stack_depth"
|
||||||
|
|
||||||
|
|
||||||
# Permissions for an Azure Blob Storage Container.
|
# Permissions for an Azure Blob Storage Container.
|
||||||
|
@ -171,6 +171,7 @@ class TaskDetails(BaseModel):
|
|||||||
ensemble_sync_delay: Optional[int]
|
ensemble_sync_delay: Optional[int]
|
||||||
preserve_existing_outputs: Optional[bool]
|
preserve_existing_outputs: Optional[bool]
|
||||||
report_list: Optional[List[str]]
|
report_list: Optional[List[str]]
|
||||||
|
minimized_stack_depth: Optional[int]
|
||||||
|
|
||||||
@validator("check_retry_count", allow_reuse=True)
|
@validator("check_retry_count", allow_reuse=True)
|
||||||
def validate_check_retry_count(cls, value: int) -> int:
|
def validate_check_retry_count(cls, value: int) -> int:
|
||||||
@ -399,6 +400,7 @@ class TaskUnitConfig(BaseModel):
|
|||||||
stats_format: Optional[StatsFormat]
|
stats_format: Optional[StatsFormat]
|
||||||
ensemble_sync_delay: Optional[int]
|
ensemble_sync_delay: Optional[int]
|
||||||
report_list: Optional[List[str]]
|
report_list: Optional[List[str]]
|
||||||
|
minimized_stack_depth: Optional[int]
|
||||||
|
|
||||||
# from here forwards are Container definitions. These need to be inline
|
# from here forwards are Container definitions. These need to be inline
|
||||||
# with TaskDefinitions and ContainerTypes
|
# with TaskDefinitions and ContainerTypes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user