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

libfuzzer merge template mistakenly requires the UniqueReports container type instead of UniqueInputs #2955

@puhley

Description

@puhley

Information

  • Onefuzz version: 6.4.0
  • OS: Ubuntu

Provide detailed reproduction steps (if any)

  1. When performing a onefuzz template libfuzzer merge ... command, the task will fail with the following error:
ERROR:cli:command failed: request did not succeed (400: INVALID_REQUEST): container type UniqueReports: expected Equal 1, got 0
  1. This error is generated from the CheckContainer function:
    https://github.com/microsoft/onefuzz/blob/main/src/ApiService/ApiService/onefuzzlib/Config.cs#L526

CheckContainer is a child of CheckContainers:
https://github.com/microsoft/onefuzz/blob/main/src/ApiService/ApiService/onefuzzlib/Config.cs#L478

This code path is attempting to validate that all of the required container types for the task are present before beginning the task.

  1. The definition of the required containers for a libfuzzer merge task is located here:
    https://github.com/microsoft/onefuzz/blob/main/src/ApiService/ApiService/onefuzzlib/Defs.cs#L402

Within that list of required containers is the ContainerType.UniqueReports which has an expected value of 1. This matches the error that is being produced.

  1. In the onefuzz template libfuzzer merge ... command, the parameter --output_container is specified. In the libfuzzer template, that container will be specified as a UniqueInputs ContainerType.
    https://github.com/microsoft/onefuzz/blob/main/src/cli/onefuzz/templates/libfuzzer.py#L556

I believe that the source of this bug is that the libfuzzer template code is specifying the output_container as a UniqueInputs container type and that the Defs file is expecting a UniqueReports container type.

Expected result

The merge command should successfully produce a new set of files based on the two provided containers.

Actual result

An error regarding the need for a UniqueReports container.

Other Notes

I have not confirmed that changing UniqueReports to UniqueInputs fixes the problem. This analysis is solely based on code review.

The libfuzzer container requirement for a general inputs container should be satisfied by the --existing_inputs parameter in the OneFuzz merge command.

AB#45414

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions