LibAFL icon indicating copy to clipboard operation
LibAFL copied to clipboard

Instrumentation filters remove generic bound

Open cube0x8 opened this issue 1 year ago • 1 comments

First attempt at fixing #2037

  • bound for generic S: UsesInput has been removed for HasInstrumentationFilter
  • implementation of StdInstrumentationFilter and HasInstrumentationFilter has been removed for (QemuHelper, ())

Should we remove the bound from StdInstrumentationFilter as well?

cube0x8 avatar Apr 15 '24 08:04 cube0x8

Doesn't look like systemmode still builds here:

[cargo-make][3] INFO - Execute Command: "cargo" "build" "--profile" "dev" "--no-default-features" "--features" "std,breakpoint" "--target-dir" "/__w/LibAFL/LibAFL/target"
   Compiling libafl_qemu_sys v0.12.0 (/__w/LibAFL/LibAFL/libafl_qemu/libafl_qemu_sys)
   Compiling qemu_systemmode v0.12.0 (/__w/LibAFL/LibAFL/fuzzers/qemu_systemmode)
   Compiling libafl_qemu v0.12.0 (/__w/LibAFL/LibAFL/libafl_qemu)
error[E0277]: the trait bound `(QemuEdgeCoverageHelper, ()): StdInstrumentationFilter<_>` is not satisfied
    --> src/fuzzer_breakpoint.rs:128:27
     |
128  |                 match emu.run(input, qemu_executor_state) {
     |                           ^^^ the trait `StdInstrumentationFilter<_>` is not implemented for `(QemuEdgeCoverageHelper, ())`, which is required by `StdEmuExitHandler<FastSnapshotManager>: EmuExitHandler<_, _>`
     |
     = help: the trait `EmuExitHandler<QT, S>` is implemented for `StdEmuExitHandler<SM>`
     = note: required for `StdEmuExitHandler<FastSnapshotManager>` to implement `EmuExitHandler<(QemuEdgeCoverageHelper, ()), _>`
note: required by a bound in `Emulator::<QT, S, E>::run`
    --> /__w/LibAFL/LibAFL/libafl_qemu/src/emu/mod.rs:1344:8
     |
1344 |     E: EmuExitHandler<QT, S>,
     |        ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Emulator::<QT, S, E>::run`
...
1563 |     pub unsafe fn run(
     |                   --- required by a bound in this associated function
...

domenukk avatar May 09 '24 08:05 domenukk

yes, it breaks systemmode. I need some time to look at it better and re-implement the filters for systemmode without that generic bound.

cube0x8 avatar May 14 '24 11:05 cube0x8