Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloud-hypervisor: Collect all fuzzers automatically #12935

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

liuw
Copy link
Contributor

@liuw liuw commented Jan 14, 2025

No description provided.

Copy link

liuw is either the primary contact or is in the CCs list of projects/cloud-hypervisor.
liuw has previously contributed to projects/cloud-hypervisor. The previous PR was #10034

@liuw liuw closed this Jan 14, 2025
@liuw liuw reopened this Jan 14, 2025
@liuw
Copy link
Contributor Author

liuw commented Jan 14, 2025

@likebreath do you know why the coverage build failed? It complained that the x86emul binary is not available.

A few things I don't understand:

  1. In the failed task, the build script uses -O but the log shows that it still builds the dev profile.
  2. Even with the dev profile, there are binaries under release.
  3. The other job build (libfuzzer, address, x86_64) passes.

The only explanation I have right now is that task somehow disregards --features mshv_emulator.

@liuw liuw force-pushed the cloud-hypervisor-add-fuzzers branch 2 times, most recently from 1c11eba to f0ae671 Compare January 14, 2025 04:14
This eliminates the need to submit PRs to oss-fuzz every time a new
fuzzer is added.

Signed-off-by: Wei Liu <[email protected]>
@liuw liuw force-pushed the cloud-hypervisor-add-fuzzers branch from f0ae671 to a1eeefa Compare January 14, 2025 18:33
@liuw liuw changed the title cloud-hypervisor: add the new vsock and x86emul fuzzers cloud-hypervisor: Collect all fuzzers automatically Jan 14, 2025
@liuw
Copy link
Contributor Author

liuw commented Jan 14, 2025

@likebreath do you know why the coverage build failed? It complained that the x86emul binary is not available.

A few things I don't understand:

  1. In the failed task, the build script uses -O but the log shows that it still builds the dev profile.
  2. Even with the dev profile, there are binaries under release.
  3. The other job build (libfuzzer, address, x86_64) passes.

The only explanation I have right now is that task somehow disregards --features mshv_emulator.

I work around the issue by always building x86emul.

@vitorguidi
Copy link
Contributor

@rbradford can I go ahead and merge?

@rbradford
Copy link
Contributor

@vitorguidi Yes - please go ahead. Thanks!

@likebreath
Copy link
Contributor

@liuw I am glad to see this issue has been resolved. We can improve our cargo fuzz workflow to test it ahead. I believe cargo fuzz build by default only build with address sanitizer.

@liuw
Copy link
Contributor Author

liuw commented Jan 15, 2025

@liuw I am glad to see this issue has been resolved. We can improve our cargo fuzz workflow to test it ahead. I believe cargo fuzz build by default only build with address sanitizer.

For what it's worth, I build the coverage support for the fuzzers in a local branch. The local branch requires --features mshv_emulator to be specified.

 RUSTFLAGS="-Cinstrument-coverage " cargo +nightly-2024-07-11 fuzz build --features mshv_emulator 

This is what I run. I can see that x86emul is built. I opt to use the exact nightly compiler as oss-fuzz because the latest nightly doesn't work (building clap fails).

Obviously oss-fuzz sets far more flags than I do. Some of the flags can be causing the issue we see here.

That means unless we run oss-fuzz's build script in CH's CI, this particular issue cannot be caught.

@DavidKorczynski DavidKorczynski merged commit c42856e into google:master Jan 15, 2025
15 checks passed
@DavidKorczynski
Copy link
Collaborator

That means unless we run oss-fuzz's build script in CH's CI, this particular issue cannot be caught.

You can do this easily by way of CIFuzz: https://google.github.io/oss-fuzz/getting-started/continuous-integration/#continuous-integration

@liuw liuw deleted the cloud-hypervisor-add-fuzzers branch January 15, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants