-
Notifications
You must be signed in to change notification settings - Fork 110
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
Update fuzzing test to check for simpleguest in same directory as executable #324
Update fuzzing test to check for simpleguest in same directory as executable #324
Conversation
9564dc0
to
001a36d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR enhances the fuzzing test by updating the mechanism for locating the simple guest binary. Key changes include:
- Introducing simple_guest_for_fuzzing_as_string to try locating the guest binary in the same directory as the executable.
- Falling back to the existing simple_guest_as_string method if the binary isn’t found.
- Updating the fuzz target to use the new function.
Reviewed Changes
File | Description |
---|---|
src/hyperlight_testing/src/lib.rs | Added simple_guest_for_fuzzing_as_string using env::current_exe to locate the guest binary at runtime. |
src/hyperlight_host/fuzz/fuzz_targets/fuzz_target_1.rs | Updated fuzz target to obtain the guest binary via simple_guest_for_fuzzing_as_string. |
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/hyperlight_testing/src/lib.rs:2
- The function call to 'rust_guest_as_pathbuf' in simple_guest_as_string is inconsistent with the earlier defined 'c_guest_as_pathbuf'. Please confirm if this discrepancy is intentional or update for naming consistency.
let buf = rust_guest_as_pathbuf("simpleguest");
a2033ea
to
bd1b172
Compare
9eba2da
to
f11169f
Compare
4c16bbf
to
a9c5f22
Compare
Signed-off-by: Mark Rossett <marosset@microsoft.com>
Signed-off-by: Mark Rossett <marosset@microsoft.com>
Signed-off-by: Mark Rossett <marosset@microsoft.com>
a9c5f22
to
20b6949
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR updates the fuzzing tests to ensure that the guest binary (simpleguest) is located in the same directory as the fuzzing executable, and it adjusts various configuration files to align with the new naming conventions. Key changes include:
- Adding a new function in lib.rs to prefer a local guest binary during fuzzing.
- Updating references across fuzz targets to use the new function and binary names.
- Modifying workflow and Cargo.toml configurations to reflect updated target names.
Reviewed Changes
File | Description |
---|---|
src/hyperlight_testing/src/lib.rs | Introduced simple_guest_for_fuzzing_as_string to locate the guest binary |
.github/workflows/ValidatePullRequest.yml | Updated target names for fuzzing |
.github/workflows/Fuzzing.yml | Updated target names for fuzzing |
fuzz/fuzz_targets/*.rs | Replaced usage of simple_guest_as_string with new function usage |
fuzz/Cargo.toml | Renamed binaries to include fuzz_ prefix |
fuzz/README.md | Updated command examples to reflect new binary names |
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/hyperlight_testing/src/lib.rs:149
- [nitpick] The error message 'Invalid path string' could be more descriptive by including contextual information about the path conversion failure.
.ok_or(anyhow("Invalid path string"))?
Some fuzzing scenarios we want to report require building a fuzzing binary with
cargo fuzz build
and submitting that binary to a fuzzing harness. In those instances we also want to submit a guestbinary and this PR makes sure that the guestbinary can be found in the same directory as the fuzzing binary.