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

handle libfuzzer fuzzing non-zero exits better #381

Merged
15 commits merged into from
Jan 5, 2021

Conversation

bmc-msft
Copy link
Contributor

When running libfuzzer in 'fuzzing' mode, we expect the following on exit.

If the exit code is zero, crashing input isn't required. This happens if the user specifies '-runs=N'

If the exit code is non-zero, then crashes are expected. In practice, there are two causes to non-zero exits.

  1. If the binary can't execute for some reason, like a missing prerequisite
  2. If the binary can execute, sometimes the sanitizers are put in such a bad place that they are unable to record the input that caused the crash.

This PR enables handling these two non-zero exit cases.

  1. Optionally verify the libfuzzer target loads appropriately using target_exe -help=1. This allows failing faster in the common issues, such a missing prerequisite library.
  2. Optionally allow non-zero exits without crashes to be a warning, rather than a task failure.

@bmc-msft bmc-msft linked an issue Dec 10, 2020 that may be closed by this pull request
@bmc-msft
Copy link
Contributor Author

This passed integration tests.

src/agent/onefuzz/src/libfuzzer.rs Show resolved Hide resolved
docs/webhook_events.md Show resolved Hide resolved
docs/webhook_events.md Outdated Show resolved Hide resolved
@ghost
Copy link

ghost commented Jan 5, 2021

Hello @bmc-msft!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 37f06bb into microsoft:main Jan 5, 2021
@bmc-msft bmc-msft deleted the make-libfuzzer-failures-optional branch January 20, 2021 11:12
@ghost ghost locked as resolved and limited conversation to collaborators Apr 17, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enable optionally libfuzzer crashes that don't leave an input
3 participants