-
Notifications
You must be signed in to change notification settings - Fork 30
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
rmm: Initial fuzzing setup #418
base: main
Are you sure you want to change the base?
Conversation
5ebd870
to
31be3c3
Compare
31be3c3
to
2524108
Compare
Just rebased. I think the CI should work now. |
CI log says that I attach a part of the log below.
|
I've fixed the issue with the pushed commit. |
rmm/src/rec/timer.rs
Outdated
timer.cntp_cval_el0 = CNTP_CVAL_EL0.get(); | ||
timer.cntp_ctl_el0 = CNTP_CTL_EL0.get(); | ||
timer.cnthctl_el2 = CNTHCTL_EL2.get(); | ||
#[cfg(not(fuzzing))] |
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.
Rather than putting it here, could you handle it at into/from_current() in rmm/src/rec/context.rs? This looks more cosistent to me.
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.
I had attempted this, but the compiler would still complain about the following.
error: expected readable system register
--> /home/parallels/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aarch64-cpu-10.0.0/src/registers/macros.rs:18:42
|
18 | ... core::arch::asm!(concat!($asm_instr, " {reg:", $asm_width, "}, ", ...
| ^
|
note: instantiated into assembly here
--> <inline asm>:1:10
|
1 | mrs x8, CNTPOFF_EL2
| ^
error: expected writable system register or pstate
--> /home/parallels/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aarch64-cpu-10.0.0/src/registers/macros.rs:40:42
|
40 | ... core::arch::asm!(concat!($asm_instr, " ", $asm_reg_name, ", {reg:"...
| ^
|
note: instantiated into assembly here
--> <inline asm>:1:6
|
1 | msr CNTPOFF_EL2, x1
I followed your approach but also added the cfg switch to the entire save_state
and restore_state
functions in timer.rs
to make it compile successfully. Let me know if this is acceptable to you.
@@ -0,0 +1,26 @@ | |||
[package] |
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.
Refer other manifest file format, for instance, islet/rmm/Cargo.toml, and fill the fields on [package]
.
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.
Done, I fixed up the author name and versioning to be consistent with other crate's manifests.
Signed-off-by: Rayhan Faizel <[email protected]>
Signed-off-by: Rayhan Faizel <[email protected]>
Signed-off-by: Rayhan Faizel <[email protected]>
It may resolve the below error in CI's rule-checker. ``` error[E0463]: can't find crate for `std` | = note: the `aarch64-unknown-none-softfloat` target may not support the standard library = note: `std` is required by `arbitrary` because it does not declare `#![no_std]` = help: consider building the standard library from source with `cargo build -Zbuild-std` Checking uart v0.0.1 (/home/runner/work/islet/islet/lib/uart) Checking bitflags v1.3.2 ``` Signed-off-by: Changho Choi <[email protected]>
cd063ea
to
9f6b70a
Compare
(LFX Task 1)
This PR adds the initial fuzzing setup based on libfuzzer-sys along with two harnesses for RMI commands: FEATURES and VERSION.
Two scripts are provided:
./scripts/fuzz.sh <fuzzer_name> <var_args>
- Runs the fuzzer. The script will run the fuzzer natively if the host is aarch64, otherwise it will fall back to QEMU userspace emulator../scripts/fuzz-coverage.sh <fuzzer_name> <duration>
- Based on./scripts/code-coverage.sh
, the fuzzer is run for a set duration and an html report is generated after at./code-coverage/index.html
.